Command in ISE differs from Command in PowerShell

Really Strange, Run the following command from a Standard PowerShell Prompt

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;

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

Do I need to load any modules into ISE ?

1 answer

  • answered 2019-03-14 16:05 Matt Leyland

    Turns out there are two commands available within ISE. Get-ComputerInfo and Get-ComputerInfo

    enter image description here

    When you insert into ISE one inserts

    Get-ComputerInfo

    which was the one I was hitting and the other is

    Microsoft.PowerShell.Management\Get-ComputerInfo

    which is the one I wanted. My script now work in ISE and Console