Link to home
Start Free TrialLog in
Avatar of Dom Gaudioso
Dom Gaudioso

asked on

I need help creating a [powershell] script that can uninstall silently MS Visio all versions from Win 7 computers.

I need help creating a script that can uninstall silently MS Visio - all versions - from Win 7 computers.  Thanks
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

$app = Get-WmiObject -Class Win32_Product | Where-Object { 
    $_.Name -match "Visio" 
}

$app.Uninstall()

Open in new window

Avatar of Dom Gaudioso
Dom Gaudioso

ASKER

Hi Shaun.  Thank you very much for the reply.  I already had this script, which works in Win 10 but not Win 7.   Any clues why?


Set-ExecutionPolicy RemoteSigned
Set-ExecutionPolicy Unrestricted
$app = Get-WmiObject -Class Win32_Product | Where-Object {
    $_.Name -match "visio"
}

$app.Uninstall()
ASKER CERTIFIED SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do you mean use Powershell v5+ to write the script?  Or Powershell v5+ needs to be installed on the target PC?   Thank you very much fop the reply.
Hi Shaun, I have the version 5.1 on my Win 10 computer, so I would need to install it on the Win 7 computers as well for the uninstall routine to work?  

Here is the result of my version command on my PC:

PS H:\> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      14393  206    

Thank you for the reply.
Are you running script remotely or executing it on remote computers via GPO etc?
executing via BMC Footprint console - thank you
Guess it is running directory on the client then, so yes PS 5 required on the client. You can also run this with Invoke-Command
Thank you LVL - this works for now...
Glad we could help.

@OP, experts and future visitors:
Please remember to endorse my, or any other expert's comments that you found helpful by clicking on the "Thumb's Up" button

Read more on endorsements
https://www.experts-exchange.com/discussions/218503/What-are-Endorsements.html