Windows 10 个 IoT Core PowerShell 磁盘管理命令
Windows 10 IoT Core PowerShell Disk Management Commands
当使用 PowerShell 连接到设备 运行 Windows 10 IoT Core 时,我无法访问其他人可以在普通 PC 上访问的磁盘管理命令。这些命令是根本不可用还是我必须做些什么才能让它们工作?
示例命令:
获取磁盘
初始化磁盘
获取分区
Windows 10 IoT 使用 .Net Micro Framework,它没有完整 .Net 框架的所有可用库。
PowerShell 基于 .Net,因此可用的模块和 cmdlet 取决于框架的底层功能。
物联网将缺少大量功能。
不幸的是,据我所知,没有关于物联网上的 PowerShell 和完整的 .Net 之间可用或不可用的文档列表。
利用 Get-Command
和 Get-Module
查看系统本身的内容。如果您没有看到该命令,它可能只是不可用。
来自Win 10 IoT PowerShell Page
(感谢TheMadTechnician)
Issue: A known bug in PowerShell security policies causes the following issues to manifest within the remote session:
Get-Help
returns unexpected matches.
Get-Command
on a specified module returns empty command list.
Running a cmdlet from any of these modules throws CommandNotFoundException: Appx
, NetAdapter
, NetSecurity
, NetTCPIP
, PnpDevice
.
Import-Module
on any of the above modules throws PSSecurityException
exception with UnauthorizedAccess
. Module auto loading does not seem to work either.
Workaround: Modify the execution policy within the remote PowerShell session to "RemoteSigned". For more details on the different execution policies, please refer to https://technet.microsoft.com/en-us/library/ee176961.aspx.
当使用 PowerShell 连接到设备 运行 Windows 10 IoT Core 时,我无法访问其他人可以在普通 PC 上访问的磁盘管理命令。这些命令是根本不可用还是我必须做些什么才能让它们工作?
示例命令:
获取磁盘
初始化磁盘
获取分区
Windows 10 IoT 使用 .Net Micro Framework,它没有完整 .Net 框架的所有可用库。
PowerShell 基于 .Net,因此可用的模块和 cmdlet 取决于框架的底层功能。
物联网将缺少大量功能。
不幸的是,据我所知,没有关于物联网上的 PowerShell 和完整的 .Net 之间可用或不可用的文档列表。
利用 Get-Command
和 Get-Module
查看系统本身的内容。如果您没有看到该命令,它可能只是不可用。
来自Win 10 IoT PowerShell Page
(感谢TheMadTechnician)
Issue: A known bug in PowerShell security policies causes the following issues to manifest within the remote session:
Get-Help
returns unexpected matches.
Get-Command
on a specified module returns empty command list.Running a cmdlet from any of these modules throws CommandNotFoundException:
Appx
,NetAdapter
,NetSecurity
,NetTCPIP
,PnpDevice
.
Import-Module
on any of the above modules throwsPSSecurityException
exception withUnauthorizedAccess
. Module auto loading does not seem to work either.Workaround: Modify the execution policy within the remote PowerShell session to "RemoteSigned". For more details on the different execution policies, please refer to https://technet.microsoft.com/en-us/library/ee176961.aspx.