Added comments to make the script more readable

This commit is contained in:
Jeffrey
2022-04-09 18:52:16 +02:00
committed by Raphire
parent f9f7f584a7
commit 05e51035af
3 changed files with 15 additions and 4 deletions

View File

@@ -15,6 +15,7 @@ param
[Parameter(ValueFromPipeline=$true)][switch]$DisableShare
)
# Removes all apps in the list
function RemoveApps
{
Write-Output "> Removing pre-installed windows 10 apps..."
@@ -84,6 +85,7 @@ function RemoveApps
}
}
# Import & execute regfile
function RegImport
{
param
@@ -96,6 +98,7 @@ function RegImport
reg import $path
}
# Change mode based on provided parameters or user input
if((-NOT $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (($PSBoundParameters.Count -eq 1) -and ($PSBoundParameters.ContainsKey('WhatIf') -or $PSBoundParameters.ContainsKey('Confirm') -or $PSBoundParameters.ContainsKey('Verbose'))))
{
if($RunDefaults)
@@ -121,6 +124,7 @@ if((-NOT $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or ((
while ($Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3')
}
# Add execution parameters based on the mode
switch($Mode)
{
'1'
@@ -218,6 +222,7 @@ else
Write-Output "-------------------------------------------------------------------------------------------"
}
# Execute all selected/provided parameters
switch ($PSBoundParameters.Keys)
{
'RemoveApps'
@@ -266,4 +271,4 @@ Write-Output ""
Write-Output "Script completed! Please restart your PC to make sure all changes are properly applied."
Write-Output ""
Write-Output "Press any key to continue..."
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")