PowerShell Module SysInfo v1.1.2

In this post we will see about the changes/additions of PowerShell Module SysInfo v1.1.2. For those who have not seen the information about SysInfo module, you can find it here.

Let’s see the updates of this module.

Updates:

FreeSpacePercentage property added

UsedSpacePercentage property added

Added protocol choice (WinRM, DCOM)

Added -Properties parameter

Code Improvements

[adinserter name=”In Article”]

FreeSpace and UsedeSpace Percentages

If the output of the command includes FreeSpace property, now it will also provide you the percentage of the free space and the used spaced.

Example 1

As you can see in the below example, C Drive has only 26% free space.

PS C:\Windows> Get-LocalDisk DeviceID : C: DriveType : Local Disk ProviderName : VolumeName : Size : 240054693888 FreeSpace : 62153457664 FreeSpacePercentage : 26 SystemName : LOCALPC

PS C:\Windows> Get-LocalDisk -Properties * Caption : C: Description : Local Fixed Disk InstallDate : Name : C: Status : Availability : ConfigManagerErrorCode : ConfigManagerUserConfig : DeviceID : C: ErrorCleared : ErrorDescription : LastErrorCode : PowerManagementCapabilities : PowerManagementSupported : StatusInfo : SystemName : LOCALPC Access : BlockSize : ErrorMethodology : NumberOfBlocks : Purpose : FreeSpace : 62152785920 Size : 240054693888 Compressed : False DriveType : Local Disk FileSystem : NTFS MaximumComponentLength : 255 MediaType : Fixed hard disk media ProviderName : QuotasDisabled : QuotasIncomplete : QuotasRebuilding : SupportsDiskQuotas : False SupportsFileBasedCompression : True VolumeDirty : VolumeName : VolumeSerialNumber : BA47DDCD FreeSpacePercentage : 26 UsedSpacePercentage : 74 SizeKB : 234428412 SizeMB : 228934 SizeGB : 223.57 FreeSpaceKB : 60696080 FreeSpaceMB : 59273.52 FreeSpaceGB : 57.88

[adinserter name=”In Article”]

Protocol Choice

On initial version you were able to use only WinRM protocol to retrieve the information from the remote systems. In this version you are also allowed to used DCOM protocol to get the information from the remote systems. by using the initial version you had to have PowerShell 3.0 and above in order to get the information from remote systems. Now with the use of DCOM protocol you are not forced to have PowerShell 3.0 and above. If you have an old system with PowerShell 2.0 you are still able to get the information that you need by using DCOM protocol.

In order to do so, you need to use -Protocol parameter and select WinRM or DCOM as value of the parameter. If you do not use the -Protocol parameter, the default behavior of the cmdlets is to use WinRM. In the example below you ca see the how you are able to use -Protocol parameter.

Example 2

In this example you can see that I can retrieve the same information either using WinRM or DCOM protocol.

Using WinRM (Default)

PS C:\Windows> Get-OperatingSystem -ComputerName Server1 -Properties * Caption : Microsoft Windows Server 2012 R2 Standard Description : InstallDate : 14/09/2016 22:33:15 Name : Microsoft Windows Server 2012 R2 Standard|C:\Windows|\Device\Harddisk0\Partition4 Status : OK CSName : Server1 CurrentTimeZone : 60 Distributed : False FreePhysicalMemory : 5096628 FreeSpaceInPagingFiles : 922460 FreeVirtualMemory : 5461588 LastBootUpTime : 19/10/2018 16:34:41 LocalDateTime : 13/11/2018 12:41:54 MaxNumberOfProcesses : 4294967295 MaxProcessMemorySize : 137438953344 NumberOfLicensedUsers : 0 NumberOfProcesses : 98 NumberOfUsers : 21 OSType : WINNT OtherTypeDescription : SizeStoredInPagingFiles : 1310720 TotalSwapSpaceSize : TotalVirtualMemorySize : 9696292 TotalVisibleMemorySize : 8385572 Version : 6.3.9600 BootDevice : \Device\HarddiskVolume2 BuildNumber : 9600 BuildType : Multiprocessor Free CodeSet : 1252 CountryCode : 44 CSDVersion : DataExecutionPrevention_32BitApplications : True DataExecutionPrevention_Available : True DataExecutionPrevention_Drivers : True DataExecutionPrevention_SupportPolicy : Opt Out Debug : False EncryptionLevel : 256 ForegroundApplicationBoost : Maximum LargeSystemCache : Locale : English - Great Britain Manufacturer : Microsoft Corporation MUILanguages : {en-US} OperatingSystemSKU : Windows Server Standard Edition (Desktop Experience installation) Organization : OSArchitecture : 64-bit OSLanguage : English (United States) OSProductSuite : Invalid Code PAEEnabled : PlusProductID : PlusVersionNumber : PortableOperatingSystem : False Primary : True ProductType : Server RegisteredUser : Windows User SerialNumber : 00252-70000-00000-AA555 ServicePackMajorVersion : 0 ServicePackMinorVersion : 0 SuiteMask : 272 SystemDevice : \Device\HarddiskVolume4 SystemDirectory : C:\Windows\system32 SystemDrive : C: WindowsDirectory : C:\Windows FreePhysicalMemoryMB : 4977.18 FreePhysicalMemoryGB : 4.86 FreeSpaceInPagingFilesMB : 900.84 FreeVirtualMemoryMB : 5333.58 FreeVirtualMemoryGB : 5.21 MaxProcessMemorySizeMB : 134217727.88 MaxProcessMemorySizeGB : 131072 MaxProcessMemorySizeTB : 128 SizeStoredInPagingFilesMB : 1280 SizeStoredInPagingFilesGB : 1.25 TotalVirtualMemorySizeMB : 9469.04 TotalVirtualMemorySizeGB : 9.25 TotalVisibleMemorySizeMB : 8189.04 TotalVisibleMemorySizeGB : 8

Using DCOM

PS C:\Windows> Get-OperatingSystem -ComputerName Server1 -Protocol DCOM -Properties * Caption : Microsoft Windows Server 2012 R2 Standard Description : InstallDate : 14/09/2016 22:33:15 Name : Microsoft Windows Server 2012 R2 Standard|C:\Windows|\Device\Harddisk0\Partition4 Status : OK CSName : Server1 CurrentTimeZone : 60 Distributed : False FreePhysicalMemory : 4721052 FreeSpaceInPagingFiles : 934328 FreeVirtualMemory : 5466028 LastBootUpTime : 19/10/2018 16:34:41 LocalDateTime : 13/11/2018 12:43:50 MaxNumberOfProcesses : 4294967295 MaxProcessMemorySize : 137438953344 NumberOfLicensedUsers : 0 NumberOfProcesses : 97 NumberOfUsers : 21 OSType : WINNT OtherTypeDescription : SizeStoredInPagingFiles : 1310720 TotalSwapSpaceSize : TotalVirtualMemorySize : 9696292 TotalVisibleMemorySize : 8385572 Version : 6.3.9600 BootDevice : \Device\HarddiskVolume2 BuildNumber : 9600 BuildType : Multiprocessor Free CodeSet : 1252 CountryCode : 44 CSDVersion : DataExecutionPrevention_32BitApplications : True DataExecutionPrevention_Available : True DataExecutionPrevention_Drivers : True DataExecutionPrevention_SupportPolicy : Opt Out Debug : False EncryptionLevel : 256 ForegroundApplicationBoost : Maximum LargeSystemCache : Locale : English - Great Britain Manufacturer : Microsoft Corporation MUILanguages : {en-US} OperatingSystemSKU : Windows Server Standard Edition (Desktop Experience installation) Organization : OSArchitecture : 64-bit OSLanguage : English (United States) OSProductSuite : Invalid Code PAEEnabled : PlusProductID : PlusVersionNumber : PortableOperatingSystem : False Primary : True ProductType : Server RegisteredUser : Windows User SerialNumber : 00252-70000-00000-AA535 ServicePackMajorVersion : 0 ServicePackMinorVersion : 0 SuiteMask : 272 SystemDevice : \Device\HarddiskVolume4 SystemDirectory : C:\Windows\system32 SystemDrive : C: WindowsDirectory : C:\Windows FreePhysicalMemoryMB : 4610.4 FreePhysicalMemoryGB : 4.5 FreeSpaceInPagingFilesMB : 912.43 FreeVirtualMemoryMB : 5337.92 FreeVirtualMemoryGB : 5.21 MaxProcessMemorySizeMB : 134217727.88 MaxProcessMemorySizeGB : 131072 MaxProcessMemorySizeTB : 128 SizeStoredInPagingFilesMB : 1280 SizeStoredInPagingFilesGB : 1.25 TotalVirtualMemorySizeMB : 9469.04 TotalVirtualMemorySizeGB : 9.25 TotalVisibleMemorySizeMB : 8189.04 TotalVisibleMemorySizeGB : 8

[adinserter name=”In Article”]

Properties

In this version -Properties parameter is also available. Instead of showing all the information which sometimes might be confusing, the cmdlets now will provide you only with the basic information and if you need more you can select which properties you want to see all if you want to get all of them then you are able to use * to see them all. In -Properties parameters wildcards are accepted also. With the addition of -Properties parameter, cmdlets of the module will provide you a clearer results with the main properties of the object and if there is a need to get more properties you can specify the accordingly. In the below examples we will see the differences.

Example 3

PS C:\Windows> Get-BIOS Name : BIOS Date: 01/12/15 09:18:22 Ver: 8.19 Manufacturer : AMI SerialNumber : CZC3389510 Version : HPQOEM - 1072009 SMBIOSBIOSVersion : 8.19 SystemName :

PS C:\Windows> Get-BIOS -Properties * Caption : BIOS Date: 01/12/15 09:18:22 Ver: 8.19 Description : BIOS Date: 01/12/15 09:18:22 Ver: 8.19 InstallDate : Name : BIOS Date: 01/12/15 09:18:22 Ver: 8.19 Status : OK BuildNumber : CodeSet : IdentificationCode : LanguageEdition : Manufacturer : AMI OtherTargetOS : SerialNumber : CZC3389510 SoftwareElementID : BIOS Date: 01/12/15 09:18:22 Ver: 8.19 SoftwareElementState : Running TargetOperatingSystem : Version : HPQOEM - 1072009 PrimaryBIOS : True BiosCharacteristics : {PCI is supported, Plug and Play is supported, BIOS is Upgradeable (Flash), BIOS shadowing is allowed...} BIOSVersion : {HPQOEM - 1072009, BIOS Date: 01/12/15 09:18:22 Ver: 8.19} CurrentLanguage : en|US|iso8859-1 InstallableLanguages : 12 ListOfLanguages : {en|US|iso8859-1, fr|FR|iso8859-1, es|ES|iso8859-1, de|DE|iso8859-1...} ReleaseDate : 12/01/2015 02:00:00 SMBIOSBIOSVersion : 8.19 SMBIOSMajorVersion : 2 SMBIOSMinorVersion : 7 SMBIOSPresent : True

Example 4

PS C:\Windows> Get-BIOS -Properties Name,SerialNumber,Status Name SerialNumber Status ---- ------------ ------ BIOS Date: 01/12/15 09:18:22 Ver: 8.19 CZC3389510 OK PS C:\Windows> Get-BIOS -Properties Name,SerialNumber,Status | Format-List Name : BIOS Date: 01/12/15 09:18:22 Ver: 8.19 SerialNumber : CZC3389510 Status : OK

[adinserter name=”In Article”]

PowerShell Module Cmdlets List

Once more I am providing you below the list of all cmdlets included currently in the module.

Hope you like SysInfo module and the additional features.

You feedback and recommendations are appreciated.

If you have any questions or anything else please let me know in the comments below.

[adinserter name=”In Article”]

Related Links

[adinserter name=”Matched-Content”]