• Welcome to Support Forum: Get Support for Patch My PC Products and Services.
 

Does anyone have experience running the PMPC community Software-Uninstall script

Started by Red5sb, December 11, 2024, 07:43:51 AM

Previous topic - Next topic

Red5sb

 https://github.com/PatchMyPCTeam/Community-Scripts/tree/main/Uninstall/Pre-Uninstall/Uninstall-Software

I can't add arguments when executing the PS1 from the cloud portal, so I'm trying to specify values like $DisplayName within the PS1 itself. I've set that value in the script in both locations where $DisplayName is set: under the 'AdditionalArguments' parameters, and under the Get-InstalledSoftware function.

Yet when I test run the PS1, it still prompts me to enter a value for DisplayName in the command line:
cmdlet Uninstall-Software.ps1 at command pipeline position 1
Supply values for the following parameters:
DisplayName:

Anyone know how I need to properly supply this value (or others) within the PS1?

nithin

Hello Red5sb,

As an example, I have used the Anywhere 365 integrator MSI version of the app to uninstall with Uninstall All Argument.
Please note that the Community Uninstall script queries the MSI silent uninstall string, and you can hardcode the silent uninstall string as suggested by the vendor; otherwise, the uninstallation may fail.

Please let me know if you have any questions or concerns.

param (
    [Parameter(Mandatory = $false)]
    [String]$DisplayName = "*Anywhere365 Integrator*",
 
    [Parameter()]
    [ValidateSet('Both', 'x86', 'x64')]
    [String]$Architecture = 'Both',
 
    [Parameter()]
    [ValidateSet('HKLM', 'HKCU')]
    [String[]]$HivesToSearch = 'HKLM',
 
    [Parameter()]
    [ValidateSet(1, 0)]
    [Int]$WindowsInstaller,
 
    [Parameter()]
    [ValidateSet(1, 0)]
    [Int]$SystemComponent,
 
    [Parameter()]
    [String]$VersionLessThan,
 
    [Parameter()]
    [String]$VersionEqualTo,
 
    [Parameter()]
    [String]$VersionGreaterThan,
 
    [Parameter(ParameterSetName = 'EnforcedArguments')]
    [String]$EnforcedArguments,
 
    [Parameter(ParameterSetName = 'AdditionalArguments')]
    [String]$AdditionalArguments,
 
    [Parameter(ParameterSetName = 'AdditionalEXEorMSIArguments')]
    [String]$AdditionalMSIArguments,
 
    [Parameter(ParameterSetName = 'AdditionalEXEorMSIArguments')]
    [String]$AdditionalEXEArguments,
 
    [Parameter()]
    [Switch]$UninstallAll = $true,
 
    [Parameter()]
    [Switch]$Force,
 
    [Parameter()]
    [String]$ProcessName,
 
    [Parameter()]
    [String[]]$RemovePath
)