Uninstall w/wildcards for Yahoo Search Set

Comments

5 comments

  • Robert Basil

    I would LOVE to be able to do this for those programs that include their version numbers in their install path (I'm looking at you Adobe!).

    0
    Comment actions Permalink
  • Chris James

    Since the majority of the path is the same, you could gather those items with PowerShell and wild cards.

    For Example, iTunes in my repository:

    Get-Item D:\Repository\Apple\iTunes\*\32\iTunes.msi
        Directory: D:\Repository\Apple\iTunes\12.6.0.100\32
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    -a----        3/22/2017   8:07 PM      150200320 iTunes.msi
        Directory: D:\Repository\Apple\iTunes\12.6.2.20\32
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    -a----        7/19/2017   1:44 PM      153620480 iTunes.msi
        Directory: D:\Repository\Apple\iTunes\12.7.0.166\32
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    -a----        9/11/2017   4:19 PM      151175168 iTunes.msi
    

    Then with your example: C:\Program Files (x86)\Yahoo!*\unset.exe That should work for getting all those different versions. You'll want to store it into a variable, and for each object perform the desired task.

    I put in some extra output to demonstrate it was grabbing and running for each one of the found files, but here's basically what you could do: Example!

    0
    Comment actions Permalink
  • Rory Schmitz

    @chrisj Thank you for that! On your screenshot, and the 'Start-Process $_ -ArgumentList' portion, does that look at the iTunes.msi for all applicable parameters, or is it assuming I know what the parameter is to be specified like you did with "help"?

    0
    Comment actions Permalink
  • Rory Schmitz

    I was able to get this working fine for the Yahoo Search Set so I greatly appreciate the assistance. I struggled a little with how Deploy handles path wildcards. I couldn't use %PROGRAMFILES(x86)% and had to hard code the path instead. It appeared Deploy hard-coded the wildcard. Error here:

    Get-Item : Cannot find path 'C:\windows\AdminArsenal\PDQDeployRunner\service-1\exec%PROGRAMFILES(x86)%\Yahoo!\yset' because it does not exist.

    Regardless, it wasn't a concern. I was using the built-in PowerShell script Step in the package so I adjusted and seems to work great.

    Here is the final script I used as @chrisj so kindly showed us:

    $YahooSearchSet = Get-Item "C:\Program Files (x86)\Yahoo!\yset\*\unset.exe"
    
    $YahooSearchSet | ForEach-Object {
    Start-Process $_
    }
    

    This should make uninstalling these types of software much easier in the future.

    0
    Comment actions Permalink
  • Colby Bouma

    That variable is ${env:ProgramFiles(x86)} in PowerShell. The {} are necessary due to the () in the name. You can see all PowerShell environment variables by running Get-ChildItem env:* | Sort-Object Name.

    0
    Comment actions Permalink

Please sign in to leave a comment.