added new functions to Tools.ps1 and improved Get-InstalledSoftware.ps1

This commit is contained in:
2021-07-23 17:04:25 -04:00
parent 074707095b
commit 56d8d9e414
2 changed files with 59 additions and 3 deletions
+36 -2
View File
@@ -1,2 +1,36 @@
$FILE = "${SystemDrive}\InstalledSoftware.csv"
Get-WmiObject -Class Win32_Product | Sort-Object Name | Select Name,Vendor,Version | Where Name -NotLike "" | Export-Csv -Path $FILE -NoTypeInformation -Force
#$FILE = "${SystemDrive}\InstalledSoftware.csv"
$FILE = "${UserProfile}\Desktop\InstalledSoftware.csv"
#Get-WmiObject -Class Win32_Product | Sort-Object Name | Select Name,Vendor,Version | Where Name -NotLike "" | Export-Csv -Path $FILE -NoTypeInformation -Force
ForEach ( $item in $(Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall') ) {
If ( Test-ItemProperty -Path $item.PSPath -Name DisplayName ) {
$DisplayName = Get-ItemPropertyValue -Path $item.PSPath -Name DisplayName
} Else { $DisplayName = "" }
If ( Test-ItemProperty -Path $item.PSPath -Name DisplayVersion ) {
$DisplayVersion = Get-ItemPropertyValue -Path $item.PSPath -Name DisplayVersion
} Else { $DisplayVersion = "" }
If ( Test-ItemProperty -Path $item.PSPath -Name EstimatedSize ) {
$EstimatedSize = Get-ItemPropertyValue -Path $item.PSPath -Name EstimatedSize
} Else { $EstimatedSize = "" }
If ( Test-ItemProperty -Path $item.PSPath -Name InstallDate ) {
$InstallDate = Get-ItemPropertyValue -Path $item.PSPath -Name InstallDate
} Else { $InstallDate = "" }
If ( Test-ItemProperty -Path $item.PSPath -Name Publisher ) {
$Publisher = Get-ItemPropertyValue -Path $item.PSPath -Name Publisher
} Else { $Publisher = "" }
If ( Test-ItemProperty -Path $item.PSPath -Name UninstallString ) {
$UninstallString = Get-ItemPropertyValue -Path $item.PSPath -Name UninstallString
} Else { $UninstallString = "" }
If ( Test-ItemProperty -Path $item.PSPath -Name ModifyPath ) {
$ModifyPath = Get-ItemPropertyValue -Path $item.PSPath -Name ModifyPath
} Else { $ModifyPath = "" }
$content = "${DisplayName},${Publisher},${DisplayVersion},${InstallDate},${EstimatedSize},${UninstallString},${ModifyPath}"
Write-LineToFile -Path $FILE -Line $content
}