Closed michaelst closed 1 year ago
This is the file contents of the file I'm getting the error on
#This will uninstall all msi versions of 7-Zip $AppName = "7-Zip *" ForEach ( $Architecture in "SOFTWARE", "SOFTWARE\Wow6432Node" ) { $UninstallKeys = "HKLM:\$Architecture\Microsoft\Windows\CurrentVersion\Uninstall" if (Test-path $UninstallKeys) { $GUIDKey = Get-ItemProperty -Path "$UninstallKeys\*" | Where-Object -FilterScript { $_.DisplayName -like $AppName } $GUIDRealKey = $GUIDKey | select-object PSChildName -ExpandProperty PSChildName If ( $GUIDKey -ne $null -and $GuidRealKey -notlike "7-Zip" ) { $GuidRealKey | ForEach-Object { $GUID = $_ Write-Output "Uninstalling: $(( Get-ItemProperty "$UninstallKeys\$GUID" ).DisplayName) " Start-Process -Wait -FilePath "MsiExec.exe" -ArgumentList "/X$GUID /qn /norestart" } } Else { Write-Output "$AppName installation not found in: $UninstallKeys" } } }
oh looks like the problem is that the file extension is stripped by my server during the upload process, I didn't have that issue with other formats, maybe there is a limitation with ps1 for that
This is the file contents of the file I'm getting the error on