I had to spend quite a bit of time figuring this out. So hopefully this will help someone out there. To launch MSDEPLOY from PowerShell, make sure you escape any quote or comma characters.
The “2>&1” at the end allows Powershell to detect errors and bail out if you have $ErrorActionPreference = “Stop”
If you still have problems, download and use EchoArgs.exe to see exactly what PowerShell sees.
function Get-MSWebDeployInstallPath(){
$path = (get-childitem "HKLM:\SOFTWARE\Microsoft\IIS Extensions\MSDeploy" | Select -last 1).GetValue("InstallPath")
$path = "${path}msdeploy.exe"
if (!(Test-Path "$path")) {
throw "MSDEPLOY.EXE is not installed. See http://go.microsoft.com/?linkid=9278654"
}
return $path
}
$msdeploy = Get-MSWebDeployInstallPath
& $msDeploy -verb:sync -source:recycleApp `
-dest:recycleApp=`"${webSiteName}`"`,recycleMode=StopAppPool`,wmsvc=${server}`,userName="${userName}"`,password="${password}" `
-allowuntrusted -debug 2>&1
To list available contexts: kubectl config get-contexts To show the current context: kubectl config current-context…
kubectl exec -it <podname> -- sh To get a list of running pods in the…
# Create a soft symbolic link from /mnt/original (file or folder) to ~/link ln -s…
git config --global user.name "<your name>" git config --global user.email "<youremail@somewhere.com>" Related Commands Show current…
TypeScript/JavaScript function getLastMonday(d: Date) { let d1 = new Date(d.getFullYear(), d.getMonth() + 1, 0); let…
I had to do some SMTP relay troubleshooting and it wasn't obvious how to view…