Created
November 5, 2016 13:43
-
-
Save trondhindenes/7eafc770f6d6e829fd9370acd673515d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$packages = Get-WmiObject -Class Win32_Product | |
$returnpackages = @() | |
foreach ($package in $packages) | |
{ | |
$PackageObj = "" | Select Name, IdentifyingNumber, Version, Caption | |
$PackageObj.Name = $Package.Name | |
$PackageObj.IdentifyingNumber = $Package.IdentifyingNumber | |
$PackageObj.Version = $Package.Version | |
$PackageObj.Caption = $Package.Caption | |
$returnpackages += $PackageObj;$PackageObj = $null | |
} | |
$returnpackages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment