PowerShell | How to know if an Application is installed?

Let's find out if Microsoft Word is installed on the system:


if ((dir REGISTRY::HKEY_CLASSES_ROOT\Word.Application) -ne $Null)
{
#do word installed stuff such as
$myWord = New-Object -Com Word.Application
$myWord.Visible = $true
}

Another option would be to catch the exception launched from the failed new-object

Thanks to
http://www.virtu-al.net/2008/08/07/powershell-is-microsoft-word-installed/

Comments

Popular posts from this blog

Breaking down document locking in SharePoint

Working around X-Frame-Options for iframes

Document ID not being generated