25 lines
639 B
PowerShell
25 lines
639 B
PowerShell
|
function Start-IISAppPoolByName {
|
|||
|
<#
|
|||
|
.SYNOPSIS
|
|||
|
Starts a given IIS App Pool by name
|
|||
|
#>
|
|||
|
[CmdletBinding()]
|
|||
|
Param(
|
|||
|
[Parameter(Mandatory=$false)]
|
|||
|
[Alias("AppPoolName")]
|
|||
|
[string]$Name = ""
|
|||
|
)
|
|||
|
process {
|
|||
|
$logLead = (Get-LogLeadName)
|
|||
|
|
|||
|
Write-Verbose "$logLead : Attempting to Start app pool by name"
|
|||
|
|
|||
|
# Test-IISAppPoolByName returns false if the process is not running. We want to start it if it is not running. Negate the response.
|
|||
|
if (!(Test-IISAppPoolByName $name)) {
|
|||
|
Start-WebAppPool -Name $name
|
|||
|
}
|
|||
|
|
|||
|
Write-Verbose "$logLead : Done"
|
|||
|
}
|
|||
|
}
|