`misc`: Apply OTBS indentation style to all PS files

- https://en.wikipedia.org/wiki/Indentation_style#Variant:_1TBS_(OTBS)

- The code formatter was doing a custom identation all this time, thanks to VS Code default settings
- No more agony while coding curly braces and brackets 🥳
main
Plínio Larrubia 2 years ago committed by Plínio Larrubia
parent 4bedf82943
commit 00512d4fe2
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69

@ -31,8 +31,7 @@ function Show-GUI() {
If ($ScreenWidth -gt 1024) {
$FormWidth = ($ScreenWidth * 0.85) + $VerticalScrollWidth # Scaled Resolution Width + Scroll Width
$FormHeight = $ScreenHeight * 0.85
}
Else {
} Else {
$FormWidth = ($ScreenWidth * 0.99) + $VerticalScrollWidth # ~ 870.4 + Scroll Width
$FormHeight = $ScreenHeight * 0.85
}
@ -716,8 +715,7 @@ function Show-GUI() {
If ($CbDarkTheme.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("use-dark-theme.reg") -NoDialog
$CbDarkTheme.Text = "[ON] ⚫ Use Dark Theme"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("use-light-theme.reg") -NoDialog
$CbDarkTheme.Text = "[OFF] ☀ Use Dark Theme (D.)"
}
@ -727,8 +725,7 @@ function Show-GUI() {
If ($CbActivityHistory.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-activity-history.reg") -NoDialog
$CbActivityHistory.Text = "[ON] Activity History (Default)"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-activity-history.reg") -NoDialog
$CbActivityHistory.Text = "[OFF] Activity History"
}
@ -738,8 +735,7 @@ function Show-GUI() {
If ($CbBackgroundsApps.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-bg-apps.reg") -NoDialog
$CbBackgroundsApps.Text = "[ON] Background Apps (D.)"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-bg-apps.reg") -NoDialog
$CbBackgroundsApps.Text = "[OFF] Background Apps"
}
@ -749,8 +745,7 @@ function Show-GUI() {
If ($CbClipboardHistory.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-clipboard-history.reg") -NoDialog
$CbClipboardHistory.Text = "[ON] Clipboard History (D.)"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-clipboard-history.reg") -NoDialog
$CbClipboardHistory.Text = "[OFF] Clipboard History"
}
@ -760,8 +755,7 @@ function Show-GUI() {
If ($CbCortana.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-cortana.reg") -NoDialog
$CbCortana.Text = "[ON] Cortana (Default)"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-cortana.reg") -NoDialog
$CbCortana.Text = "[OFF] Cortana"
}
@ -771,8 +765,7 @@ function Show-GUI() {
If ($CbOldVolumeControl.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-old-volume-control.reg") -NoDialog
$CbOldVolumeControl.Text = "[ON] Old Volume Control"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-old-volume-control.reg") -NoDialog
$CbOldVolumeControl.Text = "[OFF] Old Volume Control (D.)"
}
@ -782,8 +775,7 @@ function Show-GUI() {
If ($CbSearchIdx.CheckState -eq "Checked") {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-search-idx-service.ps1") -NoDialog
$CbSearchIdx.Text = "[ON] Search Indexing (Default)"
}
Else {
} Else {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-search-idx-service.ps1") -NoDialog
$CbSearchIdx.Text = "[OFF] Search Indexing"
}
@ -793,8 +785,7 @@ function Show-GUI() {
If ($CbTelemetry.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-telemetry.reg") -NoDialog
$CbTelemetry.Text = "[ON] Telemetry (Default)"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-telemetry.reg") -NoDialog
$CbTelemetry.Text = "[OFF] Telemetry"
}
@ -804,8 +795,7 @@ function Show-GUI() {
If ($CbXboxGameBarAndDVR.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-game-bar-dvr.reg") -NoDialog
$CbXboxGameBarAndDVR.Text = "[ON] Xbox GameBar/DVR (D.)"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-game-bar-dvr.reg") -NoDialog
$CbXboxGameBarAndDVR.Text = "[OFF] Xbox GameBar/DVR"
}
@ -815,8 +805,7 @@ function Show-GUI() {
If ($CbGodMode.CheckState -eq "Checked") {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-god-mode.ps1") -NoDialog
$CbGodMode.Text = "[ON] God Mode"
}
Else {
} Else {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-god-mode.ps1") -NoDialog
$CbGodMode.Text = "[OFF] God Mode (Default)"
}
@ -826,8 +815,7 @@ function Show-GUI() {
If ($CbTakeOwnership.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-take-ownership-context-menu.reg") -NoDialog
$CbTakeOwnership.Text = "[ON] Take Ownership menu"
}
Else {
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-take-ownership-context-menu.reg") -NoDialog
$CbTakeOwnership.Text = "[OFF] Take Ownership... (D.)"
}
@ -837,8 +825,7 @@ function Show-GUI() {
If ($CbShutdownPCShortcut.CheckState -eq "Checked") {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-shutdown-pc-shortcut.ps1") -NoDialog
$CbShutdownPCShortcut.Text = "[ON] Shutdown PC shortcut"
}
Else {
} Else {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-shutdown-pc-shortcut.ps1") -NoDialog
$CbShutdownPCShortcut.Text = "[OFF] Shutdown PC... (Default)"
}
@ -978,8 +965,7 @@ function Show-GUI() {
If ($InstallGitGnupgSshSetup.CheckState -eq "Checked") {
If (!($Script:UninstallSwitch)) {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("git-gnupg-ssh-keys-setup.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage
}
Else {
} Else {
$AppsSelected.WingetApps.AddRange(@("Git.Git", "GnuPG.GnuPG")) # Installed before inside the script
}
$InstallGitGnupgSshSetup.CheckState = "Unchecked"
@ -1204,8 +1190,7 @@ function Show-GUI() {
If ($InstallWSLgOrPreview.CheckState -eq "Checked") {
If (!($Script:UninstallSwitch)) {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("install-wslg-or-preview.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage
}
Else {
} Else {
$AppsSelected.MSStoreApps.Add("9P9TQF7MRM4R")
}
$InstallWSLgOrPreview.CheckState = "Unchecked"
@ -1214,8 +1199,7 @@ function Show-GUI() {
If ($InstallArchWSL.CheckState -eq "Checked") {
If (!($Script:UninstallSwitch)) {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("install-archwsl.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage
}
Else {
} Else {
$AppsSelected.WSLDistros.Add("Arch")
}
$InstallArchWSL.CheckState = "Unchecked"
@ -1502,8 +1486,7 @@ function Show-GUI() {
If ($AppsSelected.WSLDistros) {
Install-Software -Name "Apps from selection" -Packages $AppsSelected.WSLDistros -ViaWSL
}
}
Else {
} Else {
If ($AppsSelected.WingetApps) {
Uninstall-Software -Name "Apps from selection" -Packages $AppsSelected.WingetApps
}
@ -1524,8 +1507,7 @@ function Show-GUI() {
$Script:UninstallSwitch = $false
$InstallSelected.Text = "Install Selected"
$UninstallMode.Text = "[OFF] Uninstall Mode"
}
Else {
} Else {
$Script:UninstallSwitch = $true
$InstallSelected.Text = "Uninstall Selected"
$UninstallMode.Text = "[ON] Uninstall Mode"

@ -52,8 +52,7 @@ function Get-APIFile {
If ($OutputFolder) {
return Request-FileDownload -FileURI $FileURI -OutputFolder $OutputFolder -OutputFile $OutputFile
}
Else {
} Else {
return Request-FileDownload -FileURI $FileURI -OutputFile $OutputFile
}
}

@ -54,17 +54,13 @@ function Get-OSArchitecture() {
If ($Architecture -like "*64*bit*") {
$Architecture = @("x64")
}
ElseIf ($Architecture -like "*32*bit*") {
} ElseIf ($Architecture -like "*32*bit*") {
$Architecture = @("x86")
}
ElseIf (($Architecture -like "*ARM") -and ($Architecture -like "*64")) {
} ElseIf (($Architecture -like "*ARM") -and ($Architecture -like "*64")) {
$Architecture = @("arm64")
}
ElseIf ($Architecture -like "*ARM") {
} ElseIf ($Architecture -like "*ARM") {
$Architecture = @("arm")
}
Else {
} Else {
Write-Host "[?] Couldn't identify the System Architecture '$Architecture'. :/" -ForegroundColor Yellow -BackgroundColor Black
$Architecture = $null
}

@ -25,8 +25,7 @@ function Install-Font() {
# Update Registry and copy Font to Font directory
$RegName = $ShellFolder.GetDetailsOf($ShellFile, 21) + ' ' + $FontType
}
Catch {
} Catch {
# This may not be the better way, but this workaround worked
Write-Status -Symbol "@" -Status "Got an error, the font type is OpenType" -Warning
$FontType = '(OpenType)'

@ -46,8 +46,7 @@ function Install-Software() {
$PackageName = (winget search --source 'msstore' --exact $Package)[-1].Replace("$Package Unknown", '').Trim(' ')
$DoneMessage += " + $PackageName ($Package)`n"
$Private:Counter = Write-TitleCounter -Text "$Package - $PackageName" -Counter $Counter -MaxLength $Packages.Length
}
Else {
} Else {
$Private:Counter = Write-TitleCounter -Text "$Package" -Counter $Counter -MaxLength $Packages.Length
$DoneMessage += " + $Package`n"
}
@ -106,8 +105,7 @@ function Uninstall-Software() {
$PackageName = (winget search --source 'msstore' --exact $Package)[-1].Replace("$Package Unknown", '').Trim(' ')
$DoneMessage += " - $PackageName ($Package)`n"
$Private:Counter = Write-TitleCounter -Text "$Package - $PackageName" -Counter $Counter -MaxLength $Packages.Length
}
Else {
} Else {
$Private:Counter = Write-TitleCounter -Text "$Package" -Counter $Counter -MaxLength $Packages.Length
$DoneMessage += " - $Package`n"
}

@ -29,8 +29,7 @@ function New-Shortcut() {
If ($Hotkey) {
$Shortcut.Description = "$Description ($Hotkey)"
}
Else {
} Else {
$Shortcut.Description = $Description
}

@ -21,8 +21,7 @@ function Open-PowerShellFilesCollection {
$Private:Counter = Write-TitleCounter -Text "$FileName ( $LastAccessUtc )" -Counter $Counter -MaxLength $Scripts.Length
If ($OpenFromGUI) {
Import-Module -DisableNameChecking .\"$FileName" -Force
}
Else {
} Else {
PowerShell -NoProfile -ExecutionPolicy Bypass -File .\"$FileName"
}
}

@ -12,8 +12,7 @@ function Remove-UWPAppx() {
Write-Status -Symbol "-" -Type $TweakType -Status "Trying to remove $AppxPackage from ALL users ..."
Get-AppxPackage -AllUsers -Name $AppxPackage | Remove-AppxPackage # App
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $AppxPackage | Remove-AppxProvisionedPackage -Online -AllUsers # Payload
}
Else {
} Else {
Write-Status -Symbol "?" -Type $TweakType -Status "$AppxPackage was already removed or not found ..." -Warning
}
}

@ -17,8 +17,7 @@ function Select-Folder() {
If ($Response -eq "OK") {
$Folder += $FolderName.SelectedPath
Write-Host "Folder Selected: $Folder"
}
ElseIf ($Response -eq "Cancel") {
} ElseIf ($Response -eq "Cancel") {
Write-Host "Aborting..."
}

@ -10,8 +10,7 @@ function Find-ScheduledTask() {
If (Get-ScheduledTaskInfo -TaskName $ScheduledTask -ErrorAction SilentlyContinue) {
return $true
}
Else {
} Else {
Write-Status -Symbol "?" -Type $TweakType -Status "The $ScheduledTask task was not found." -Warning
return $false
}
@ -44,22 +43,18 @@ function Set-ScheduledTaskState() {
If (!$CustomMessage) {
If ($Disabled) {
Write-Status -Symbol "-" -Type $TweakType -Status "Disabling the $ScheduledTask task ..."
}
ElseIf ($Ready) {
} ElseIf ($Ready) {
Write-Status -Symbol "+" -Type $TweakType -Status "Enabling the $ScheduledTask task ..."
}
Else {
} Else {
Write-Status -Symbol "?" -Type $TweakType -Status "No parameter received (valid params: -Disabled or -Ready)" -Warning
}
}
Else {
} Else {
Write-Status -Symbol "@" -Type $TweakType -Status $(Invoke-Expression "$CustomMessage")
}
If ($Disabled) {
Get-ScheduledTask -TaskName (Split-Path -Path $ScheduledTask -Leaf) | Where-Object State -Like "R*" | Disable-ScheduledTask # R* = Ready/Running
}
ElseIf ($Ready) {
} ElseIf ($Ready) {
Get-ScheduledTask -TaskName (Split-Path -Path $ScheduledTask -Leaf) | Where-Object State -Like "Disabled" | Enable-ScheduledTask
}
}

@ -10,8 +10,7 @@ function Find-Service() {
If (Get-Service $Service -ErrorAction SilentlyContinue) {
return $true
}
Else {
} Else {
Write-Status -Symbol "?" -Type $TweakType -Status "The $Service service was not found ..." -Warning
return $false
}
@ -52,28 +51,22 @@ function Set-ServiceStartup() {
If (!$CustomMessage) {
If ($Automatic) {
Write-Status -Symbol "+" -Type $TweakType -Status "Setting $Service ($((Get-Service $Service).DisplayName)) as 'Automatic' on Startup ..."
}
ElseIf ($Disabled) {
} ElseIf ($Disabled) {
Write-Status -Symbol "-" -Type $TweakType -Status "Setting $Service ($((Get-Service $Service).DisplayName)) as 'Disabled' on Startup ..."
}
ElseIf ($Manual) {
} ElseIf ($Manual) {
Write-Status -Symbol "-" -Type $TweakType -Status "Setting $Service ($((Get-Service $Service).DisplayName)) as 'Manual' on Startup ..."
}
Else {
} Else {
Write-Status -Symbol "?" -Type $TweakType -Status "No parameter received (valid params: -Automatic, -Disabled or -Manual)" -Warning
}
}
Else {
} Else {
Write-Status -Symbol "@" -Type $TweakType -Status $(Invoke-Expression "$CustomMessage")
}
If ($Automatic) {
Get-Service -Name "$Service" -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic
}
ElseIf ($Disabled) {
} ElseIf ($Disabled) {
Get-Service -Name "$Service" -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
}
ElseIf ($Manual) {
} ElseIf ($Manual) {
Get-Service -Name "$Service" -ErrorAction SilentlyContinue | Set-Service -StartupType Manual
}
}

@ -10,8 +10,7 @@ function Find-OptionalFeature() {
If (Get-WindowsOptionalFeature -Online -FeatureName $OptionalFeature) {
return $true
}
Else {
} Else {
Write-Status -Symbol "?" -Type $TweakType -Status "The $OptionalFeature optional feature was not found." -Warning
return $false
}
@ -50,22 +49,18 @@ function Set-OptionalFeatureState() {
If (!$CustomMessage) {
If ($Disabled) {
Write-Status -Symbol "-" -Type $TweakType -Status "Uninstalling the $OptionalFeature optional feature ..."
}
ElseIf ($Enabled) {
} ElseIf ($Enabled) {
Write-Status -Symbol "+" -Type $TweakType -Status "Installing the $OptionalFeature optional feature ..."
}
Else {
} Else {
Write-Status -Symbol "?" -Type $TweakType -Status "No parameter received (valid params: -Disabled or -Enabled)" -Warning
}
}
Else {
} Else {
Write-Status -Symbol "@" -Type $TweakType -Status $(Invoke-Expression "$CustomMessage")
}
If ($Disabled) {
Get-WindowsOptionalFeature -Online -FeatureName $OptionalFeature | Where-Object State -Like "Enabled" | Disable-WindowsOptionalFeature -Online -NoRestart
}
ElseIf ($Enabled) {
} ElseIf ($Enabled) {
Get-WindowsOptionalFeature -Online -FeatureName $OptionalFeature | Where-Object State -Like "Disabled*" | Enable-WindowsOptionalFeature -Online -NoRestart
}
}

@ -50,8 +50,7 @@ function Write-Status() {
}
If ($Warning) {
Write-Host "$Status" -ForegroundColor Yellow -BackgroundColor Black
}
Else {
} Else {
Write-Host "$Status" -ForegroundColor Green -BackgroundColor Black
}
}

@ -24,8 +24,7 @@ function Install-PackageManager() {
$err = (Invoke-Expression "$CheckExistenceBlock")
if (($LASTEXITCODE)) { throw $err } # 0 = False, 1 = True
Write-Status -Symbol "?" -Status "$PackageManagerFullName is already installed." -Warning
}
Catch {
} Catch {
Write-Status -Symbol "?" -Status "$PackageManagerFullName was not found." -Warning
Write-Status -Symbol "+" -Status "Downloading and Installing $PackageManagerFullName package manager."
@ -55,8 +54,7 @@ function Install-PackageManager() {
Write-Host " { $("$UpdateScriptBlock".Trim(' ')) }`n" -ForegroundColor Cyan
Unregister-ScheduledJob -Name $JobName
Register-ScheduledJob @ScheduledJob | Out-Null
}
Else {
} Else {
Write-Status -Symbol "@" -Status "Creating Scheduled Job with the command:"
Write-Host " { $("$UpdateScriptBlock".Trim(' ')) }`n" -ForegroundColor Cyan
Register-ScheduledJob @ScheduledJob | Out-Null
@ -73,8 +71,7 @@ function Install-WingetDependency() {
$WingetDepOutput = Request-FileDownload -FileURI "https://aka.ms/Microsoft.VCLibs.$OSArch.14.00.Desktop.appx" -OutputFile "Microsoft.VCLibs.14.00.Desktop.appx"
Add-AppxPackage -Path $WingetDepOutput
Remove-Item -Path $WingetDepOutput
}
Else {
} Else {
Write-Status -Symbol "?" -Status "$OSArch is not supported!" -Warning
}
}

@ -110,13 +110,11 @@ function Optimize-Performance() {
Try {
If (($PowerPlanName -notin $UniquePowerPlans.Keys) -and ($PowerPlanGUID -notin $UniquePowerPlans.Values)) {
$UniquePowerPlans.Add($PowerPlanName, $PowerPlanGUID)
}
Else {
} Else {
Write-Status -Symbol "-" -Type $TweakType -Status "Duplicated '$PowerPlanName' power plan found, deleting $PowerPlanGUID ..."
powercfg -Delete $PowerPlanGUID
}
}
Catch {
} Catch {
Write-Status -Symbol "-" -Type $TweakType -Status "Duplicated '$PowerPlanName' power plan found, deleting $PowerPlanGUID ..."
powercfg -Delete $PowerPlanGUID
}
@ -148,8 +146,7 @@ function Optimize-Performance() {
function Main() {
If (!$Revert) {
Optimize-Performance # Change from stock configurations that slowdowns the system to improve performance
}
Else {
} Else {
Optimize-Performance -Revert
}
}

@ -347,8 +347,7 @@ function Optimize-Privacy() {
function Main() {
If (!$Revert) {
Optimize-Privacy # Disable Registries that causes slowdowns and privacy invasion
}
Else {
} Else {
Optimize-Privacy -Revert
}
}

@ -95,8 +95,7 @@ function Optimize-ServicesRunning() {
Write-Status -Symbol "<" -Type "Service" -Status "Reverting the tweaks is set to '$Revert'." -Warning
$CustomMessage = { "Resetting $Service ($((Get-Service $Service).DisplayName)) as 'Manual' on Startup ..." }
Set-ServiceStartup -Manual -Services $ServicesToDisabled -Filter $EnableServicesOnSSD -CustomMessage $CustomMessage
}
Else {
} Else {
Set-ServiceStartup -Disabled -Services $ServicesToDisabled -Filter $EnableServicesOnSSD
}
@ -116,8 +115,7 @@ function Main() {
If (!$Revert) {
Optimize-ServicesRunning # Enable essential Services and Disable bloating Services
}
Else {
} Else {
Optimize-ServicesRunning -Revert
}
}

@ -54,8 +54,7 @@ function Optimize-TaskScheduler() {
Write-Status -Symbol "<" -Type "TaskScheduler" -Status "Reverting the tweaks is set to '$Revert'." -Warning
$CustomMessage = { "Resetting the $ScheduledTask task as 'Ready' ..." }
Set-ScheduledTaskState -Ready -ScheduledTask $DisableScheduledTasks -CustomMessage $CustomMessage
}
Else {
} Else {
Set-ScheduledTaskState -Disabled -ScheduledTask $DisableScheduledTasks
}
@ -69,8 +68,7 @@ function Main() {
If (!$Revert) {
Optimize-TaskScheduler # Disable Scheduled Tasks that causes slowdowns
}
Else {
} Else {
Optimize-TaskScheduler -Revert
}
}

@ -35,8 +35,7 @@ function Optimize-WindowsFeaturesList() {
Write-Status -Symbol "<" -Type "OptionalFeature" -Status "Reverting the tweaks is set to '$Revert'." -Warning
$CustomMessage = { "Re-Installing the $OptionalFeature optional feature ..." }
Set-OptionalFeatureState -Enabled -OptionalFeatures $DisableFeatures -CustomMessage $CustomMessage
}
Else {
} Else {
Set-OptionalFeatureState -Disabled -OptionalFeatures $DisableFeatures
}
@ -56,8 +55,7 @@ function Main() {
If (!$Revert) {
Optimize-WindowsFeaturesList # Disable useless features and Enable features claimed as Optional on Windows, but actually, they are useful
}
Else {
} Else {
Optimize-WindowsFeaturesList -Revert
}
}

@ -247,8 +247,7 @@ function Register-PersonalTweaksList() {
function Main() {
If (!$Revert) {
Register-PersonalTweaksList # Personal UI, Network, Energy and Accessibility Optimizations
}
Else {
} Else {
Register-PersonalTweaksList -Revert
}
}

@ -7,15 +7,13 @@ function Main() {
If ([string]::IsNullOrEmpty($PackageFilter)) {
Write-Warning "No filter specified, attempting to re-register all provisioned apps."
}
Else {
} Else {
$Packages = $Packages | Where-Object { $_.Name -like $PackageFilter }
If ($null -eq $Packages) {
Write-Warning "No provisioned apps match the specified filter."
exit
}
Else {
} Else {
Write-Host "Registering the provisioned apps that match $PackageFilter ..."
}
}

@ -29,8 +29,7 @@ function Initialize-GitUser() {
git config --global "$GIT_PROPERTY_NAME.$GIT_NAME_PROPERTY" "$GIT_PROPERTY_VALUE"
Write-Host "GIT: Your $GIT_PROPERTY_NAME.$GIT_NAME_PROPERTY on git is: $(git config --global "$GIT_PROPERTY_NAME.$GIT_NAME_PROPERTY")`n" -ForegroundColor Cyan
}
Else {
} Else {
Write-Warning "Your $GIT_PROPERTY_NAME.$GIT_NAME_PROPERTY already exists: $(git config --global "$GIT_PROPERTY_NAME.$GIT_NAME_PROPERTY")`nSkipping..."
}
}
@ -182,8 +181,7 @@ function Set-GPGKey() {
Write-Host "Copy and Paste the lines below on your`nGithub/Gitlab > Settings > SSH and GPG Keys > New GPG Key"
Get-Content "$GnuPGPath/$($GnuPGFileName)_public.gpg"
}
Else {
} Else {
Write-Host "Failed to retrieve your key_id: $key_id"
}

@ -19,8 +19,7 @@ function ArchWSLInstall() {
Write-Status -Symbol "@" -Status "Removing downloaded files ..."
Remove-Item -Path $CertOutput
Remove-Item -Path $ArchWSLOutput
}
Else {
} Else {
Write-Status -Symbol "?" -Status "$OSArch is NOT supported!" -Warning
Break
}

@ -26,8 +26,7 @@ function Install-WSLPreview() {
Write-Status -Symbol "-" -Type $TweakType -Status "Uninstalling WSL from Optional Features ..."
Get-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" | Where-Object State -Like "Enabled" | Disable-WindowsOptionalFeature -Online -NoRestart
}
Catch {
} Catch {
Write-Status -Symbol "?" -Type $TweakType -Status "Couldn't install WSL Preview, you must be at least on Windows 11 ..." -Warning
Install-WSLTwoAndG
}
@ -64,8 +63,7 @@ function Install-WSLTwoAndG() {
Write-Status -Symbol "+" -Type $TweakType -Status "Installing WSL Graphics update (Insider only) ($OSArch)..."
Start-Process -FilePath $WSLgOutput -ArgumentList "/passive" -Wait
Remove-Item -Path $WSLgOutput
}
Else {
} Else {
Write-Status -Symbol "?" -Type $TweakType -Status "$OSArch is NOT supported!" -Warning
Break
}

Loading…
Cancel
Save