We help IT Professionals succeed at work.

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

Dom Gaudioso
Dom Gaudioso asked
on
350 Views
Last Modified: 2017-05-02
I need help creating a script that can uninstall silently MS Visio - all versions - from Win 7 computers.  Thanks
Comment
Watch Question

Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

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

$app.Uninstall()

Open in new window

Author

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()
Senior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

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.

Author

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 VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

Commented:
Are you running script remotely or executing it on remote computers via GPO etc?

Author

Commented:
executing via BMC Footprint console - thank you
Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

Commented:
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

Author

Commented:
Thank you LVL - this works for now...
Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

Commented:
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

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions