Created
May 11, 2020 09:29
-
-
Save lumodino/a804845c743e6a3319938f894f34a1ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Desinstalación de todas las versiones de Java | |
.DESCRIPTION | |
Busca todas las versiones de Java instaladas por medio de una expresión regular para localizar el identificador del instalador MSI y quita todas las versiones encontradas. | |
#> | |
function Remove-Java { | |
Get-WmiObject -Class Win32_Product ` | |
| Where-Object {$_.name -match '^java\s\d+\s\w+\s\d+'}` | |
| Foreach-Object { | |
[string]$identificadorinstaller=$_.IdentifyingNumber | |
start-Process msiexec.exe -ArgumentList "/x $identificadorinstaller /qn" -Verb RunAs -wait | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment