- Website/Application Pool 실행
$sitename="IIS명"
Import-Module WebAdministration
if ((Get-WebAppPoolState -Name $sitename).Value -ne 'started'){
Write-Output ('start Application Pool: {0}' -f $sitename)
start-WebAppPool -Name " $sitename"
}
Import-Module WebAdministration
if ((Get-WebsiteState -Name $sitename).Value -ne 'started'){
Write-Output ('start Website: {0}' -f $sitename)
start-Website -Name " $sitename"
}
Website/Application Pool 중지
$sitename="IIS명"
Import-Module WebAdministration
if ((Get-WebsiteState -Name $sitename).Value -ne 'Stopped'){
Write-Output ('Stopping Website: {0}' -f $sitename)
Stop-Website -Name " $sitename"
}
if ((Get-WebAppPoolState -Name $sitename).Value -ne 'Stopped'){
Write-Output ('Stopping Application Pool: {0}' -f $sitename)
Stop-WebAppPool -Name " $sitename"
}