我是 PowerShell 的新手。我希望在运行 Windows 7 的远程 PC 上运行 PowerShell 命令。
在远程 PC 上,我运行了以下 PowerShell 命令:
Enable-PSRemoting -Force
Set-Item WSMAN:\localhost\client\trustedhosts <host_ip>
Restart-Service WinRM
我在主机 PC 上执行了最后两个命令(但使用<remote_ip>
)。
我确认这适用于:
Invoke-Command -ComputerName <name> -Credential <username> -ScriptBlock { Get-ChildItem C:\ }
我的问题:这在公共网络上是否安全?我应该做点别的吗?还是我应该使用 SSL?如果是这样,我该怎么做?