Using msiexec on unattend.xml as SynchronousCommand but it run as asynchronous

77 Views Asked by At

I try to automatise my Windows configuration with unattend.xml file and during FirstLogonCommands, I only have SynchronousCommand block,

On theses blocks, i ran differents PowerShell scripts and inside one of them, i try to install .msi file but when msiexec is launch, the other blocks SynchronousCommand start simultaneously as asynchronous command.

But the normal process would be that these step should wait .msi is fully installed before continue their execution.

I already try :

  • cmd /c /start /wait msiexec myfile.msi
  • start-process with parameter -wait or -noexit
  • Start-Job -ScriptBlock with a while while ( ( get-job | where { $_.State -eq 'Running' -and $_.Command -like ('*'+$ScriptName+'*') } ).count -gt 0 )...
  • include msiexec command inside .bat file and run this .bat file with cmd /c InstallMsi.bat

None of these manipulations seems to works.

I think the problem is with msiexec execution....

Is anyone having already these issue?

0

There are 0 best solutions below