Software

Get-Win32App

Overview

Retrieves Win32 installed applications from either or both of the local machine and user scopes.

Cmdlet Attributes

Copy
Copied
Alias         : ['gw32a']
CmdletBinding : []

Parameters

IncludeUsers : System.Management.Automation.SwitchParameter

If provided, will retrieve installed Win32 application for all users on this device.

Attributes

Copy
Copied
Parameter : []
Alias     : ['iu']

UsersOnly : System.Management.Automation.SwitchParameter

If provided, will ONLY retrieve user-scope installed Win32 applications.

Attributes

Copy
Copied
Parameter : []
Alias     : ['uo']

Example

Copy
Copied
PS> Get-Win32App 
InstallDate       : 8/1/2023 12:00:00 AM 
Publisher         : Google LLC 
IsMSI             : True 
Username          : 
UninstallArgs     : {[ArgumentList, System.Object[]], [FilePath, MsiExec.exe]} 
InstallLocation   : 
Scope             : MACHINE 
Name              : Google Chrome 
CanUninstall      : True 
CanQuietUninstall : False 

History

Author Date Version Release Notes
Anthony Maxwell 09/11/2023 1.0.0 - Initial Release.
Anthony Maxwell 10/24/2023 1.0.1 - Explicit typing tweaks.
- Help text overhaul.

New-Win32App

Overview

Creates a Win32 application object using the provided args. Primarily used internally by Get-Win32App.

Cmdlet Attributes

Copy
Copied
Alias         : ['nw32a']
CmdletBinding : []

Parameters

Name : System.String

The name of the Win32 application.

Attributes

Copy
Copied
Parameter        : [Mandatory, Position = 0]
AllowEmptyString : []

Scope : System.String

The Scope of the Win32 application.

Attributes

Copy
Copied
Parameter   : [Mandatory, Position = 1]
ValidateSet : ['USER', 'MACHINE']

Username : System.String

The username relative to the Win32 application - primarily used for software installs residing in one or more user profiles.

Attributes

Copy
Copied
Parameter : []

Version : System.Version

The version of the Win32 application.

Attributes

Copy
Copied
Parameter : []

Publisher : System.String

The publisher of the Win32 application.

Attributes

Copy
Copied
Parameter : []

InstallDate : System.DateTime

The install date for the Win32 application.

Attributes

Copy
Copied
Parameter : []

InstallLocation : System.String

The path to the root of the application's files.

Attributes

Copy
Copied
Parameter : []

UninstallArgs : System.Collections.Hashtable

A [ System.Hashtable ] containing keys:

  1. FilePath - [ System.String ] path to the uninstaller.
  2. ArgumentList - A [ System.Array ] of [ System.String ] containing optional arguments to be provided to the uninstaller referenced above in FilePath .

Attributes

Copy
Copied
Parameter : []

QuietUninstallArgs : System.Collections.Hashtable

A [ System.Hashtable ] containing keys:

  1. FilePath - A [ System.String ] path to the uninstaller.
  2. ArgumentList - A [ System.Array ] of [ System.String ] containing optional arguments to be provided to the uninstaller referenced above in FilePath . ** NOTE: The ArgumentList for this parameter should include all necessary command-line arguments to perform a silent uninstall **

Attributes

Copy
Copied
Parameter : []

IsMSI : System.Boolean

An indication of whether the uninstall package for the application is an MSI installer.

Attributes

Copy
Copied
Parameter : []

VarArgs : System.Object[]

A [ System.Array ], which must be provided in groups of two, to create any additional Win32App properties that may be useful to specific automation endeavors.

Attributes

Copy
Copied
Parameter : [ValueFromRemainingArguments]

Output

Type: [ System.Management.Automation.PSObject ]

A PSObject containing all provided arguments and methods for application Uninstall and QuietUninstall.

History

Author Date Version Release Notes
Anthony Maxwell 09/11/2023 1.0.0 - Initial Release.
Anthony Maxwell 09/14/2023 1.0.1 - Documentation pass.

Remove-Win32App

Overview

Performs an uninstall of the provided application.

Cmdlet Attributes

Copy
Copied
CmdletBinding : [SupportsShouldProcess]
Alias         : ['rw32a']

Parameters

Application : System.Management.Automation.PSObject

The PSObject, as returned by Get-Win32App, to be uninstalled.

Attributes

Copy
Copied
Alias     : ['app']
Parameter : [Mandatory, ValueFromPipeline, Position = 0]

Interactive : System.Management.Automation.SwitchParameter

If provided, the uninstall will require console session interaction to proceed. ** WARNING: this switch CANNOT be used if invoked from a Worklet script, yet. **

Attributes

Copy
Copied
Alias     : ['i']
Parameter : [Position = 1]

AdditionalArgs

Additional command line arguments to be provided to the application to perform the uninstall.

Default: @()

Attributes

Copy
Copied
Parameter : [Position = 2]
Alias     : ['aa']

Output

Type: [ System.Management.Automation.PSObject ]

A PSObject containing the uninstaller exit code, provided file path and uninstall args used.

Example

Copy
Copied
PS> Get-Win32App | Where-Object { $_.Name -match 'Google Chrome' } | Remove-Win32App 

History

Author Date Version Release Notes
Anthony Maxwell 09/11/2023 1.0.0 - Initial Release.
Anthony Maxwell 09/14/2023 1.0.1 - Documentation pass.