Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
themeDJango
linenumberstrue
 $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"
}

...

Code Block
languagepowershell
themeDJango
linenumberstrue
 $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"
}