Update Tadco_Setup_Script.ps1
Fixed try command
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
try {
|
||||||
|
|
||||||
# Check if running as Administrator
|
# Check if running as Administrator
|
||||||
#if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Administrator")) {
|
#if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Administrator")) {
|
||||||
# Write-Warning "You must run this script as Administrator!"
|
# Write-Warning "You must run this script as Administrator!"
|
||||||
@@ -180,12 +182,14 @@ if (-not (Select-String -Path $logFile -Pattern "DEBLOATER_RAN" -Quiet)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
# your entire script is above this block
|
|
||||||
Log "Tadco setup script completed successfully."
|
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
Log "ERROR: $($_.Exception.Message)"
|
$msg = "ERROR: $($_.Exception.Message)"
|
||||||
Write-Host "ERROR: $($_.Exception.Message)" -ForegroundColor Red
|
Log $msg
|
||||||
|
Write-Host $msg -ForegroundColor Red
|
||||||
} finally {
|
} finally {
|
||||||
Write-Host "`nPress Enter to close..." -ForegroundColor Cyan
|
Write-Host "`nPress Enter to close..." -ForegroundColor Cyan
|
||||||
Read-Host
|
Read-Host
|
||||||
|
|||||||
Reference in New Issue
Block a user