mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-23 18:38:19 +02:00
Updated translate-file.ps1
This commit is contained in:
parent
7709dc0ae1
commit
69c8c48203
@ -11,15 +11,16 @@ if ($SourceFile -eq "" ) {
|
|||||||
$SourceFile = read-host "Enter path to file"
|
$SourceFile = read-host "Enter path to file"
|
||||||
}
|
}
|
||||||
if ($SourceLanguage -eq "" ) {
|
if ($SourceLanguage -eq "" ) {
|
||||||
$SourceLanguage = read-host "Enter source language"
|
$SourceLanguage = read-host "Enter language of this file"
|
||||||
}
|
}
|
||||||
if ($TargetLanguage -eq "" ) {
|
if ($TargetLanguage -eq "" ) {
|
||||||
$TargetLanguage = read-host "Enter target language"
|
$TargetLanguage = read-host "Enter language to translate to"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$ScriptPath=$MyInvocation.MyCommand.Path
|
$PathToScript=(get-item $MyInvocation.MyCommand.Path).directory
|
||||||
$ScriptPath/trans -i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief
|
$PathToScript="$PathToScript/trans"
|
||||||
|
Start-Process -FilePath $PathToScript -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user