diff --git a/src/ReadScriptFile.ps1 b/src/ReadScriptFile.ps1 index 9ff5aa0f..65e689fc 100644 --- a/src/ReadScriptFile.ps1 +++ b/src/ReadScriptFile.ps1 @@ -139,7 +139,7 @@ function Preprocessor($Content, $FilePath) { $Params["no$pragmaname"] = [Switch]-not $value } } - elseif ($ParamList[$pragmaname].ParameterType -eq [string]) { + elseif ($ParamList[$pragmaname].ParameterType -eq [string] -or $ParamList[$pragmaname+"File"].ParameterType -eq [string]) { if ($value -match '^\"(?[^\"]*)\"\s*(?!#.*)') { $value = $Matches["value"].Replace('$PSScriptRoot', $ScriptRoot) } @@ -149,7 +149,12 @@ function Preprocessor($Content, $FilePath) { else { $value = $value.Replace('$PSScriptRoot', $ScriptRoot) } - $Params[$pragmaname] = $value + if ($ParamList[$pragmaname].ParameterType -eq [string]) { + $Params[$pragmaname] = $value + } + elseif ($ParamList[$pragmaname+"File"].ParameterType -eq [string]) { + $Params[$pragmaname+"File"] = $value + } } elseif ($ParamList[$pragmaname].ParameterType) { Write-I18n Warning UnknownPragmaBadParameterType $($pragmaname, $ParamList[$pragmaname].ParameterType)