Clean up / Linting

This commit is contained in:
Raphire
2025-05-04 23:33:20 +02:00
parent d294eb6b7a
commit 94d67c3f54

View File

@@ -737,10 +737,9 @@ function GetUserName {
if ($global:Params.ContainsKey("User")) {
return $global:Params.Item("User")
}
else {
return $env:USERNAME
}
}
function CreateSystemRestorePoint {
@@ -756,7 +755,6 @@ function CreateSystemRestorePoint {
}
if ($recentRestorePoints.Count -eq 0) {
try {
Checkpoint-Computer -Description "Restore point created by Win11Debloat" -RestorePointType "MODIFY_SETTINGS"
Write-Output "System restore point created successfully"
@@ -1408,15 +1406,15 @@ else {
PrintHeader 'Custom Mode'
}
# If the number of keys in SPParams equals the number of keys in Params then no modifications/changes were selected
# or added by the user, and the script can exit without making any changes.
if ($SPParamCount -eq $global:Params.Keys.Count) {
Write-Output "The script completed without making any changes."
AwaitKeyToExit
Exit
}
else {
# Execute all selected/provided parameters
switch ($global:Params.Keys) {
'CreateRestorePoint' {
@@ -1652,4 +1650,3 @@ else {
Write-Output "Script completed! Please check above for any errors."
AwaitKeyToExit
}