Clean up / Linting

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

View File

@@ -737,9 +737,8 @@ function GetUserName {
if ($global:Params.ContainsKey("User")) {
return $global:Params.Item("User")
}
else {
return $env:USERNAME
}
}
@@ -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,17 +1406,17 @@ 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) {
# Execute all selected/provided parameters
switch ($global:Params.Keys) {
'CreateRestorePoint' {
CreateSystemRestorePoint
continue
@@ -1642,14 +1640,13 @@ else {
RegImport "> Hiding 'Share' in the context menu..." "Disable_Share_from_context_menu.reg"
continue
}
}
RestartExplorer
Write-Output ""
Write-Output ""
Write-Output ""
Write-Output "Script completed! Please check above for any errors."
AwaitKeyToExit
}
RestartExplorer
Write-Output ""
Write-Output ""
Write-Output ""
Write-Output "Script completed! Please check above for any errors."
AwaitKeyToExit