Skip to content

Commit ba67428

Browse files
committed
Resolve issue processing variable tied to Show-InstallationWelcome's -CloseApps parameter
1 parent bc7cf03 commit ba67428

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/PSAppDeployToolkit.Tools/PSScriptAnalyzer/Measure-ADTCompatibility.psm1

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,19 +1884,12 @@ function Measure-ADTCompatibility
18841884
'ForceCloseAppsCountdown' = { "-ForceCloseProcessesCountdown $_" }
18851885
'AllowDeferCloseApps' = '-AllowDeferCloseProcesses' # Should inspect switch values here in case of -Switch:$false
18861886
'CloseApps' = {
1887-
if ($boundParameters.CloseApps.Value.StringConstantType -eq 'DoubleQuoted')
1887+
if ($_ -match '^$')
18881888
{
1889-
$quoteChar = '"'
1890-
}
1891-
elseif ($boundParameters.CloseApps.Value.StringConstantType -eq 'DoubleQuoted')
1892-
{
1893-
$quoteChar = "'"
1894-
}
1895-
else
1896-
{
1897-
# Not a string, pass through original value
1889+
# This is a variable, Not a string, pass through original value
18981890
return "-CloseProcesses $_"
18991891
}
1892+
$quoteChar = if ($_.StartsWith('"')) { '"' } else { "'" }
19001893
$closeProcesses = $_.ToString().Trim('"').Trim("'") -split ',' | & {
19011894
process
19021895
{

0 commit comments

Comments
 (0)