forked from jrussellfreelance/powershell-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iis-tools.ps1
24 lines (22 loc) · 823 Bytes
/
iis-tools.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This script is a quickIIS tool providing restart website and app pool functionality. I plan to add to it as time goes on.
# It uses the SimpleMenu module which can be installed from the Powershell Gallery.
$items = @()
$restart = New-SMMenuItem -Title "Restart App Pool" -Action {
Do {
$apppool = Read-Host "Please enter the name of the app pool"
}
While ($apppool -eq "")
Restart-WebAppPool -Name $apppool -Verbose
}
$items += $restart
$restartWeb = New-SMMenuItem -Title "Restart Website" -Action {
Do {
$website = Read-Host "Please enter the name of the website"
}
While ($website -eq "")
Stop-Website -Name $website -Verbose
Start-Website -Name $website -Verbose
}
$items += $restartWeb
$menu = New-SMMenu -Title "IIS Tools" -Items $items
Invoke-SMMenu -Menu $menu