2022-07-22發表PowerShell幾秒讀完 (大約87個字)(PowerShell)檢查/設定TrustedHosts取得目前TrustedHosts名單1Get-Item WSMan:\localhost\Client\TrustedHosts設定TrustedHosts12345678# 設定特定的IPwinrm set winrm/config/client '@{TrustedHosts="xxx.xxx.xxx.xxx,yyy.yyy.yyy.yyy"}'# 設定allow all *Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force#加入TrustedHosts (Concatenate是append,若沒加Concatenate,會一直覆蓋)Set-Item WSMan:\localhost\Client\TrustedHosts -Value "zzz.zzz.zzz" -Concatenate重啟WinRM Service1Restart-Service WinRM#WindowsPowerShell