29 lines
799 B
PowerShell
29 lines
799 B
PowerShell
Function Set-AppCommandPropertyOnAppPool {
|
|
<#
|
|
.SYNOPSIS
|
|
Set the property on an app pool using the appcmd.exe tool
|
|
|
|
.PARAMETER Property
|
|
[string] The property to set
|
|
|
|
.PARAMETER AppPoolName
|
|
[string] The name of the web application pool
|
|
#>
|
|
[CmdletBinding()]
|
|
Param(
|
|
[Parameter(Mandatory=$true, Position=0)]
|
|
[Alias("Name")]
|
|
[string]$Property,
|
|
|
|
[Parameter(Mandatory=$true, Position=1)]
|
|
[string]$AppPoolName
|
|
)
|
|
$logLead = (Get-LogLeadName)
|
|
|
|
## TODO: cbrand ~ Replace with a call to a function to find this in the right place
|
|
$appCmdPath = (Join-Path $env:systemroot "\system32\inetsrv\appcmd.exe")
|
|
|
|
Write-Verbose "$logLead : Running AppCmd for [$appCmdPath set apppool $AppPoolName $property]"
|
|
|
|
(& $appCmdPath set apppool $AppPoolName $Property) | Out-Null
|
|
} |