-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplicationupdate
More file actions
24 lines (20 loc) · 909 Bytes
/
applicationupdate
File metadata and controls
24 lines (20 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Set the search path for applications
$searchPath = "C:\Program Files"
# Get a list of installed applications
$applications = Get-ChildItem $searchPath -Recurse | Where-Object {$_.Extension -eq ".exe"}
# Check if any applications were found
if ($applications -eq $null) {
Write-Output "No applications were found."
} else {
# Check for updates for each application
foreach ($application in $applications) {
# Get the application version
$version = (Get-ItemProperty -Path $application.FullName).FileVersion
# Check if the application has an update available
$update = Get-WUInstall -ApplicationName $application.Name -ApplicationType EXE -RequiredApplicationVersion $version
# Print the name and version of applications that have an update available
if ($update -ne $null) {
Write-Output "$($application.Name) version $($version) has an update available."
}
}
}