pull apps from registry and show their size

This commit is contained in:
rlogwood
2024-06-07 17:52:30 -04:00
parent b67f1c8c9a
commit 1b45ccef74

32
windows/appchk.ps1 Normal file
View File

@ -0,0 +1,32 @@
# Define the registry paths for 32-bit and 64-bit applications
$registryPaths = @(
"HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall",
"HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
)
# Initialize an array to store application information
$applications = @()
# Loop through each registry path
foreach ($registryPath in $registryPaths) {
# Get the registry keys for each application
$keys = Get-ChildItem -Path $registryPath
foreach ($key in $keys) {
# Get the application properties
$app = Get-ItemProperty -Path $key.PSPath
# Add the application information to the array
$applications += [PSCustomObject]@{
Name = $app.DisplayName
Version = $app.DisplayVersion
Publisher = $app.Publisher
InstallDate = $app.InstallDate
Size = $app.EstimatedSize
}
}
}
# Filter out applications with no name
$applications = $applications | Where-Object { $_.Name -ne $null }
# Display the applications
$applications | Select-Object Name, Version, Publisher, InstallDate, Size | Format-Table -AutoSize