Add datatype to param()

This commit is contained in:
Markus Fleschutz
2021-07-15 15:51:22 +02:00
parent 35255539df
commit b97098fc42
109 changed files with 256 additions and 216 deletions

View File

@ -11,8 +11,7 @@
Author: Markus Fleschutz / License: CC0
#>
param($FilePattern = "")
if ($FilePattern -eq "" ) { $FilePattern = read-host "Enter the file pattern" }
param([string]$FilePattern = "")
function DetectSourceLang { param([string]$Filename)
if ("$Filename" -like "*Deutsch*") { return "de" }
@ -30,6 +29,8 @@ function TranslateFilename { param([string]$Filename, [string]$SourceLang, [stri
}
try {
if ($FilePattern -eq "" ) { $FilePattern = read-host "Enter the file pattern" }
$TargetLanguages = "ar","zh","fr","de","hi","ga","it","ja","ko","pt","ru","es"
$SourceFiles = get-childItem -path "$FilePattern"
foreach($SourceFile in $SourceFiles) {