简体   繁体   English

为什么“设置项”在Windows 7 PowerShell上不起作用?

[英]Why doesn't “Set-Item” work on Windows 7 PowerShell?

I am trying to install Windows 10 IoT on my Raspberry Pi 2. The PowerShell documentation tells me to put in this: 我正在尝试在Raspberry Pi 2上安装Windows 10IoT。PowerShell文档告诉我输入以下内容:

Set-Item WSMan:\\localhost\\Client\\TrustedHosts -Value <minwinpc>

However, when I put it into my Windows 7 PowerShell, this comes out: 然而,当我把它放到我的Windows 7的PowerShell, 出来:

At line:1 char:54
+ Set-Item WSMan:\localhost\Client\TrustedHosts -Value <minwinpc>
+                                                      ~
The '<' operator is reserved for future use.
+ CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RedirectionNotSupported

How do I fix this? 我该如何解决?

您需要在设备名称(minwinpc)周围使用引号而不是<>。

Set-Item WSMan:\localhost\Client\TrustedHosts -Value 'minwinpc'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用带有Get-Item的PowerShell注册表项:Set-Item和ExportTo-CliXml - How to migrate registry entries with PowerShell with Get-Item : Set-Item and ExportTo-CliXml Powershell移动项到网络文件夹在Windows 2012 Task Scheduler中不起作用 - powershell move-item to a network folder doesn't work in windows 2012 task scheduler Windows 任务计划程序中的 PowerShell 脚本无法正常工作 - PowerShell script doesn't work correctly from Windows Task Scheduler echo命令不适用于Windows 10中的PowerShell - echo command doesn't work with PowerShell in Windows 10 Powershell - 以管理员身份运行快捷方式不起作用 (Windows) - Powershell - Run Shortcut as Admin doesn't work (Windows) 使用 powershell 将路径永久添加到 windows 似乎不起作用 - Adding path permanently to windows using powershell doesn't appear to work 为什么此代码适用于Windows 7,但不适用于Windows XP? - Why does this code work on Windows 7, but doesn't on Windows XP? 用于删除以“。”开头的文件夹的Powershell脚本。 不起作用-为什么? - Powershell script for deleting folders starting with a '.' doesn't work - why? 为什么 java 中的 isActive() function 在 windows 中起作用,而在 ubuntu 中不起作用 - Why isActive() function in java work in windows and doesn't work in ubuntu 为什么 g++ 静态链接在 Windows 中不适用于 sfml? - Why g++ static linking doesn't work with sfml in windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM