Enable-PSRemoting (Set-WSManQuickConfig) 和 HyperV 适配器

Agi*_*ech 0 hyper-v powershell-remoting

安装 HyperV 并出现
vEthernet(默认交换机)后,Hyper-V 虚拟以太网适配器
命令
Enable-PSRemoting(或 Set-WSManQuickConfig)
会引发异常:

 et-WSManQuickConfig : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859113" Machine="localhost"><f:Message><f:ProviderFault provider="Config provider" path="%systemroot%\system32
\WsmSvc.dll"><f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859113" Machine="*******"><f:Message>WinRM firewall exception will not work since one of the network connection types
 on this machine is set to Public. Change the network connection type to either Domain or Private and try again. </f:Message></f:WSManFault></f:ProviderFault></f:Message></f:WSManFault>
At line:1 char:1
+ Set-WSManQuickConfig
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Set-WSManQuickConfig], InvalidOperationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.SetWSManQuickConfigCommand
Run Code Online (Sandbox Code Playgroud)

禁用虚拟交换机可以使命令正常工作。
为什么会出现这种情况?可以解决吗?
操作系统:Windows 10;PS版本 - 5.1.18362.145

小智 6

如果在系统上发现“公共”网络连接类型,Microsoft 认为 powershell 远程处理是有害的。它们由 Hyper-V 创建为默认虚拟网络交换机。您可以使用命令行参数跳过此检查。

Enable-PSRemoting -SkipNetworkProfileCheck
Run Code Online (Sandbox Code Playgroud)