簡體   English   中英

ISE中的命令與PowerShell中的命令不同

[英]Command in ISE differs from Command in 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
  • Windows Server 2016標准版
  • PowerShell版本5.1.14393.206

我是否需要將任何模塊加載到ISE?

事實證明,ISE中有兩個可用命令。 Get-ComputerInfo和Get-ComputerInfo

在此輸入圖像描述

當您插入ISE時,一個插入

GET-ComputerInfo

那是我打的那個,另一個是

Microsoft.PowerShell.Management \\ GET-ComputerInfo

這是我想要的。 我的腳本現在可以在ISE和控制台中使用

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM