Skip to content

Conversation

@samt441
Copy link

@samt441 samt441 commented Nov 8, 2021

if you want you can just add the uninstall function as one line to the original code to make it work but it would still be messy code. This is barely messy code.

if you want you can just add the uninstall function as one line to the original code to make it work but it would still be messy code. This is barely messy code.
#function that uninstalls the programs that are passed in as an array. Silently if possible
function Uninstall-Program($uninstallList){
ForEach ($version in $uninstallList) {
If ($version.QuuietUninstallString) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo here. "Quuiet"

$uninst = $version.QuuietUninstallString
Start-Process cmd -ArgumentList "/c $uninst"
}
If ($version.UninstallString) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section would run whether there is a quiet uninstall string or not. If there is a quiet string, this would throw an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants