Skip to content

Instantly share code, notes, and snippets.

Created August 27, 2017 11:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save guitarrapc/4984020563a22182709c4514810fffce to your computer and use it in GitHub Desktop.
$msdeploy = "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
$user = "配置管理者ユーザー"
$Password = "配置管理者パスワード"
foreach ($deploygroup in $deploygroups)
# define arguments of msdeploy
[string[]]$arguments = @(
"-setParam:`"IIS Web Application Name`"=`"W3C1hogehoge`"")
# Start Process
"running msdeploy to $deploygroup" | Out-LogHost -logfile $log -showdata
# foreach が sequencial で一向に終わらにゃいお
Start-Process -FilePath $msdeploy -ArgumentList $arguments -Wait -RedirectStandardOutput $tmplog -RedirectStandardError $tmperrorlog -NoNewWindow
Get-Content -Path $tmplog -Encoding Default | Out-File -FilePath $log -Encoding utf8 -Append
Get-Content -Path $tmperrorlog -Encoding Default | Out-File -FilePath $log -Encoding utf8 -Append
if ($tmplog) {Remove-Item -Path $tmplog -Force}
if ($tmperrorlog) {Remove-Item -Path $tmperrorlog -Force}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment