Bun*_*nyk 5 powershell cmd winrm
我在PowerShell中运行以下命令:
PS C:\Users\adminaccount> winrm s winrm/config/service @{AllowUnencrypted="true";
MaxConcurrentOperationsPerUser="4294967295"}
Error: Invalid use of command line. Type "winrm -?" for help.
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,这给了我一个错误.但cmd.exe中的相同命令工作正常:
C:\Users\adminaccount>winrm s winrm/config/service @{AllowUnencrypted="true";
MaxConcurrentOperationsPerUser="4294967295"}
Service
...
Run Code Online (Sandbox Code Playgroud)
那么,我应该了解PowerShell语法以使其在那里工作?
@{}
在PowerShell中定义哈希表,但winrm
需要一个字符串参数.如果要直接在PowerShell中运行该命令,请将该参数放在引号中:
winrm s winrm/config/service '@{AllowUnencrypted="true"; MaxConcurrentOperationsPerUser="4294967295"}'
Run Code Online (Sandbox Code Playgroud)
此外,您需要管理员权限才能工作.
归档时间: |
|
查看次数: |
2126 次 |
最近记录: |