PowerShell 2.0: One Cmdlet at a Time 51 Remove-WSManInstance
Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Remove-WSManInstance cmdlet.
What can I do with it?
Remove a management resource that has been previously created for use with WS-Management.
Example:
Check for existing HTTPS Listeners. Remove the existing HTTPS listener created with New-WSManInstance . Check again to confirm its removal.
Get-WSManInstance winrm/config/listener -selectorset @{Address="*";Transport=“https”} Remove-WSManInstance winrm/config/listener -SelectorSet @{address="*";transport=“https”} Get-WSManInstance winrm/config/listener -selectorset @{Address="*";Transport=“https”}
You will notice that you recieve a nasty red error when trying to retrieve it after it has been removed.
How could I have done this in PowerShell 1.0?
Support for the use of WS-Management in PowerShell is provided as part of the 2.0 release.