简体   繁体   English

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

[英]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
  • Windows Server 2016 Standard Windows Server 2016标准版
  • PowerShell version 5.1.14393.206 PowerShell版本5.1.14393.206

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.

相关问题 从命令行运行PowerShell ISE? - Run PowerShell ISE from the command line? 从命令行参数到Powershell_ISE - Parameters into Powershell_ISE from Command Line Powershell:脚本不是从命令行运行,而是从ISE运行? - Powershell: Script not running from command line but runs from ISE? 从PowerShell ISE的命令环境中加载脚本 - Load script from PowerShell ISE's command environment PowerShell 命令中的脚本错误,但在 ISE 中有效 - PowerShell Script Error in command but works in ISE PowerShell ISE 中的命令历史记录存储在哪里? - Wheres the command history in PowerShell ISE stored at? Powershell:如果命令输出与预期的3个字符串数组不同,则发送电子邮件 - Powershell: Sending an email if output of command differs from the array of 3 strings that is expected kubectl exec 命令不能从 powershell ISE 工作(从 powershell 工作) - 是否有理由或解决方法使其工作? - kubectl exec command not working from powershell ISE (works from powershell) - Is there a reason or workaround to make it work? powershell 脚本在 ISE 中工作正常,但在 powershell 命令提示符下失败? - powershell script working fine in ISE but fails at powershell command prompt? Add-PSSnapin'Microsoft.SharePoint.PowerShell'在ISE中运行,但不是从.Net Process.Start命令运行 - Add-PSSnapin 'Microsoft.SharePoint.PowerShell' runs in ISE but not from .Net Process.Start command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM