Advertisement
guyrleech

Check if an application is installed

Mar 16th, 2020
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [string]$appDisplayName = 'App Volumes Agent'
  2.  
  3. if( ( Get-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' -Name DisplayName -ErrorAction SilentlyContinue | Where-Object DisplayName -match $appDisplayName ) `
  4.     -or ( Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' -Name DisplayName -ErrorAction SilentlyContinue | Where-Object DisplayName -match $appDisplayName ) )
  5. {
  6.     "`"$appDisplayName`" is installed"
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement