From 1b45ccef74cccae2d3e02ace10c8e4e2ad9b73e9 Mon Sep 17 00:00:00 2001 From: rlogwood Date: Fri, 7 Jun 2024 17:52:30 -0400 Subject: [PATCH] pull apps from registry and show their size --- windows/appchk.ps1 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 windows/appchk.ps1 diff --git a/windows/appchk.ps1 b/windows/appchk.ps1 new file mode 100644 index 0000000..e15c0d2 --- /dev/null +++ b/windows/appchk.ps1 @@ -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