Check if a particular application is installed using Powershell
function check_if_installed($p1) { $software = $p1; $installed = ((gp HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*).DisplayName -Match $p1).Length -gt 0 If (-Not $installed) { Write-Host "'$software' is not installed."; } else { Write-Host "'$software' is installed." } return $installed } check_if_installed -p1 "Visual Studio Code"