Skip to content

Commit 2af473a

Browse files
committed
Add parameter transforms for Path and Transform with Execute-MSI
1 parent f46faf8 commit 2af473a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,11 +723,12 @@ function Measure-ADTCompatibility
723723
'Execute-MSI' = @{
724724
'NewFunction' = 'Start-ADTMsiProcess'
725725
'TransformParameters' = @{
726-
'Path' = { "-FilePath $_" }
726+
'Path' = { if ($_ -match '^[''"]?\{?([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}?[''"]?$') { "-ProductCode $_" } else { "-FilePath $_" } }
727727
'Arguments' = { "-ArgumentList $_" }
728728
'Parameters' = { "-ArgumentList $_" }
729729
'AddParameters' = { "-AdditionalArgumentList $_" }
730730
'SecureParameters' = '-SecureArgumentList' # Should inspect switch values here in case of -Switch:$false
731+
'Transform' = { "-Transforms $(if ($_ -match "^'") { $_ -replace ';', "','" } elseif ($_ -match '^"') { $_ -replace ';', '","' } else { $_ })" }
731732
'LogName' = { "-LogFileName $_" }
732733
'IgnoreExitCodes' = { "-IgnoreExitCodes $($_.Trim('"').Trim("'") -split ',' -join ',')" }
733734
'ExitOnProcessFailure' = {

0 commit comments

Comments
 (0)