mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 11:06:18 +00:00
Clean up / Linting
This commit is contained in:
@@ -287,7 +287,7 @@ Download & run the script automatically via PowerShell. All files related to the
|
|||||||
```
|
```
|
||||||
|
|
||||||
3. Wait for the script to automatically download Win11Debloat.
|
3. Wait for the script to automatically download Win11Debloat.
|
||||||
4. A new PowerShell window will open showing the Win11Debloat menu. Select either the default or custom mode to continue.
|
4. A new PowerShell window will open showing the Win11Debloat menu, select any option to continue.
|
||||||
5. Carefully read through and follow the on-screen instructions.
|
5. Carefully read through and follow the on-screen instructions.
|
||||||
|
|
||||||
This method supports [parameters](#parameters). To use parameters simply run the script as explained above, but add the parameters at the end with spaces in between. Example:
|
This method supports [parameters](#parameters). To use parameters simply run the script as explained above, but add the parameters at the end with spaces in between. Example:
|
||||||
@@ -304,7 +304,7 @@ Manually download & run the script.
|
|||||||
2. Navigate to the Win11Debloat folder
|
2. Navigate to the Win11Debloat folder
|
||||||
3. Double click the `Run.bat` file to start the script. NOTE: If the console window immediately closes and nothing happens, try the advanced method below.
|
3. Double click the `Run.bat` file to start the script. NOTE: If the console window immediately closes and nothing happens, try the advanced method below.
|
||||||
4. Accept the Windows UAC prompt to run the script as administrator, this is required for the script to function.
|
4. Accept the Windows UAC prompt to run the script as administrator, this is required for the script to function.
|
||||||
5. A new PowerShell window will now open showing the Win11Debloat menu. Select either the default or custom mode to continue.
|
4. A new PowerShell window will open showing the Win11Debloat menu, select any option to continue.
|
||||||
6. Carefully read through and follow the on-screen instructions.
|
6. Carefully read through and follow the on-screen instructions.
|
||||||
|
|
||||||
### Advanced method
|
### Advanced method
|
||||||
@@ -326,7 +326,7 @@ Set-ExecutionPolicy Unrestricted -Scope Process
|
|||||||
.\Win11Debloat.ps1
|
.\Win11Debloat.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
6. The Win11Debloat menu will now open. Select either the default or custom mode to continue.
|
6. The Win11Debloat menu will now open, select any option to continue.
|
||||||
7. Carefully read through and follow the on-screen instructions.
|
7. Carefully read through and follow the on-screen instructions.
|
||||||
|
|
||||||
This method supports [parameters](#parameters). To use parameters simply run the script as explained above, but add the parameters at the end with spaces in between. Example:
|
This method supports [parameters](#parameters). To use parameters simply run the script as explained above, but add the parameters at the end with spaces in between. Example:
|
||||||
|
|||||||
@@ -1302,9 +1302,8 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or $RunS
|
|||||||
|
|
||||||
$Mode = Read-Host $ModeSelectionMessage
|
$Mode = Read-Host $ModeSelectionMessage
|
||||||
|
|
||||||
# Show information based on user input, Suppress user prompt if Silent parameter was passed
|
|
||||||
if ($Mode -eq '0') {
|
if ($Mode -eq '0') {
|
||||||
# Get & print script information from file
|
# Print information screen from file
|
||||||
PrintFromFile "$PSScriptRoot/Assets/Menus/Info" "Information"
|
PrintFromFile "$PSScriptRoot/Assets/Menus/Info" "Information"
|
||||||
|
|
||||||
Write-Output "Press any key to go back..."
|
Write-Output "Press any key to go back..."
|
||||||
@@ -1321,7 +1320,7 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or $RunS
|
|||||||
switch ($Mode) {
|
switch ($Mode) {
|
||||||
# Default mode, loads defaults after confirmation
|
# Default mode, loads defaults after confirmation
|
||||||
'1' {
|
'1' {
|
||||||
# Print the default settings & require userconfirmation, unless Silent parameter was passed
|
# Show the default settings with confirmation, unless Silent parameter was passed
|
||||||
if (-not $Silent) {
|
if (-not $Silent) {
|
||||||
PrintFromFile "$PSScriptRoot/Assets/Menus/DefaultSettings" "Default Mode"
|
PrintFromFile "$PSScriptRoot/Assets/Menus/DefaultSettings" "Default Mode"
|
||||||
|
|
||||||
@@ -1333,7 +1332,7 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or $RunS
|
|||||||
|
|
||||||
PrintHeader 'Default Mode'
|
PrintHeader 'Default Mode'
|
||||||
|
|
||||||
# Add default parameters if they don't already exist
|
# Add default parameters, if they don't already exist
|
||||||
foreach ($ParameterName in $DefaultParameterNames) {
|
foreach ($ParameterName in $DefaultParameterNames) {
|
||||||
if (-not $script:Params.ContainsKey($ParameterName)) {
|
if (-not $script:Params.ContainsKey($ParameterName)) {
|
||||||
$script:Params.Add($ParameterName, $true)
|
$script:Params.Add($ParameterName, $true)
|
||||||
@@ -1376,12 +1375,12 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunWin11Defaults -or $RunS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load custom options selection from the "SavedSettings" file
|
# Load custom options from the "SavedSettings" file
|
||||||
'4' {
|
'4' {
|
||||||
PrintHeader 'Custom Mode'
|
PrintHeader 'Custom Mode'
|
||||||
Write-Output "Win11Debloat will make the following changes:"
|
Write-Output "Win11Debloat will make the following changes:"
|
||||||
|
|
||||||
# Get & print default settings info from file
|
# Print the saved settings info from file
|
||||||
Foreach ($line in (Get-Content -Path "$PSScriptRoot/SavedSettings" )) {
|
Foreach ($line in (Get-Content -Path "$PSScriptRoot/SavedSettings" )) {
|
||||||
# Remove any spaces before and after the line
|
# Remove any spaces before and after the line
|
||||||
$line = $line.Trim()
|
$line = $line.Trim()
|
||||||
|
|||||||
Reference in New Issue
Block a user