简体   繁体   English

Windows 10 IoT核心PowerShell磁盘管理命令

[英]Windows 10 IoT Core PowerShell Disk Management Commands

When using PowerShell to connect to a device running Windows 10 IoT Core, I have unable to access disk management commands where I other could on a normal PC. 使用PowerShell连接到运行Windows 10 IoT Core的设备时,我无法在普通PC上访问磁盘管理命令。 Are these commands not available at all or I'll have to do something to get them working? 这些命令根本不可用,或者我必须做些什么才能使它们正常工作?

Example commands: 示例命令:

  • get-disk 获得盘

  • initialize-disk 初始化磁盘

  • get-partition 获得分区

Windows 10 IoT uses the .Net Micro Framework , which does not have all of the available libraries of the full .Net framwork. Windows 10 IoT使用.Net Micro Framework ,它没有完整.Net框架的所有可用库。

PowerShell is based on .Net, so the the available modules and cmdlets depend on the underlying capabilities of the framework. PowerShell基于.Net,因此可用的模块和cmdlet取决于框架的基础功能。

There will be a fair amount of functionality missing on IoT. 物联网上缺少相当多的功能。

Unfortunately, to my knowledge there is no documented list of what is or isn't available between PowerShell on IoT and full .Net. 不幸的是,据我所知,没有关于物联网上PowerShell与完整.Net之间可用或不可用的文档列表。

Make use of Get-Command and Get-Module to see on the system itself what's there. 利用Get-CommandGet-Module来查看系统本身的内容。 If you don't see the command, it's probably just not available. 如果你没有看到命令,它可能就是不可用。

From the Win 10 IoT PowerShell Page 来自Win 10 IoT PowerShell页面

(thanks TheMadTechnician ) (感谢TheMadTechnician

Issue: A known bug in PowerShell security policies causes the following issues to manifest within the remote session: 问题: PowerShell安全策略中的已知错误导致在远程会话中显示以下问题:

  • Get-Help returns unexpected matches. Get-Help返回意外匹配。

  • Get-Command on a specified module returns empty command list. 指定模块上的Get-Command返回空命令列表。

  • Running a cmdlet from any of these modules throws CommandNotFoundException: Appx , NetAdapter , NetSecurity , NetTCPIP , PnpDevice . 从运行这些模块的cmdlet的抛出CommandNotFoundException: AppxNetAdapterNetSecurityNetTCPIPPnpDevice

  • Import-Module on any of the above modules throws PSSecurityException exception with UnauthorizedAccess . 任何上述模块上的Import-ModuleUnauthorizedAccess抛出PSSecurityException异常。 Module auto loading does not seem to work either. 模块自动加载似乎也不起作用。

Workaround: Modify the execution policy within the remote PowerShell session to "RemoteSigned". 解决方法:将远程PowerShell会话中的执行策略修改为“RemoteSigned”。 For more details on the different execution policies, please refer to https://technet.microsoft.com/en-us/library/ee176961.aspx . 有关不同执行策略的更多详细信息,请参阅https://technet.microsoft.com/en-us/library/ee176961.aspx

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM