Summary: Use Windows PowerShell to clear the trusted hosts file.
How can I use Windows PowerShell to clear all values from my trusted hosts file?
The trusted hosts file is part of the WSMAN configuration, and the easiest way to clear it is to use Clear-Item:
£> Get-Item -Path WSMan:\localhost\Client\TrustedHosts | fl Name, Value
Name : TrustedHosts
Value : server02,10.10.54.201
£> Clear-Item -Path WSMan:\localhost\Client\TrustedHosts -Force
£> Get-Item -Path WSMan:\localhost\Client\TrustedHosts | fl Name, Value
Name : TrustedHosts
Value :
Note If you don’t use the –Force parameter on Clear-Item, you must respond to a message asking you to confirm the action.