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
Dom GaudiosoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

$app.Uninstall()

Open in new window

Dom GaudiosoAuthor Commented:
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()
Shaun VermaakTechnical SpecialistCommented:
Install Powershell v5+

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Dom GaudiosoAuthor Commented:
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.
Dom GaudiosoAuthor Commented:
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.
Shaun VermaakTechnical SpecialistCommented:
Are you running script remotely or executing it on remote computers via GPO etc?
Dom GaudiosoAuthor Commented:
executing via BMC Footprint console - thank you
Shaun VermaakTechnical SpecialistCommented:
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
Dom GaudiosoAuthor Commented:
Thank you LVL - this works for now...
Shaun VermaakTechnical SpecialistCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.