waypoit debuguing
This commit is contained in:
@@ -52,6 +52,7 @@ param(
|
||||
begin {
|
||||
function Show-Help {
|
||||
@'
|
||||
|
||||
Princess Pi's Magical CHECKSUM!
|
||||
|
||||
NAME
|
||||
@@ -123,14 +124,15 @@ EXAMPLES
|
||||
|
||||
Princess Pi LOVES YOU!~
|
||||
https://linktr.ee/princesspi3
|
||||
|
||||
'@
|
||||
};
|
||||
|
||||
function Write-ErrorWithHelp {
|
||||
param([string]$ErrorMessage);
|
||||
Write-Error $ErrorMessage;
|
||||
Write-Host "";
|
||||
Show-Help;
|
||||
Write-Host "";
|
||||
Write-Error $ErrorMessage;
|
||||
};
|
||||
|
||||
function Show-PrincessPiArt {
|
||||
@@ -144,7 +146,7 @@ https://linktr.ee/princesspi3
|
||||
=#=*==**#*#########%++#*+++@ *++++++++#+++++++++++#****==+******#
|
||||
*#=====%####***%%++++#*+++**% ++++++++*+++++++++++++#************#*******
|
||||
@****#==%####**#*+++++++#+++#**# #+++++++++++++++++++#####+*****************#
|
||||
@****#######%**@+*%**#%+++++%##*** #+++++++++++++++++#+++++++#****+======*****+
|
||||
@****#######%**@+*%**#%+++++%##*** #+++++++++++++++++#+++++#****+======*****+
|
||||
#****##%####@**%+*******@@+++@###**% #+++++++++++++*++++++++++****========****#
|
||||
****#####%%*%*%+***@@@%%@*+++@####** *+++++++++++++++++++++#****=======****#
|
||||
%***####%%**+%%*++*@=##@@%@++++%###*** +++++*+++++++++++#+**************#
|
||||
@@ -160,19 +162,19 @@ https://linktr.ee/princesspi3
|
||||
%#%###%###########@@%#%#@@##++++++++****++++********+++ %########**===*###%*#
|
||||
#**##%####@@####%@######%*++++++++++++++++#++**+*#++++# ########******###% %
|
||||
@#***# ###%@@##%#######@+++++++++++++++++++++%*++**++++# *########******##% @
|
||||
%*******% %##% =@#########++++++++++++++++++#++++*%++*#%#++# ########******##%
|
||||
*******% %##% =@#########++++++++++++++++++#++++*%++*#%#++# ########******##%
|
||||
#@%@# %% *@#@@###*+++++++++++++++++++%+++##+++###++* ##*#####******##@
|
||||
**##%*++%++++++++++++++++++++++++++++++++% +#**#####******###
|
||||
##%#######*@***+#+++++++++++++++#***#++++++++++++ %**#####*******#%
|
||||
*+++++++****##****++++++++##% #******#+++++++++++ %**#####*******#@
|
||||
*+++++$****##****++++++++##% #******#+++++++++++ %**#####*******#@
|
||||
#++++++++*******- ++++++++# *******#++++++++++# @**#####*******#
|
||||
#@@+++++++******- *+++++++# #******#+++++++++* **####%**==+**@
|
||||
@@@@@+++ %+++++++# ******# %+++++++ %*###%***===**@ %=
|
||||
@@@@@@@@@ #+++++++# =****** #++++++% *###%#***=+**% %**
|
||||
@@@@@@@@@@ ++++++++# ******# #++++++# *##@%********% @*@
|
||||
@@+@@@++@@+ ++++++++# #******# #++++++# @## #*********@ #***#
|
||||
@@+@@@++@@+ ++++++++# ******# #++++++# @## #*********@ #***#
|
||||
@@+@@++@@@++ @@@++++++* @@@%**** #@@++++% +## %#****************%
|
||||
@*@**@+++# @@@@+++++ @@@@@@**# @@@@+++# @# %#****************
|
||||
@*@**@+++# @@@@+++++ @@@@@@**# @@@@++++# @# %#****************
|
||||
+#+++++# @@@@@@+++% @@@@@@@@# @@@@@@@++ @ %##************%
|
||||
#+++** @@@@@@@@@@ @@@@@@@@@ @@@@@@@@@ %###********%*
|
||||
@@@@@@@@@@+ @@@@@@@@@@ =@@@@@@@@@ %%#####%%
|
||||
@@ -185,12 +187,13 @@ https://linktr.ee/princesspi3
|
||||
#########*
|
||||
|
||||
____ ____ ____ _ _ ___ ____ ___ ___ ____ ____
|
||||
( _ \( _ \(_ _)( \( )/ __)( ___)/ __)/ __) ( _ \(_ _)/\/
|
||||
( _ \( _ \(_ _)( \( )/ __)( ___)/ __)/ __) ( _ \(_ _)/\/
|
||||
)___/ ) / _)(_ ) (( (__ )__) \__ \\__ \ )___/ _)(_
|
||||
(__) (_)\_)(____)(_)\_)\___)(____)(___/(___/ (__) (____)
|
||||
(__) (_)\_)(____)(_)\_)\___)(____)(___/(___/ (__) (____)
|
||||
|
||||
Princess Pi
|
||||
https://linktr.ee/princesspi3
|
||||
|
||||
'@
|
||||
Write-Host $art -ForegroundColor Blue;
|
||||
};
|
||||
@@ -338,9 +341,13 @@ process {
|
||||
}
|
||||
} -ThrottleLimit 16;
|
||||
|
||||
$showProgressMatch = $Recursive.IsPresent -or $isWildcardGlobal;
|
||||
|
||||
foreach ($res in $results) {
|
||||
$currentIndex.Value++;
|
||||
if ($showProgressMatch -and $totalFiles -gt 0) {
|
||||
Write-Progress -Activity "Matching Checksums ($Algorithm)" -Status "Processing file $($currentIndex.Value) of $totalFiles" -PercentComplete (($currentIndex.Value / $totalFiles) * 100);
|
||||
}
|
||||
|
||||
if ($res.IsMatch) {
|
||||
Write-Host "$($res.TargetFile): " -NoNewline;
|
||||
@@ -348,10 +355,12 @@ process {
|
||||
} else {
|
||||
Write-Host "$($res.TargetFile): " -NoNewline;
|
||||
Write-Host "FAILED" -ForegroundColor Red;
|
||||
}
|
||||
};
|
||||
};
|
||||
if ($showProgressMatch) {
|
||||
Write-Progress -Activity "Matching Checksums ($Algorithm)" -Completed;
|
||||
}
|
||||
}
|
||||
# --- VERIFICATION MODE (-c / -Check) ---
|
||||
elseif ($PSCmdlet.ParameterSetName -eq 'Verify') {
|
||||
$checkFiles = @();
|
||||
@@ -454,7 +463,9 @@ process {
|
||||
|
||||
foreach ($res in $verifyResults) {
|
||||
$currentIndex.Value++;
|
||||
if ($totalFiles -gt 0) {
|
||||
Write-Progress -Activity "Verifying Checksums ($fileAlgo)" -Status "Processing file $($currentIndex.Value) of $totalFiles" -PercentComplete (($currentIndex.Value / $totalFiles) * 100);
|
||||
}
|
||||
|
||||
Write-Host "$($res.DisplayPath): " -NoNewline;
|
||||
if ($res.IsError) {
|
||||
@@ -477,6 +488,9 @@ process {
|
||||
$wantCustomOut = $PSBoundParameters.ContainsKey('OutFile');
|
||||
$wantAutoOut = $Save.IsPresent;
|
||||
|
||||
# Show progress if wildcard used anywhere in inputs or recursive flag set
|
||||
$showProgressGen = $Recursive.IsPresent -or $isWildcardGlobal;
|
||||
|
||||
if ($wantCustomOut -or $wantAutoOut) {
|
||||
# Recursive wildcard auto-saves per directory
|
||||
if ($Recursive -and $isWildcardGlobal) {
|
||||
@@ -499,12 +513,16 @@ process {
|
||||
$parallelResults = Invoke-ParallelHashing -Items $filesInDir -Algorithm $Algorithm;
|
||||
foreach ($res in $parallelResults) {
|
||||
$currentIndex++;
|
||||
if ($showProgressGen -and $totalFiles -gt 0) {
|
||||
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Status "Directory: $(Split-Path $dirPath -Leaf) [$currentIndex/$totalFiles]" -PercentComplete (($currentIndex / $totalFiles) * 100);
|
||||
}
|
||||
|
||||
$linesToWrite += $res.OutputLine;
|
||||
Write-Output $res.OutputLine;
|
||||
}
|
||||
if ($showProgressGen) {
|
||||
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Completed;
|
||||
}
|
||||
|
||||
Set-Content -Path ($currentOutFile) -Value $linesToWrite -Encoding utf8;
|
||||
};
|
||||
@@ -525,12 +543,16 @@ process {
|
||||
$parallelResults = Invoke-ParallelHashing -Items $allItems -Algorithm $Algorithm;
|
||||
foreach ($res in $parallelResults) {
|
||||
$currentIndex++;
|
||||
if ($showProgressGen -and $totalFiles -gt 0) {
|
||||
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Status "Processing file $currentIndex of $totalFiles" -PercentComplete (($currentIndex / $totalFiles) * 100);
|
||||
}
|
||||
|
||||
$linesToWrite += $res.OutputLine;
|
||||
Write-Output $res.OutputLine;
|
||||
}
|
||||
if ($showProgressGen) {
|
||||
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Completed;
|
||||
}
|
||||
|
||||
Set-Content -Path ($singleOutFile) -Value $linesToWrite -Encoding utf8;
|
||||
}
|
||||
@@ -542,12 +564,16 @@ process {
|
||||
$parallelResults = Invoke-ParallelHashing -Items $allItems -Algorithm $Algorithm;
|
||||
foreach ($res in $parallelResults) {
|
||||
$currentIndex++;
|
||||
if ($showProgressGen -and $totalFiles -gt 0) {
|
||||
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Status "Processing file $currentIndex of $totalFiles" -PercentComplete (($currentIndex / $totalFiles) * 100);
|
||||
}
|
||||
|
||||
Write-Output $res.OutputLine;
|
||||
Set-Content -Path ($res.ItemOutFile) -Value $res.OutputLine -Encoding utf8;
|
||||
}
|
||||
if ($showProgressGen) {
|
||||
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Completed;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -559,11 +585,15 @@ process {
|
||||
$parallelResults = Invoke-ParallelHashing -Items $allItems -Algorithm $Algorithm;
|
||||
foreach ($res in $parallelResults) {
|
||||
$currentIndex++;
|
||||
if ($showProgressGen -and $totalFiles -gt 0) {
|
||||
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Status "Processing file $currentIndex of $totalFiles" -PercentComplete (($currentIndex / $totalFiles) * 100);
|
||||
}
|
||||
|
||||
Write-Output $res.OutputLine;
|
||||
}
|
||||
if ($showProgressGen) {
|
||||
Write-Progress -Activity "Computing Checksums ($Algorithm)" -Completed;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user