I am trying to script something to sync up IIS servers using MSdeploy.
I tried all the possible ways to run the .exe but sometimes I get this error:
The term 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' is
not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
When I execute the same script again after running it the first time it works fine. This is how I ended up calling it:
& 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' -verb:sync ...
Any ideas how to prevent it from failing the first time?