pull apps from registry and show their size
This commit is contained in:
32
windows/appchk.ps1
Normal file
32
windows/appchk.ps1
Normal 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
|
||||||
Reference in New Issue
Block a user