PowerShell é um shell de linha de comando baseado em tarefas e linguagem de script desenvolvido no .NET. Inicialmente, apenas um componente do Windows, o PowerShell tornou-se de código aberto e multiplataforma em 18 de agosto de 2016 com a introdução do PowerShell Core.
Liste os aplicativos instalados.
$INSTALLED = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, UninstallString
$INSTALLED += Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, UninstallString
$INSTALLED | ?{ $_.DisplayName -ne $null } | sort-object -Property DisplayName -Unique | Format-Table -AutoSize
Aqui está a saída do comando.
DisplayName UninstallString
----------- ---------------
Amazon SSM Agent MsiExec.exe /I{4936D33F-27E7-4E19-AB10-BA0A81EE3CE3}
AWS PV Drivers MsiExec.exe /I{90C09D7C-18EB-4853-9F4F-D3040CC23924}
AWS Tools for Windows MsiExec.exe /I{0AD5C1F2-7228-4004-B09C-288CC9F2CB15}
aws-cfn-bootstrap MsiExec.exe /X{6B6DFDD0-7564-428B-AC1B-06EC1B5A82F5}
MySQL Connector Net MsiExec.exe /I{C23CF47E-026C-44E3-BE5E-B2384F965F40}
Microsoft Edge MsiExec.exe /X{91C19DE0-D807-300C-BA77-F3ED21C0C738}
Google Chrome "C:\Program Files\Google\Chrome\Application\92.0.4515.107\Installer\setup.exe" --uninstall --channel=stable --system-level --verbose-logging
Microsoft Visual Studio Code "C:\Program Files\Microsoft VS Code\unins000.exe"
Mozilla Firefox 88.0 (x64 en-US) "C:\Program Files\Mozilla Firefox\uninstall\helper.exe"
Mozilla Maintenance Service "C:\Program Files (x86)\Mozilla Maintenance Service\uninstall.exe"
Notepad++ (64-bit x64) C:\Program Files\Notepad++\uninstall.exe
Procure o aplicativo Mozilla Firefox.
$SEARCH = 'firefox'
$RESULT =$INSTALLED | ?{ $_.DisplayName -ne $null } | Where-Object {$_.DisplayName -match $search }
$RESULT
Aqui está a saída do comando.
DisplayName UninstallString
----------- ---------------
Mozilla Firefox (x64 en-US) "C:\Program Files\Mozilla Firefox\uninstall\helper.exe"
Desinstale o aplicativo Mozilla Firefox.
if ($RESULT.uninstallstring -like "msiexec*") {
$ARGS=(($RESULT.UninstallString -split ' ')[1] -replace '/I','/X ') + ' /q'
Start-Process msiexec.exe -ArgumentList $ARGS -Wait
} else {
$UNINSTALL_COMMAND=(($RESULT.UninstallString -split '\"')[1])
$UNINSTALL_ARGS=(($RESULT.UninstallString -split '\"')[2]) + ' /S'
Start-Process $UNINSTALL_COMMAND -ArgumentList $UNINSTALL_ARGS -Wait
}
Desinstale o Mozilla Firefox usando um script Powershell.
$SEARCH = 'firefox'
$INSTALLED = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, UninstallString
$INSTALLED += Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, UninstallString
$RESULT = $INSTALLED | ?{ $_.DisplayName -ne $null } | Where-Object {$_.DisplayName -match $SEARCH }
if ($RESULT.uninstallstring -like "msiexec*") {
$ARGS=(($RESULT.UninstallString -split ' ')[1] -replace '/I','/X ') + ' /q'
Start-Process msiexec.exe -ArgumentList $ARGS -Wait
} else {
$UNINSTALL_COMMAND=(($RESULT.UninstallString -split '\"')[1])
$UNINSTALL_ARGS=(($RESULT.UninstallString -split '\"')[2]) + ' /S'
Start-Process $UNINSTALL_COMMAND -ArgumentList $UNINSTALL_ARGS -Wait
}
Parabéns! Você é capaz de desinstalar o Mozilla Firefox usando Powershell.
Precisando de Consultoria em TI ou Suporte Pode Contar Comigo e Minha Equipe.
Pode Chamar em Nosso Whats: (51) 993117507
https://linktr.ee/julianoaguiar