[英]Command in ISE differs from Command in PowerShell
Really Strange, Run the following command from a Standard PowerShell Prompt 真的很奇怪,从标准PowerShell提示符运行以下命令
Get-ComputerInfo
Returns a large list of properties 返回大量属性
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.....
yet run the same command within ISE and it returns a different set of variables; 但是在ISE中运行相同的命令,它将返回不同的变量集;
ComputerName : DEV
OSName : Microsoft Windows Server 2016 Standard
OSVersion : 10.0.14393
MemoryGB : 4
NumberOfProcessors : 1
NumberOfSockets : 1
NumberOfCores : 8
Do I need to load any modules into ISE ? 我是否需要将任何模块加载到ISE?
Turns out there are two commands available within ISE. 事实证明,ISE中有两个可用命令。 Get-ComputerInfo and Get-ComputerInfo
Get-ComputerInfo和Get-ComputerInfo
When you insert into ISE one inserts 当您插入ISE时,一个插入
Get-ComputerInfo
GET-ComputerInfo
which was the one I was hitting and the other is 那是我打的那个,另一个是
Microsoft.PowerShell.Management\\Get-ComputerInfo
Microsoft.PowerShell.Management \\ GET-ComputerInfo
which is the one I wanted. 这是我想要的。 My script now work in ISE and Console
我的脚本现在可以在ISE和控制台中使用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.