/build/static/layout/Breadcrumb_cap_w.png
08/08/2019 159 views

I have 3  guids to uninstall for one package hp loadrunner. How do I write script for 3 guids

Answer Summary:
0 Comments   [ + ] Show comments

Comments


Answer Chosen by the Author

0

can anyone suggest good tutorial to learn powershell commands and also practice 

Answered 08/09/2019 by: ldhema
Senior White Belt

  • I can recommend the book: learn powershell in a month of lunches
    Also check the following links:

    https://ss64.com/ps/

    https://powershellexplained.com/

    https://blogs.msdn.microsoft.com/koryt/2018/01/04/powershell-for-programmers-basic-syntax-cmdlets/

    (It is version 3 but has a lot of useful information )
    https://channel9.msdn.com/Series/GetStartedPowerShell3

All Answers

0

Is there a reason you want to use PowerShell here?  I am a big fan of WMIC commands.  They are simple and can work in a batch file easily.  If you have the GUID it would be a simple command like this replacing the GUID but leaving the brackets :

wmic product where identifyingnumber={guid} call uninstall /nointeractive

But if you want to install all products that have a similar name (like java might have 5 versions of Java 8 on a machine), you could use a command like this to remove all programs that start with "java 8"

wmic product where "name like 'Java 8%%'" call uninstall /nointeractive


Hope that helps!



Answered 08/09/2019 by: jamie_kace
Brown Belt

  • There is no reason to use powershell. I did write it in batch file but was curious how to do in powershell. Just for learning.. Thanks for your response . I will dig into wmic