我正在 PowerShell 中运行以下命令:
PS C:\Users\adminaccount> winrm s winrm/config/service @{AllowUnencrypted="true";
MaxConcurrentOperationsPerUser="4294967295"}
Error: Invalid use of command line. Type "winrm -?" for help.
正如你所看到的,这给了我一个错误。但 cmd.exe 中的相同命令可以正常工作:
C:\Users\adminaccount>winrm s winrm/config/service @{AllowUnencrypted="true";
MaxConcurrentOperationsPerUser="4294967295"}
Service
...
那么,我应该了解有关 PowerShell 语法的哪些知识才能使其正常工作呢?
@{}
在PowerShell中定义了一个哈希表,但是winrm
需要一个字符串参数。如果您想直接在 PowerShell 中运行命令,请将该参数放在引号中:
winrm s winrm/config/service '@{AllowUnencrypted="true"; MaxConcurrentOperationsPerUser="4294967295"}'
此外,您需要管理员权限才能正常工作。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)