ps/Modules/Alkami.PowerShell.IIS/Public/Start-IISAppPoolByName.ps1

25 lines
639 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
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"
}
}