Remove WSManInstance - PowerShell
Overview
Remove-WSManInstance removes a registered Windows Remote Management (WinRM) instance from the local computer. WinRM instances enable remote management of computers using PowerShell commands.
Syntax
Remove-WSManInstance [-Name] <string> [-Force] [-Confirm] [-WhatIf] [-PassThru]
Options/Flags
- -Name (Optional): Name of the WinRM instance to be removed. If not specified, a list of available instances is displayed and the user is prompted to select one.
- -Force (Optional): Suppresses warning messages and removes the instance without confirmation.
- -Confirm (Optional): Prompts the user to confirm the removal.
- -WhatIf (Optional): Shows what would happen if the command were run without actually removing the instance.
- -PassThru (Optional): Returns the instance object that was removed.
Examples
Example 1: Remove a specific WSMan instance
Remove-WSManInstance -Name wsman-01
Example 2: Remove all WSMan instances on the local computer
Get-WSManInstance -List | Remove-WSManInstance -Force
Common Issues
None.
Integration
Combine with Get-WSManInstance
To remove a specific instance, first use Get-WSManInstance -List
to get a list of the available instances and then use the -Name
parameter to specify the one to remove.
Related Commands
- Get-WSManInstance
- New-WSManInstance
- Set-WSManInstance