Hello I have an issue using the $dirfiles variable in a parameter.
Execute-Process -Path 'C:\Windows\System32\dism.exe' -Parameters '/Online /Add-Package /PackagePath:$dirfiles\Windows6.1-KB2786081-x64.cab /quiet /norestart /LogPath:C:\temp\PSAPP\Patches\KB2786081_Install.log' -PassThru
The issue is $dirfiles resolves to C:\Program Files\blah\blah
When the parameters are passed to dism quotes are not included in the path. Is there a way to have $dirfiles always include quotes in its path?