Last active
August 29, 2015 14:20
-
-
Save SergeyAxenov/51200650b7e6e8b0b2a8 to your computer and use it in GitHub Desktop.
MSDeploy RunCommand in PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# #powershell #ps #msdeploy #runCommand | |
function MsDeploy-RunCmd( | |
[string]$msdeployExe, | |
[string]$svr, | |
[string]$site, | |
[string]$command) { | |
$source="runcommand='$command'" | |
$dest="auto,computername=`"https://$($svr):8172/msdeploy.axd?site=$site`",authtype=`"NTLM`"" | |
$cmd = $(" `"$msdeployExe`" -verb=sync -source={0} -dest={1} -allowuntrusted" -f $source, $dest) | |
cmd.exe /C $cmd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment