首页 > 解决方案 > ISE 中的命令与 PowerShell 中的命令不同

问题描述

真的很奇怪,从标准 PowerShell 提示符运行以下命令

Get-ComputerInfo

返回大量属性

WindowsBuildLabEx                                       : 14393.447.amd64fre.rs1_release_inmarket.161102-0100
WindowsCurrentVersion                                   : 6.3
WindowsEditionId                                        : ServerStandard
WindowsInstallationType                                 : Server
WindowsInstallDateFromRegistry                          : 05/02/2019 14:13:23
WindowsProductId                                        : 00377-70126-52438-AA588
WindowsProductName                                      : Windows Server 2016 Standard
WindowsRegisteredOrganization                           :
WindowsRegisteredOwner                                  : Windows User
WindowsSystemRoot                                       : C:\Windows
BiosCharacteristics                                     : {3, 9, 15, 16...}
BiosBIOSVersion                                         : {VRTUAL - 1, Hyper-V UEFI Release v1.0, EDK II - 10000}

And so on.....

但在 ISE 中运行相同的命令并返回一组不同的变量;

ComputerName       : DEV
OSName             : Microsoft Windows Server 2016 Standard
OSVersion          : 10.0.14393
MemoryGB           : 4
NumberOfProcessors : 1
NumberOfSockets    : 1
NumberOfCores      : 8

我需要将任何模块加载到 ISE 中吗?

标签: powershell

解决方案


事实证明,ISE 中有两个可用的命令。获取计算机信息和获取计算机信息

在此处输入图像描述

当您插入 ISE 时,插入

获取计算机信息

这是我打的一个,另一个是

Microsoft.PowerShell.Management\Get-ComputerInfo

这是我想要的。我的脚本现在可以在 ISE 和控制台中使用


推荐阅读