Add Powershell Modules & NuGet Repo/Read-ExitCode.ps1
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<#
|
||||
Author: Gabe Kerntke
|
||||
Date: 04-29-2026
|
||||
|
||||
.Synopsis
|
||||
Function checks the exitcode
|
||||
|
||||
.Modified
|
||||
2026-04-29 (GabeK) - Original script created
|
||||
#>
|
||||
|
||||
Set-StrictMode -Version 2.0
|
||||
|
||||
#Function checks the exitcode
|
||||
Function Read-ExitCode {
|
||||
If ($ExitCode -eq 0) {
|
||||
Write-Host "Script was Successful"
|
||||
Start-Sleep 10
|
||||
(Get-Software | Select-Object DisplayName, DisplayVersion | Where-Object { $_.DisplayName -like "*$App_Name*" } | Format-List | Out-string).Trim()
|
||||
Remove-Item $Dest_File -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
ElseIf ($ExitCode -eq 3010) {
|
||||
Write-Host "Script was Successful, but a reboot is required."
|
||||
Start-Sleep 10
|
||||
(Get-Software | Select-Object DisplayName, DisplayVersion | Where-Object { $_.DisplayName -like "*$App_Name*" } | Format-List | Out-string).Trim()
|
||||
Remove-Item $Dest_File -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
ElseIf ($ExitCode -eq 1642) {
|
||||
Write-Host "MUI version not detected, please reinstall Adobe to update."
|
||||
Remove-Item $Dest_File -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
Else {
|
||||
Write-Host `n
|
||||
Write-Host "Failed... Exit Code:"$ExitCode
|
||||
Remove-Item $Dest_File -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user