Software
Get-Win32App
Overview
Retrieves Win32 installed applications from either or both of the local machine and user scopes.
Cmdlet Attributes
Alias : ['gw32a']
CmdletBinding : []Parameters
IncludeUsers : System.Management.Automation.SwitchParameter
If provided, will retrieve installed Win32 application for all users on this device.
Attributes
Parameter : []
Alias : ['iu']UsersOnly : System.Management.Automation.SwitchParameter
If provided, will ONLY retrieve user-scope installed Win32 applications.
Attributes
Parameter : []
Alias : ['uo']Example
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
Alias : ['nw32a']
CmdletBinding : []Parameters
Name : System.String
The name of the Win32 application.
Attributes
Parameter : [Mandatory, Position = 0]
AllowEmptyString : []Scope : System.String
The Scope of the Win32 application.
Attributes
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
Parameter : []Version : System.Version
The version of the Win32 application.
Attributes
Parameter : []Publisher : System.String
The publisher of the Win32 application.
Attributes
Parameter : []InstallDate : System.DateTime
The install date for the Win32 application.
Attributes
Parameter : []InstallLocation : System.String
The path to the root of the application's files.
Attributes
Parameter : []UninstallArgs : System.Collections.Hashtable
A [ System.Hashtable ] containing keys:
-
FilePath-[ System.String ]path to the uninstaller. -
ArgumentList- A[ System.Array ]of[ System.String ]containing optional arguments to be provided to the uninstaller referenced above inFilePath.
Attributes
Parameter : []QuietUninstallArgs : System.Collections.Hashtable
A [ System.Hashtable ] containing keys:
-
FilePath- A[ System.String ]path to the uninstaller. -
ArgumentList- A[ System.Array ]of[ System.String ]containing optional arguments to be provided to the uninstaller referenced above inFilePath. ** NOTE: The ArgumentList for this parameter should include all necessary command-line arguments to perform a silent uninstall **
Attributes
Parameter : []IsMSI : System.Boolean
An indication of whether the uninstall package for the application is an MSI installer.
Attributes
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
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
CmdletBinding : [SupportsShouldProcess]
Alias : ['rw32a']Parameters
Application : System.Management.Automation.PSObject
The PSObject, as returned by Get-Win32App, to be uninstalled.
Attributes
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
Alias : ['i']
Parameter : [Position = 1]AdditionalArgs
Additional command line arguments to be provided to the application to perform the uninstall.
Default: @()
Attributes
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
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. |