Get-UninstallRegistryKey

Get-UninstallRegistryKey

Get-UninstallRegistryKey

Retrieve registry key(s) for system-installed applications from an exact or wildcard search.

Syntax

Get-UninstallRegistryKey `
  -SoftwareName <String> `
  [-IgnoredArguments <Object[]>] [<CommonParameters>]

Description

This function will attempt to retrieve a matching registry key for an already installed application, usually to be used with a chocolateyUninstall.ps1 automation script.

The function also prevents Get-ItemProperty from failing when handling wrongly encoded registry keys.

Aliases

Get-InstallRegistryKey

Examples

EXAMPLE 1


# Version match: Software name is "Gpg4Win (2.3.0)"
[array]$key = Get-UninstallRegistryKey -SoftwareName "Gpg4win (*)"
$key.UninstallString

EXAMPLE 2


# Fuzzy match: Software name is "Launchy 2.5"
[array]$key = Get-UninstallRegistryKey -SoftwareName "Launchy*"
$key.UninstallString

EXAMPLE 3


# Exact match: Software name in Programs and Features is "VLC media player"
[array]$key = Get-UninstallRegistryKey -SoftwareName "VLC media player"
$key.UninstallString

EXAMPLE 4


#  Version match: Software name is "SketchUp 2016"
# Note that the similar software name "SketchUp Viewer" would not be matched.
[array]$key = Get-UninstallRegistryKey -SoftwareName "SketchUp [0-9]*"
$key.UninstallString

Inputs

None

Outputs

None

Parameters

-SoftwareName <String>

PropertyValue
Aliases
Required?true
Position?1
Default Value
Accept Pipeline Input?true (ByValue)

-IgnoredArguments [<Object[]>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters http://go.microsoft.com/fwlink/p/?LinkID=113216 .

Function Reference

:choco-info: NOTE

This documentation has been automatically generated from Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Get-UninstallRegistryKey -Full.

View the source for Get-UninstallRegistryKey