Applying msu file and import reg file

Hi,
Using the new version 4.1
I am trying to apply a msu file but can't seem to get the syntax for it
i tried these ;
Start-ADTProcess -FilePath "C:\Windows\System32\wusa.exe" -ArgumentList "$($adtSession.DirFiles)\windows11.0-kb5065431-x64_cfbf8bbd4938a7fb8a7aea5b3fc90e74e6bea6e4.msu /quiet /norestart"
Start-ADTProcess -FilePath 'c:\windows\system32\reg.exe' -ArgumentList 'import $($adtSession.DirFiles)\reg.reg'
Start-ADTProcess -FilePath "reg.exe" -Parameters "import "$dirSupportFiles\reg.reg"" -PassThru

But does not work, Help please

So, by the looks of your code you have some confusion around which quotes to use

The first command looks fine as the -ArgumentList is all wrapped in a single pair of double quotes
In the 2nd command, you are using single quotes which are fine if they do not contain variables which you want to expand, but you do on the -ArgumentList ... so I'd suggest changing to the following:

Start-ADTProcess -FilePath "c:\windows\system32\reg.exe" -ArgumentList "import $($adtSession.DirFiles)\reg.reg"

[EDIT] The third command is incorrect, you have correctly escaped the extra pair of double quotes, but you are using -Parameters which is not a valid switch on Start-ADTProcess (See reference here: Start-ADTProcess · PSAppDeployToolkit).
I believe your second command should look like this:

Start-ADTProcess -FilePath "reg.exe" -ArgumentList "import `"$dirSupportFiles\reg.reg`"" -PassThru

So try changing the 2nd and 3rd commands and let us know how you get on

1 Like

Hi, Thanks for your help. it worked.
Start-ADTProcess -FilePath "c:\windows\system32\reg.exe" -ArgumentList "import $($adtSession.DirFiles)\reg.reg"
and Start-ADTProcess -FilePath "C:\Windows\System32\wusa.exe" -ArgumentList "$($adtSession.DirFiles)\windows11.0-kb5065431-x64_cfbf8bbd4938a7fb8a7aea5b3fc90e74e6bea6e4.msu /quiet /norestart"

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.