Skip to content

Commit

Permalink
Show a MsgBox and Error Message when Unable to Create Temp Dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
SibTiger committed Dec 8, 2024
1 parent 0243908 commit 8064f50
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Scripts/DefaultCompress.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,12 @@ class DefaultCompress
# Debugging
# --------------

# Generate a message to display to the user.
[string] $displayErrorMessage = ("Unable to verify the compressed file:`r`n" + `
"`t" + $targetFileName + "`r`n" + `
"Tried to create a temporary directory to perform the validation" + `
" process, however the temporary directory could not be created!");

# Generate the initial message
[string] $logMessage = "Unable to verify the archive data file because the temporary directory could not be created!";

Expand All @@ -1123,6 +1129,15 @@ class DefaultCompress
$logAdditionalMSG, ` # Additional information
[LogMessageLevel]::Error); # Message level

# Display a message to the user that something went horribly wrong
# and log that same message for referencing purpose.
[Logging]::DisplayMessage($displayErrorMessage, ` # Message to display
[LogMessageLevel]::Error); # Message level

# Alert the user through a message box as well that an issue had occurred;
# the message will be brief as the full details remain within the terminal.
[CommonGUI]::MessageBox($logMessage, [System.Windows.MessageBoxImage]::Hand) | Out-Null;

# * * * * * * * * * * * * * * * * * * *


Expand Down

0 comments on commit 8064f50

Please sign in to comment.