gpt4 book ai didi

powershell - Get-WindowsOptionalFeature 无法工作

转载 作者:行者123 更新时间:2023-12-01 11:22:03 40 4
gpt4 key购买 nike

我正在使用 IIS 和 Windows PowerShell,并基于此 this Microsoft TechNet link我应该能够使用 PowerShell 命令查看我的操作系统的所有可选功能:

PS C:\> Get-WindowsOptionalFeature –Online

当我尝试使用此命令时,我收到此错误消息:
get-windowsoptionalfeature : An attempt was made to load a program with an incorrect format.
At line:1 char:1
+ get-windowsoptionalfeature -Online
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-WindowsOptionalFeature], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand

我一直在阅读,大多数问题似乎都是基于 64 位和 32 位操作系统之间的问题,我尝试在我的标准 PowerShell 和 PowerShell (x86) 中运行它,两者都出现相同的错误。关于为什么会发生这种情况的任何想法?

最佳答案

  • Get-WindowsOptionalFeature cmdlet 需要 PowerShell 3.0。
  • 此 cmdlet 必须以提升的权限运行。按住 CTRL 键的同时右键单击 Windows PowerShell 3.0 控制台,然后从操作菜单中选择以管理员身份运行(根据:https://blogs.technet.microsoft.com/heyscriptingguy/2012/08/24/use-powershell-3-0-to-find-enabled-windows-8-features/)。
  • RSAT必须安装才能使用。我认为这与 32 位和 64 位完全没有关系。
  • 关于powershell - Get-WindowsOptionalFeature 无法工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41078822/

    40 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com