tag:blogger.com,1999:blog-6159186316497589396.post125488500025648984..comments2024-03-28T13:37:26.755-05:00Comments on Mick's IT Blogs: PowerShell: Uninstall MSI by Application NameMick Pletcherhttp://www.blogger.com/profile/09597651323688418212noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-6159186316497589396.post-15344325355418646392017-12-29T15:26:16.136-06:002017-12-29T15:26:16.136-06:00Thanks for that info. I have never run into that s...Thanks for that info. I have never run into that situation before. Mick Pletcherhttps://www.blogger.com/profile/09597651323688418212noreply@blogger.comtag:blogger.com,1999:blog-6159186316497589396.post-82867374664002387102017-12-13T21:25:24.798-06:002017-12-13T21:25:24.798-06:00Under conditions where the same software installed...Under conditions where the same software installed by two different vendors, or old version has not uninstalled when new version installed, it returns the following when $executable is echoed out<br />/x {GUID} {GUID} /qr /norestart<br />Failed with error code 1639 <br /><br />I had to add a ForEach-object in, allowing parsing of the GUID's through the script inline. <br />Add the following inbetween $key = $uninstall.... and if ($key -ne....<br /> $testsplit = $Key.pschildname<br /> $testsplit.split(" ") | ForEach-Object {<br /> $tsplit = $_<br />then curly } out before calling the function at the bottom.<br /><br />then change the line<br />$Parameters = "/x " + $Key.PSChildName + [char]32 + $Switches <br />to <br />$Parameters = "/x " + $tsplit + [char]32 + $Switches<br /><br />I think that was all the changes I madeAnonymoushttps://www.blogger.com/profile/15945836940950736547noreply@blogger.com