Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
$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
# Deploy内容が存在した際に 実行されにゃいお (更新があった場合にのみ走らないので却下です)
$processinfo = New-Object System.Diagnostics.ProcessStartInfo
$processinfo.FileName = $msdeploy
$processinfo.RedirectStandardError = $true
$processinfo.RedirectStandardOutput = $true
$processinfo.UseShellExecute = $false
$processinfo.Arguments = $arguments
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $processinfo
$process.Start() > $null
$output = @()
$output = $process.StandardError.ReadToEnd()
$output += $process.StandardOutput.ReadToEnd()
$output | Out-LogHost -logfile $log -hidedata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment