Skip to content

Instantly share code, notes, and snippets.

@mercdev
Created July 6, 2015 12:45
Show Gist options
  • Save mercdev/3ae06656fad7cace2753 to your computer and use it in GitHub Desktop.
Save mercdev/3ae06656fad7cace2753 to your computer and use it in GitHub Desktop.
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