function delete-vDir(){ param( [parameter(Mandatory = $true)][string] $vDirName, [parameter(Mandatory = $true)][string] $iisServer ) gwmi -namespace "root\MicrosoftIISv2" -class "IISWebVirtualDir" -filter "Name = 'W3SVC/1/ROOT/$vDirName'" -ComputerName $iisServer -Authentication PacketPrivacy | %{Write-Host "Deleting vDir $vDirName on $iisServer";$_.Delete()} }
No comments:
Post a Comment