Created
July 6, 2015 12:45
-
-
Save mercdev/3ae06656fad7cace2753 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
param([parameter(Mandatory=$true,HelpMessage="Server Environment")]$state,$env) | |
Import-Module WebAdministration; | |
switch ($env) | |
{ | |
"### SERVERNAME ###" | |
{ | |
if ($state -eq "STOP") | |
{ | |
Invoke-Command $env { Stop-WebSite WaysideStatusServer.Web }; | |
Invoke-Command $env { Stop-WebAppPool PTC-App_Pool -ErrorAction SilentlyContinue -WarningAction SilentlyContinue }; | |
# server specific commands here | |
break; | |
} | |
else | |
{ | |
Invoke-Command $env { Start-WebSite WaysideStatusServer.Web }; | |
Invoke-Command $env { Start-WebAppPool PTC-App_Pool }; | |
# server specific commands here | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment