From 5175cae36a2cd2a494d35dcb5007037ae42cb871 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Tue, 3 Oct 2023 15:19:03 -0500 Subject: [PATCH] Populate PlaceHolder comments in functions Files I found that has issues: Get-WinUtilRegistry.ps1 Install-WinUtilWinget.ps1 Invoke-WinUtilDarkMode.ps1 Remove-WinUtilAPPX.ps1 Test-WinUtilPackageManager.ps1 Update-WinUtilProgramWinget.ps1 Invoke-WPFUpdatessecurity.ps1 --- functions/private/Get-WinUtilCheckBoxes.ps1 | 14 ++++++++--- .../private/Get-WinUtilInstallerProcess.ps1 | 14 ++++++++--- functions/private/Get-WinUtilRegistry.ps1 | 8 +++--- functions/private/Get-WinUtilToggleStatus.ps1 | 15 ++++++----- functions/private/Get-WinUtilVariables.ps1 | 11 +++++--- functions/private/Install-WinUtilChoco.ps1 | 8 +++--- .../private/Install-WinUtilProgramWinget.ps1 | 17 +++++++++---- functions/private/Install-WinUtilWinget.ps1 | 10 ++++---- .../private/Invoke-WinUtilBingSearch.ps1 | 9 ++++--- .../private/Invoke-WinUtilCurrentSystem.ps1 | 7 +++--- functions/private/Invoke-WinUtilDarkMode.ps1 | 9 ++++--- .../private/Invoke-WinUtilFeatureInstall.ps1 | 6 ++--- functions/private/Invoke-WinUtilScript.ps1 | 15 +++++++---- functions/private/Invoke-WinUtilTweaks.ps1 | 14 ++++++++--- functions/private/Remove-WinUtilAPPX.ps1 | 10 +++++--- functions/private/Set-WinUtilDNS.ps1 | 10 +++++--- functions/private/Set-WinUtilRegistry.ps1 | 21 ++++++++++++---- functions/private/Set-WinUtilRestorePoint.ps1 | 6 ++--- .../private/Set-WinUtilScheduledTask.ps1 | 13 +++++++--- functions/private/Set-WinUtilService.ps1 | 17 ++++++++----- functions/private/Set-WinUtilUiTheme.ps1 | 13 +++++++--- .../private/Test-WinUtilPackageManager.ps1 | 14 ++++++++--- .../private/Update-WinUtilProgramWinget.ps1 | 8 +++--- functions/public/Invoke-WPFButton.ps1 | 13 +++++----- functions/public/Invoke-WPFControlPanel.ps1 | 11 +++++--- functions/public/Invoke-WPFFeatureInstall.ps1 | 8 +++--- functions/public/Invoke-WPFFixesNetwork.ps1 | 8 +++--- functions/public/Invoke-WPFFixesUpdate.ps1 | 8 +++--- functions/public/Invoke-WPFFormVariables.ps1 | 8 +++--- functions/public/Invoke-WPFGetInstalled.ps1 | 7 ++++-- functions/public/Invoke-WPFImpex.ps1 | 15 +++++++---- functions/public/Invoke-WPFInstall.ps1 | 8 +++--- functions/public/Invoke-WPFInstallUpgrade.ps1 | 8 +++--- functions/public/Invoke-WPFPanelAutologin.ps1 | 8 +++--- functions/public/Invoke-WPFPanelDISM.ps1 | 25 ++++++++++++++++--- functions/public/Invoke-WPFPresets.ps1 | 13 ++++++++-- functions/public/Invoke-WPFRunspace.ps1 | 23 +++++++++-------- functions/public/Invoke-WPFShortcut.ps1 | 7 ++++-- functions/public/Invoke-WPFTab.ps1 | 11 +++++--- functions/public/Invoke-WPFToggle.ps1 | 13 +++++----- .../public/Invoke-WPFUltimatePerformance.ps1 | 11 +++++--- functions/public/Invoke-WPFUnInstall.ps1 | 8 +++--- functions/public/Invoke-WPFUpdatesdefault.ps1 | 8 +++--- functions/public/Invoke-WPFUpdatesdisable.ps1 | 11 +++++--- .../public/Invoke-WPFUpdatessecurity.ps1 | 15 ++++++++--- functions/public/Invoke-WPFtweaksbutton.ps1 | 8 +++--- functions/public/Invoke-WPFundoall.ps1 | 8 +++--- 47 files changed, 334 insertions(+), 198 deletions(-) diff --git a/functions/private/Get-WinUtilCheckBoxes.ps1 b/functions/private/Get-WinUtilCheckBoxes.ps1 index a572df04f5..1df0c84c96 100644 --- a/functions/private/Get-WinUtilCheckBoxes.ps1 +++ b/functions/private/Get-WinUtilCheckBoxes.ps1 @@ -2,13 +2,19 @@ Function Get-WinUtilCheckBoxes { <# - .DESCRIPTION - Function is meant to find all checkboxes that are checked on the specific tab and input them into a script. + .SYNOPSIS + Finds all checkboxes that are checked on the specific tab and inputs them into a script. - Outputed data will be the names of the checkboxes that were checked + .PARAMETER Group + The group of checkboxes to check - .EXAMPLE + .PARAMETER unCheck + Whether to uncheck the checkboxes that are checked. Defaults to true + .OUTPUTS + A List containing the name of each checked checkbox + + .EXAMPLE Get-WinUtilCheckBoxes "WPFInstall" #> diff --git a/functions/private/Get-WinUtilInstallerProcess.ps1 b/functions/private/Get-WinUtilInstallerProcess.ps1 index 0749576814..eae2647653 100644 --- a/functions/private/Get-WinUtilInstallerProcess.ps1 +++ b/functions/private/Get-WinUtilInstallerProcess.ps1 @@ -1,9 +1,15 @@ function Get-WinUtilInstallerProcess { <# - - .DESCRIPTION - Meant to check for running processes, will return a boolean response - + + .SYNOPSIS + Checks if the given process is running + + .PARAMETER Process + The process to check + + .OUTPUTS + Boolean - True if the process is running + #> param($Process) diff --git a/functions/private/Get-WinUtilRegistry.ps1 b/functions/private/Get-WinUtilRegistry.ps1 index 28240747ff..9a39795cd3 100644 --- a/functions/private/Get-WinUtilRegistry.ps1 +++ b/functions/private/Get-WinUtilRegistry.ps1 @@ -1,12 +1,12 @@ function Get-WinUtilRegistry { <# - - .DESCRIPTION + + .SYNOPSIS Gets the value of a registry key - .EXAMPLE + .EXAMPLE Get-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0" - + #> param ( $Name, diff --git a/functions/private/Get-WinUtilToggleStatus.ps1 b/functions/private/Get-WinUtilToggleStatus.ps1 index 15027569cd..b0386904c3 100644 --- a/functions/private/Get-WinUtilToggleStatus.ps1 +++ b/functions/private/Get-WinUtilToggleStatus.ps1 @@ -1,12 +1,15 @@ Function Get-WinUtilToggleStatus { <# - - .DESCRIPTION - Pulls the registry keys for a toggle switch and returns true or false - True should mean status is enabled - False should mean status is disabled - + .SYNOPSIS + Pulls the registry keys for the given toggle switch and checks whether the toggle should be checked or unchecked + + .PARAMETER ToggleSwitch + The name of the toggle to check + + .OUTPUTS + Boolean to set the toggle's status to + #> Param($ToggleSwitch) diff --git a/functions/private/Get-WinUtilVariables.ps1 b/functions/private/Get-WinUtilVariables.ps1 index 32e536e4a0..d612e57c34 100644 --- a/functions/private/Get-WinUtilVariables.ps1 +++ b/functions/private/Get-WinUtilVariables.ps1 @@ -1,10 +1,13 @@ function Get-WinUtilVariables { <# - - .DESCRIPTION - placeholder - + + .SYNOPSIS + Gets every form object of the provided type + + .OUTPUTS + List containing every object that matches the provided type + #> param ( [Parameter()] diff --git a/functions/private/Install-WinUtilChoco.ps1 b/functions/private/Install-WinUtilChoco.ps1 index 0a246f8d30..e0890489db 100644 --- a/functions/private/Install-WinUtilChoco.ps1 +++ b/functions/private/Install-WinUtilChoco.ps1 @@ -1,10 +1,10 @@ function Install-WinUtilChoco { <# - - .DESCRIPTION - Installs Chocolatey if it is not installed - + + .SYNOPSIS + Installs Chocolatey if it is not already installed + #> try{ diff --git a/functions/private/Install-WinUtilProgramWinget.ps1 b/functions/private/Install-WinUtilProgramWinget.ps1 index 13b2afdeb7..16776c4299 100644 --- a/functions/private/Install-WinUtilProgramWinget.ps1 +++ b/functions/private/Install-WinUtilProgramWinget.ps1 @@ -1,12 +1,19 @@ Function Install-WinUtilProgramWinget { <# - - .DESCRIPTION - This will install programs via Winget using a new powershell.exe instance to prevent the GUI from locking up. - Note the triple quotes are required any time you need a " in a normal script block. - + .SYNOPSIS + Manages the provided programs using Winget + + .PARAMETER ProgramsToInstall + A list of programs to manage + + .PARAMETER manage + The action to perform on the programs, can be either 'Installing' or 'Uninstalling' + + .NOTES + The triple quotes are required any time you need a " in a normal script block. + #> param( diff --git a/functions/private/Install-WinUtilWinget.ps1 b/functions/private/Install-WinUtilWinget.ps1 index 09bff00d68..b04e6d9441 100644 --- a/functions/private/Install-WinUtilWinget.ps1 +++ b/functions/private/Install-WinUtilWinget.ps1 @@ -8,12 +8,12 @@ function Get-LatestHash { } function Install-WinUtilWinget { - + <# - - .DESCRIPTION - Function is meant to ensure winget is installed - + + .SYNOPSIS + Installs Winget if it is not already installed + #> Try{ Write-Host "Checking if Winget is Installed..." diff --git a/functions/private/Invoke-WinUtilBingSearch.ps1 b/functions/private/Invoke-WinUtilBingSearch.ps1 index bd3cdf522a..21574b6838 100644 --- a/functions/private/Invoke-WinUtilBingSearch.ps1 +++ b/functions/private/Invoke-WinUtilBingSearch.ps1 @@ -1,9 +1,12 @@ function Invoke-WinUtilBingSearch { <# - - .DESCRIPTION + + .SYNOPSIS Disables/Enables Bing Search - + + .PARAMETER Enabled + Indicates whether to enable or disable Bing Search + #> Param($Enabled) Try{ diff --git a/functions/private/Invoke-WinUtilCurrentSystem.ps1 b/functions/private/Invoke-WinUtilCurrentSystem.ps1 index 23a6d2d444..eda05c3756 100644 --- a/functions/private/Invoke-WinUtilCurrentSystem.ps1 +++ b/functions/private/Invoke-WinUtilCurrentSystem.ps1 @@ -2,11 +2,10 @@ Function Invoke-WinUtilCurrentSystem { <# - .DESCRIPTION - Checks to see what tweaks have already been applied, and checks the according boxes - - .EXAMPLE + .SYNOPSIS + Checks to see what tweaks have already been applied and what programs are installed, and checks the according boxes + .EXAMPLE Get-WinUtilCheckBoxes "WPFInstall" #> diff --git a/functions/private/Invoke-WinUtilDarkMode.ps1 b/functions/private/Invoke-WinUtilDarkMode.ps1 index 7a497798ad..064259f50f 100644 --- a/functions/private/Invoke-WinUtilDarkMode.ps1 +++ b/functions/private/Invoke-WinUtilDarkMode.ps1 @@ -1,9 +1,12 @@ Function Invoke-WinUtilDarkMode { <# - - .DESCRIPTION + + .SYNOPSIS Enables/Disables Dark Mode - + + .PARAMETER DarkMoveEnabled + Indicates the current dark mode state + #> Param($DarkMoveEnabled) Try{ diff --git a/functions/private/Invoke-WinUtilFeatureInstall.ps1 b/functions/private/Invoke-WinUtilFeatureInstall.ps1 index 81e9eac0cf..8f197e1dfe 100644 --- a/functions/private/Invoke-WinUtilFeatureInstall.ps1 +++ b/functions/private/Invoke-WinUtilFeatureInstall.ps1 @@ -1,9 +1,9 @@ function Invoke-WinUtilFeatureInstall { <# - - .DESCRIPTION + + .SYNOPSIS Converts all the values from the tweaks.json and routes them to the appropriate function - + #> param( diff --git a/functions/private/Invoke-WinUtilScript.ps1 b/functions/private/Invoke-WinUtilScript.ps1 index f44ad7da83..e9516dfe9d 100644 --- a/functions/private/Invoke-WinUtilScript.ps1 +++ b/functions/private/Invoke-WinUtilScript.ps1 @@ -1,14 +1,19 @@ function Invoke-WinUtilScript { <# - - .DESCRIPTION - Invokes the provided scriptblock. Intended for things that can't be handled with the other functions - .EXAMPLE + .SYNOPSIS + Invokes the provided scriptblock. Intended for things that can't be handled with the other functions. + + .PARAMETER Name + The name of the scriptblock being invoked + + .PARAMETER scriptblock + The scriptblock to be invoked + .EXAMPLE $Scriptblock = [scriptblock]::Create({"Write-output 'Hello World'"}) Invoke-WinUtilScript -ScriptBlock $scriptblock -Name "Hello World" - + #> param ( $Name, diff --git a/functions/private/Invoke-WinUtilTweaks.ps1 b/functions/private/Invoke-WinUtilTweaks.ps1 index a53a42dd61..2a61555c09 100644 --- a/functions/private/Invoke-WinUtilTweaks.ps1 +++ b/functions/private/Invoke-WinUtilTweaks.ps1 @@ -1,9 +1,15 @@ function Invoke-WinUtilTweaks { <# - - .DESCRIPTION - Converts all the values from the tweaks.json and routes them to the appropriate function - + + .SYNOPSIS + Invokes the function associated with each provided checkbox + + .PARAMETER CheckBox + The checkbox to invoke + + .PARAMETER undo + Indicates whether to undo the operation contained in the checkbox + #> param( diff --git a/functions/private/Remove-WinUtilAPPX.ps1 b/functions/private/Remove-WinUtilAPPX.ps1 index 458a3204d1..40fa9f9a87 100644 --- a/functions/private/Remove-WinUtilAPPX.ps1 +++ b/functions/private/Remove-WinUtilAPPX.ps1 @@ -1,13 +1,15 @@ function Remove-WinUtilAPPX { <# - - .DESCRIPTION + + .SYNOPSIS Removes all APPX packages that match the given name - .EXAMPLE + .PARAMETER Name + The name of the APPX package to remove + .EXAMPLE Remove-WinUtilAPPX -Name "Microsoft.Microsoft3DViewer" - + #> param ( $Name diff --git a/functions/private/Set-WinUtilDNS.ps1 b/functions/private/Set-WinUtilDNS.ps1 index b3088f4e29..b636617cb9 100644 --- a/functions/private/Set-WinUtilDNS.ps1 +++ b/functions/private/Set-WinUtilDNS.ps1 @@ -1,13 +1,15 @@ function Set-WinUtilDNS { <# - - .DESCRIPTION + + .SYNOPSIS Sets the DNS of all interfaces that are in the "Up" state. It will lookup the values from the DNS.Json file - .EXAMPLE + .PARAMETER DNSProvider + The DNS provider to set the DNS server to + .EXAMPLE Set-WinUtilDNS -DNSProvider "google" - + #> param($DNSProvider) if($DNSProvider -eq "Default"){return} diff --git a/functions/private/Set-WinUtilRegistry.ps1 b/functions/private/Set-WinUtilRegistry.ps1 index 2d89768597..e4606952c3 100644 --- a/functions/private/Set-WinUtilRegistry.ps1 +++ b/functions/private/Set-WinUtilRegistry.ps1 @@ -1,14 +1,25 @@ function Set-WinUtilRegistry { <# - - .DESCRIPTION + + .SYNOPSIS Modifies the registry based on the given inputs - .EXAMPLE + .PARAMETER Name + The name of the key to modify + + .PARAMETER Path + The path to the key + + .PARAMETER Type + The type of value to set the key to + .PARAMETER Value + The value to set the key to + + .EXAMPLE Set-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0" - - #> + + #> param ( $Name, $Path, diff --git a/functions/private/Set-WinUtilRestorePoint.ps1 b/functions/private/Set-WinUtilRestorePoint.ps1 index c29b7f23b1..ad80be9673 100644 --- a/functions/private/Set-WinUtilRestorePoint.ps1 +++ b/functions/private/Set-WinUtilRestorePoint.ps1 @@ -1,10 +1,10 @@ function Set-WinUtilRestorePoint { <# - - .DESCRIPTION + + .SYNOPSIS Creates a Restore Point - #> + #> # Check if the user has administrative privileges if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { diff --git a/functions/private/Set-WinUtilScheduledTask.ps1 b/functions/private/Set-WinUtilScheduledTask.ps1 index f46b1a5754..d9d5262aec 100644 --- a/functions/private/Set-WinUtilScheduledTask.ps1 +++ b/functions/private/Set-WinUtilScheduledTask.ps1 @@ -1,13 +1,18 @@ function Set-WinUtilScheduledTask { <# - - .DESCRIPTION + + .SYNOPSIS Enables/Disables the provided Scheduled Task - .EXAMPLE + .PARAMETER Name + The path to the Scheduled Task + + .PARAMETER State + The State to set the Task to + .EXAMPLE Set-WinUtilScheduledTask -Name "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" -State "Disabled" - + #> param ( $Name, diff --git a/functions/private/Set-WinUtilService.ps1 b/functions/private/Set-WinUtilService.ps1 index 878ac1ecee..da237d639e 100644 --- a/functions/private/Set-WinUtilService.ps1 +++ b/functions/private/Set-WinUtilService.ps1 @@ -1,14 +1,19 @@ Function Set-WinUtilService { <# - - .DESCRIPTION - Changes the startup type of services and starts/stops them as needed - .EXAMPLE + .SYNOPSIS + Changes the startup type of the given service + + .PARAMETER Name + The name of the service to modify + + .PARAMETER StartupType + The startup type to set the service to + .EXAMPLE Set-WinUtilService -Name "HomeGroupListener" -StartupType "Manual" - - #> + + #> param ( $Name, $StartupType diff --git a/functions/private/Set-WinUtilUiTheme.ps1 b/functions/private/Set-WinUtilUiTheme.ps1 index 83ca9ba343..22526bf206 100644 --- a/functions/private/Set-WinUtilUiTheme.ps1 +++ b/functions/private/Set-WinUtilUiTheme.ps1 @@ -1,13 +1,18 @@ function Set-WinUtilUITheme { <# - - .DESCRIPTION + + .SYNOPSIS Sets the theme of the XAML file - .EXAMPLE + .PARAMETER inputXML + A string representing the XAML object to modify + + .PARAMETER themeName + The name of the theme to set the XAML to. Defaults to 'matrix' + .EXAMPLE Set-WinUtilUITheme -inputXAML $inputXAML - + #> param ( diff --git a/functions/private/Test-WinUtilPackageManager.ps1 b/functions/private/Test-WinUtilPackageManager.ps1 index a4624c53d5..b548265a33 100644 --- a/functions/private/Test-WinUtilPackageManager.ps1 +++ b/functions/private/Test-WinUtilPackageManager.ps1 @@ -1,9 +1,15 @@ function Test-WinUtilPackageManager { <# - - .DESCRIPTION - Checks for Winget or Choco depending on the parameter - + + .SYNOPSIS + Checks if Winget and/or Choco are installed + + .PARAMETER winget + Check if Winget is installed + + .PARAMETER choco + Check if Chocolatey is installed + #> Param( diff --git a/functions/private/Update-WinUtilProgramWinget.ps1 b/functions/private/Update-WinUtilProgramWinget.ps1 index 6835972fc9..5deac59cbe 100644 --- a/functions/private/Update-WinUtilProgramWinget.ps1 +++ b/functions/private/Update-WinUtilProgramWinget.ps1 @@ -1,10 +1,10 @@ Function Update-WinUtilProgramWinget { <# - - .DESCRIPTION - This will update programs via Winget using a new powershell.exe instance to prevent the GUI from locking up. - + + .SYNOPSIS + This will update all programs using Winget + #> [ScriptBlock]$wingetinstall = { diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1 index 281a377396..b25d1531f0 100644 --- a/functions/public/Invoke-WPFButton.ps1 +++ b/functions/public/Invoke-WPFButton.ps1 @@ -1,12 +1,13 @@ function Invoke-WPFButton { <# - - .DESCRIPTION - Meant to make creating buttons easier. There is a section below in the gui that will assign this function to every button. - This way you can dictate what each button does from this function. - - Input will be the name of the button that is clicked. + + .SYNOPSIS + Invokes the function associated with the clicked button + + .PARAMETER Button + The name of the button that was clicked + #> Param ([string]$Button) diff --git a/functions/public/Invoke-WPFControlPanel.ps1 b/functions/public/Invoke-WPFControlPanel.ps1 index ed1120cfa3..f5574a1188 100644 --- a/functions/public/Invoke-WPFControlPanel.ps1 +++ b/functions/public/Invoke-WPFControlPanel.ps1 @@ -1,9 +1,12 @@ function Invoke-WPFControlPanel { <# - - .DESCRIPTION - Simple switch for legacy panels - + + .SYNOPSIS + Opens the requested legacy panel + + .PARAMETER Panel + The panel to open + #> param($Panel) diff --git a/functions/public/Invoke-WPFFeatureInstall.ps1 b/functions/public/Invoke-WPFFeatureInstall.ps1 index bc7ca0ffad..091a88a007 100644 --- a/functions/public/Invoke-WPFFeatureInstall.ps1 +++ b/functions/public/Invoke-WPFFeatureInstall.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFFeatureInstall { <# - - .DESCRIPTION - GUI Function to install Windows Features - + + .SYNOPSIS + Installs selected Windows Features + #> if($sync.ProcessRunning){ diff --git a/functions/public/Invoke-WPFFixesNetwork.ps1 b/functions/public/Invoke-WPFFixesNetwork.ps1 index 427dd3e4b5..7016255639 100644 --- a/functions/public/Invoke-WPFFixesNetwork.ps1 +++ b/functions/public/Invoke-WPFFixesNetwork.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFFixesNetwork { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Resets various network configurations + #> Write-Host "Resetting Network with netsh" diff --git a/functions/public/Invoke-WPFFixesUpdate.ps1 b/functions/public/Invoke-WPFFixesUpdate.ps1 index e5ba29946b..7e170b538e 100644 --- a/functions/public/Invoke-WPFFixesUpdate.ps1 +++ b/functions/public/Invoke-WPFFixesUpdate.ps1 @@ -1,10 +1,10 @@ function Invoke-WPFFixesUpdate { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Performs various tasks in an attempt to repair Windows Update + #> # Reset Windows Update Script - reregister dlls, services, and remove registry entries diff --git a/functions/public/Invoke-WPFFormVariables.ps1 b/functions/public/Invoke-WPFFormVariables.ps1 index f2e4a3d2e8..5905e0f8cd 100644 --- a/functions/public/Invoke-WPFFormVariables.ps1 +++ b/functions/public/Invoke-WPFFormVariables.ps1 @@ -1,9 +1,9 @@ Function Invoke-WPFFormVariables { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Prints the logo + #> #If ($global:ReadmeDisplay -ne $true) { Write-Host "If you need to reference this display again, run Get-FormVariables" -ForegroundColor Yellow; $global:ReadmeDisplay = $true } diff --git a/functions/public/Invoke-WPFGetInstalled.ps1 b/functions/public/Invoke-WPFGetInstalled.ps1 index a23da62f21..3765abfb0b 100644 --- a/functions/public/Invoke-WPFGetInstalled.ps1 +++ b/functions/public/Invoke-WPFGetInstalled.ps1 @@ -1,8 +1,11 @@ function Invoke-WPFGetInstalled { <# - .DESCRIPTION - placeholder + .SYNOPSIS + Invokes the function that gets the checkboxes to check in a new runspace + + .PARAMETER checkbox + Indicates whether to check for installed 'winget' programs or applied 'tweaks' #> param($checkbox) diff --git a/functions/public/Invoke-WPFImpex.ps1 b/functions/public/Invoke-WPFImpex.ps1 index a6a14b230f..29675b2008 100644 --- a/functions/public/Invoke-WPFImpex.ps1 +++ b/functions/public/Invoke-WPFImpex.ps1 @@ -1,13 +1,18 @@ function Invoke-WPFImpex { <# - - .DESCRIPTION - This function handles importing and exporting of the checkboxes checked for the tweaks section - .EXAMPLE + .SYNOPSIS + Handles importing and exporting of the checkboxes checked for the tweaks section + + .PARAMETER type + Indicates whether to 'import' or 'export' + + .PARAMETER checkbox + The checkbox to export to a file or apply the imported file to + .EXAMPLE Invoke-WPFImpex -type "export" - + #> param( $type, diff --git a/functions/public/Invoke-WPFInstall.ps1 b/functions/public/Invoke-WPFInstall.ps1 index 0eee64c929..f8b87bd7ca 100644 --- a/functions/public/Invoke-WPFInstall.ps1 +++ b/functions/public/Invoke-WPFInstall.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFInstall { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Installs the selected programs using winget + #> if($sync.ProcessRunning){ diff --git a/functions/public/Invoke-WPFInstallUpgrade.ps1 b/functions/public/Invoke-WPFInstallUpgrade.ps1 index 8e5e31f172..c2fb9df1fe 100644 --- a/functions/public/Invoke-WPFInstallUpgrade.ps1 +++ b/functions/public/Invoke-WPFInstallUpgrade.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFInstallUpgrade { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Invokes the function that upgrades all installed programs using winget + #> if(!(Test-WinUtilPackageManager -winget)){ Write-Host "===========================================" diff --git a/functions/public/Invoke-WPFPanelAutologin.ps1 b/functions/public/Invoke-WPFPanelAutologin.ps1 index 1cd14ef98c..5291869a51 100644 --- a/functions/public/Invoke-WPFPanelAutologin.ps1 +++ b/functions/public/Invoke-WPFPanelAutologin.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFPanelAutologin { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Enables autologin using Sysinternals Autologon.exe + #> curl.exe -ss "https://live.sysinternals.com/Autologon.exe" -o $env:temp\autologin.exe # Official Microsoft recommendation https://learn.microsoft.com/en-us/sysinternals/downloads/autologon cmd /c $env:temp\autologin.exe /accepteula diff --git a/functions/public/Invoke-WPFPanelDISM.ps1 b/functions/public/Invoke-WPFPanelDISM.ps1 index 9212682ceb..a1d266cfc0 100644 --- a/functions/public/Invoke-WPFPanelDISM.ps1 +++ b/functions/public/Invoke-WPFPanelDISM.ps1 @@ -1,9 +1,26 @@ function Invoke-WPFPanelDISM { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Checks for system corruption using Chkdsk, SFC, and DISM + + .DESCRIPTION + 1. Chkdsk - Fixes disk and filesystem corruption + 2. SFC Run 1 - Fixes system file corruption, and fixes DISM if it was corrupted + 3. DISM - Fixes system image corruption, and fixes SFC's system image if it was corrupted + 4. SFC Run 2 - Fixes system file corruption, this time with an almost guaranteed uncorrupted system image + + .NOTES + Command Arguments: + 1. Chkdsk + /Scan - Runs an online scan on the system drive, attempts to fix any corruption, and queues other corruption for fixing on reboot + 2. SFC + /ScanNow - Performs a scan of the system files and fixes any corruption + 3. DISM - Fixes system image corruption, and fixes SFC's system image if it was corrupted + /Online - Fixes the currently running system image + /Cleanup-Image - Performs cleanup operations on the image, could remove some unneeded temporary files + /Restorehealth - Performs a scan of the image and fixes any corruption + #> Start-Process PowerShell -ArgumentList "Write-Host '(1/4) Chkdsk' -ForegroundColor Green; Chkdsk /scan; Write-Host '`n(2/4) SFC - 1st scan' -ForegroundColor Green; sfc /scannow; diff --git a/functions/public/Invoke-WPFPresets.ps1 b/functions/public/Invoke-WPFPresets.ps1 index 6e53571402..4b61e40bc6 100644 --- a/functions/public/Invoke-WPFPresets.ps1 +++ b/functions/public/Invoke-WPFPresets.ps1 @@ -1,8 +1,17 @@ function Invoke-WPFPresets { <# - .DESCRIPTION - Meant to make settings presets easier in the tweaks tab. Will pull the data from config/preset.json + .SYNOPSIS + Sets the options in the tweaks panel to the given preset + + .PARAMETER preset + The preset to set the options to + + .PARAMETER imported + If the preset is imported from a file, defaults to false + + .PARAMETER checkbox + The checkbox to set the options to, defaults to 'WPFTweaks' #> diff --git a/functions/public/Invoke-WPFRunspace.ps1 b/functions/public/Invoke-WPFRunspace.ps1 index e97966dc0c..9d16dac8f4 100644 --- a/functions/public/Invoke-WPFRunspace.ps1 +++ b/functions/public/Invoke-WPFRunspace.ps1 @@ -1,20 +1,21 @@ function Invoke-WPFRunspace { <# - - .DESCRIPTION - Simple function to make it easier to invoke a runspace from inside the script. - .EXAMPLE + .SYNOPSIS + Creates and invokes a runspace using the given scriptblock and argumentlist - $params = @{ - ScriptBlock = $sync.ScriptsInstallPrograms - ArgumentList = "Installadvancedip,Installbitwarden" - Verbose = $true - } + .PARAMETER ScriptBlock + The scriptblock to invoke in the runspace + + .PARAMETER ArgumentList + A list of arguments to pass to the runspace + + .EXAMPLE + Invoke-WPFRunspace ` + -ScriptBlock $sync.ScriptsInstallPrograms ` + -ArgumentList "Installadvancedip,Installbitwarden" ` - Invoke-WPFRunspace @params - #> [CmdletBinding()] diff --git a/functions/public/Invoke-WPFShortcut.ps1 b/functions/public/Invoke-WPFShortcut.ps1 index 1b0377f815..7015725ac4 100644 --- a/functions/public/Invoke-WPFShortcut.ps1 +++ b/functions/public/Invoke-WPFShortcut.ps1 @@ -1,8 +1,11 @@ function Invoke-WPFShortcut { <# - .DESCRIPTION - Creates a shortcut + .SYNOPSIS + Creates a shortcut and prompts for a save location + + .PARAMETER ShortcutToAdd + The name of the shortcut to add #> param($ShortcutToAdd) diff --git a/functions/public/Invoke-WPFTab.ps1 b/functions/public/Invoke-WPFTab.ps1 index 2197695693..3e6310a5a3 100644 --- a/functions/public/Invoke-WPFTab.ps1 +++ b/functions/public/Invoke-WPFTab.ps1 @@ -1,10 +1,13 @@ function Invoke-WPFTab { <# - - .DESCRIPTION - Sole purpose of this function is to reduce duplicated code for switching between tabs. - + + .SYNOPSIS + Sets the selected tab to the tab that was clicked + + .PARAMETER ClickedTab + The name of the tab that was clicked + #> Param ($ClickedTab) diff --git a/functions/public/Invoke-WPFToggle.ps1 b/functions/public/Invoke-WPFToggle.ps1 index 7f68009da8..23e26f28f0 100644 --- a/functions/public/Invoke-WPFToggle.ps1 +++ b/functions/public/Invoke-WPFToggle.ps1 @@ -1,12 +1,13 @@ function Invoke-WPFToggle { <# - - .DESCRIPTION - Meant to make creating toggle switches easier. There is a section below in the gui that will assign this function to every switch. - This way you can dictate what each button does from this function. - - Input will be the name of the toggle that is checked. + + .SYNOPSIS + Invokes the scriptblock for the given toggle + + .PARAMETER Button + The name of the toggle to invoke + #> Param ([string]$Button) diff --git a/functions/public/Invoke-WPFUltimatePerformance.ps1 b/functions/public/Invoke-WPFUltimatePerformance.ps1 index 8e9c8d4584..15c4df16b0 100644 --- a/functions/public/Invoke-WPFUltimatePerformance.ps1 +++ b/functions/public/Invoke-WPFUltimatePerformance.ps1 @@ -1,9 +1,12 @@ Function Invoke-WPFUltimatePerformance { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Creates or removes the Ultimate Performance power scheme + + .PARAMETER State + Indicates whether to enable or disable the Ultimate Performance power scheme + #> param($State) Try{ diff --git a/functions/public/Invoke-WPFUnInstall.ps1 b/functions/public/Invoke-WPFUnInstall.ps1 index 56748c0806..5ab2292094 100644 --- a/functions/public/Invoke-WPFUnInstall.ps1 +++ b/functions/public/Invoke-WPFUnInstall.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFUnInstall { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Uninstalls the selected programs + #> if($sync.ProcessRunning){ diff --git a/functions/public/Invoke-WPFUpdatesdefault.ps1 b/functions/public/Invoke-WPFUpdatesdefault.ps1 index 94d92fa8cd..3e1cebdd2b 100644 --- a/functions/public/Invoke-WPFUpdatesdefault.ps1 +++ b/functions/public/Invoke-WPFUpdatesdefault.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFUpdatesdefault { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Resets Windows Update settings to default + #> If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null diff --git a/functions/public/Invoke-WPFUpdatesdisable.ps1 b/functions/public/Invoke-WPFUpdatesdisable.ps1 index 7d264b9b4b..3167039fd8 100644 --- a/functions/public/Invoke-WPFUpdatesdisable.ps1 +++ b/functions/public/Invoke-WPFUpdatesdisable.ps1 @@ -1,9 +1,12 @@ function Invoke-WPFUpdatesdisable { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Disables Windows Update + + .NOTES + Disabling Windows Update is not recommended. This is only for advanced users who know what they are doing. + #> If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) { New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null diff --git a/functions/public/Invoke-WPFUpdatessecurity.ps1 b/functions/public/Invoke-WPFUpdatessecurity.ps1 index a40cf67707..e310d6a4b1 100644 --- a/functions/public/Invoke-WPFUpdatessecurity.ps1 +++ b/functions/public/Invoke-WPFUpdatessecurity.ps1 @@ -1,9 +1,16 @@ function Invoke-WPFUpdatessecurity { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Sets Windows Update to recommended settings + + .DESCRIPTION + 1. Disables driver offering through Windows Update + 2. Disables Windows Update automatic restart + 3. Sets Windows Update to Semi-Annual Channel (Targeted) + 4. Defers feature updates for 365 days + 5. Defers quality updates for 4 days + #> Write-Host "Disabling driver offering through Windows Update..." If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) { diff --git a/functions/public/Invoke-WPFtweaksbutton.ps1 b/functions/public/Invoke-WPFtweaksbutton.ps1 index 07a0a89c47..04bbc331f5 100644 --- a/functions/public/Invoke-WPFtweaksbutton.ps1 +++ b/functions/public/Invoke-WPFtweaksbutton.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFtweaksbutton { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Invokes the functions associated with each group of checkboxes + #> if($sync.ProcessRunning){ diff --git a/functions/public/Invoke-WPFundoall.ps1 b/functions/public/Invoke-WPFundoall.ps1 index 272636d3c8..354a26db4d 100644 --- a/functions/public/Invoke-WPFundoall.ps1 +++ b/functions/public/Invoke-WPFundoall.ps1 @@ -1,9 +1,9 @@ function Invoke-WPFundoall { <# - - .DESCRIPTION - PlaceHolder - + + .SYNOPSIS + Undoes every selected tweak + #> if($sync.ProcessRunning){