Trim Trailing Whitespace

This commit is contained in:
Carterpersall
2023-10-04 10:08:10 -05:00
parent 807b0fb307
commit 0ce32aa2c2
57 changed files with 236 additions and 236 deletions

View File

@ -1,15 +1,15 @@
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.
This way you can dictate what each button does from this function.
Input will be the name of the button that is clicked.
#>
Param ([string]$Button)
Param ([string]$Button)
#Use this to get the name of the button
#[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")

View File

@ -1,9 +1,9 @@
function Invoke-WPFControlPanel {
<#
.DESCRIPTION
Simple Switch for legacy windows
#>
param($Panel)

View File

@ -1,9 +1,9 @@
function Invoke-WPFFeatureInstall {
<#
.DESCRIPTION
GUI Function to install Windows Features
#>
if($sync.ProcessRunning){
@ -26,12 +26,12 @@ function Invoke-WPFFeatureInstall {
Write-Host "--- Features are Installed ---"
Write-Host "--- A Reboot may be required ---"
Write-Host "==================================="
$ButtonType = [System.Windows.MessageBoxButton]::OK
$MessageboxTitle = "All features are now installed "
$Messageboxbody = ("Done")
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
}
}

View File

@ -1,9 +1,9 @@
function Invoke-WPFFixesNetwork {
<#
.DESCRIPTION
PlaceHolder
#>
Write-Host "Resetting Network with netsh"

View File

@ -1,10 +1,10 @@
function Invoke-WPFFixesUpdate {
<#
.DESCRIPTION
PlaceHolder
#>
### Reset Windows Update Script - reregister dlls, services, and remove registry entries.

View File

@ -1,9 +1,9 @@
Function Invoke-WPFFormVariables {
<#
.DESCRIPTION
PlaceHolder
#>
#If ($global:ReadmeDisplay -ne $true) { Write-Host "If you need to reference this display again, run Get-FormVariables" -ForegroundColor Yellow; $global:ReadmeDisplay = $true }

View File

@ -31,9 +31,9 @@ function Invoke-WPFGetInstalled {
if($checkbox -eq "tweaks"){
Write-Host "Getting Installed Tweaks..."
}
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
$sync.form.Dispatcher.invoke({
foreach($checkbox in $Checkboxes){
$sync.$checkbox.ischecked = $True

View File

@ -1,13 +1,13 @@
function Invoke-WPFImpex {
<#
.DESCRIPTION
This function handles importing and exporting of the checkboxes checked for the tweaks section
.EXAMPLE
Invoke-WPFImpex -type "export"
#>
param(
$type,
@ -18,7 +18,7 @@ function Invoke-WPFImpex {
$FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
}
if ($type -eq "import"){
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
}
$FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
@ -28,7 +28,7 @@ function Invoke-WPFImpex {
if($FileBrowser.FileName -eq ""){
return
}
if ($type -eq "export"){
$jsonFile = Get-WinUtilCheckBoxes $checkbox -unCheck $false
$jsonFile | ConvertTo-Json | Out-File $FileBrowser.FileName -Force

View File

@ -1,9 +1,9 @@
function Invoke-WPFInstall {
<#
.DESCRIPTION
PlaceHolder
#>
if($sync.ProcessRunning){
@ -35,7 +35,7 @@ function Invoke-WPFInstall {
$MessageboxTitle = "Installs are Finished "
$Messageboxbody = ("Done")
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
Write-Host "==========================================="

View File

@ -1,9 +1,9 @@
function Invoke-WPFInstallUpgrade {
<#
.DESCRIPTION
PlaceHolder
#>
if(!(Test-WinUtilPackageManager -winget)){
Write-Host "==========================================="

View File

@ -1,9 +1,9 @@
function Invoke-WPFPanelAutologin {
<#
.DESCRIPTION
PlaceHolder
#>
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

View File

@ -1,9 +1,9 @@
function Invoke-WPFPanelDISM {
<#
.DESCRIPTION
PlaceHolder
#>
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;

View File

@ -1,9 +1,9 @@
function Invoke-WPFRunspace {
<#
.DESCRIPTION
Simple function to make it easier to invoke a runspace from inside the script.
Simple function to make it easier to invoke a runspace from inside the script.
.EXAMPLE
@ -14,14 +14,14 @@ function Invoke-WPFRunspace {
}
Invoke-WPFRunspace @params
#>
[CmdletBinding()]
Param (
$ScriptBlock,
$ArgumentList
)
)
#Crate a PowerShell instance.
$script:powershell = [powershell]::Create()
@ -30,7 +30,7 @@ function Invoke-WPFRunspace {
$script:powershell.AddScript($ScriptBlock)
$script:powershell.AddArgument($ArgumentList)
$script:powershell.RunspacePool = $sync.runspace
#Run our RunspacePool.
$script:handle = $script:powershell.BeginInvoke()

View File

@ -9,7 +9,7 @@ function Invoke-WPFShortcut {
Switch ($ShortcutToAdd) {
"WinUtil" {
$SourceExe = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
$SourceExe = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
$IRM = 'irm https://christitus.com/win | iex'
$Powershell = '-ExecutionPolicy Bypass -Command "Start-Process powershell.exe -verb runas -ArgumentList'
$ArgumentsToSourceExe = "$powershell '$IRM'"
@ -28,6 +28,6 @@ function Invoke-WPFShortcut {
$Shortcut.TargetPath = $SourceExe
$Shortcut.Arguments = $ArgumentsToSourceExe
$Shortcut.Save()
Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName)"
}

View File

@ -1,10 +1,10 @@
function Invoke-WPFTab {
<#
.DESCRIPTION
Sole purpose of this function is to reduce duplicated code for switching between tabs.
Sole purpose of this function is to reduce duplicated code for switching between tabs.
#>
Param ($ClickedTab)
@ -13,7 +13,7 @@ function Invoke-WPFTab {
$x = [int]($ClickedTab -replace "WPFTab","" -replace "BT","") - 1
0..($Tabs.Count -1 ) | ForEach-Object {
if ($x -eq $psitem){
$sync.$TabNav.Items[$psitem].IsSelected = $true
}

View File

@ -1,15 +1,15 @@
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.
This way you can dictate what each button does from this function.
Input will be the name of the toggle that is checked.
#>
Param ([string]$Button)
Param ([string]$Button)
#Use this to get the name of the button
#[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")

View File

@ -1,9 +1,9 @@
Function Invoke-WPFUltimatePerformance {
<#
.DESCRIPTION
PlaceHolder
#>
param($State)
Try{
@ -31,7 +31,7 @@ Function Invoke-WPFUltimatePerformance {
}
else {
Write-Host "Power scheme '$powerSchemeName' already exists."
}
}
}
elseif($state -eq "Disabled"){
# Define the name of the power scheme you want to remove
@ -50,10 +50,10 @@ Function Invoke-WPFUltimatePerformance {
if($null -ne $guid){
Write-Host "Found power scheme '$powerSchemeName' with GUID $guid. Removing..."
# Remove the power scheme
powercfg /delete $guid
Write-Host "Power scheme removed successfully."
}
else {
@ -65,7 +65,7 @@ Function Invoke-WPFUltimatePerformance {
}
}
}
Catch{
Write-Warning $psitem.Exception.Message

View File

@ -1,9 +1,9 @@
function Invoke-WPFUnInstall {
<#
.DESCRIPTION
PlaceHolder
#>
if($sync.ProcessRunning){
@ -41,7 +41,7 @@ function Invoke-WPFUnInstall {
$MessageboxTitle = "Uninstalls are Finished "
$Messageboxbody = ("Done")
$MessageIcon = [System.Windows.MessageBoxImage]::Information
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
Write-Host "==========================================="

View File

@ -1,9 +1,9 @@
function Invoke-WPFUpdatesdefault {
<#
.DESCRIPTION
PlaceHolder
#>
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null

View File

@ -1,9 +1,9 @@
function Invoke-WPFUpdatesdisable {
<#
.DESCRIPTION
PlaceHolder
#>
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null

View File

@ -1,9 +1,9 @@
function Invoke-WPFUpdatessecurity {
<#
.DESCRIPTION
PlaceHolder
#>
Write-Host "Disabling driver offering through Windows Update..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) {

View File

@ -1,9 +1,9 @@
function Invoke-WPFtweaksbutton {
<#
.DESCRIPTION
PlaceHolder
#>
if($sync.ProcessRunning){

View File

@ -1,9 +1,9 @@
function Invoke-WPFundoall {
<#
.DESCRIPTION
PlaceHolder
#>
if($sync.ProcessRunning){
@ -18,8 +18,8 @@ function Invoke-WPFundoall {
$msg = "Please check the tweaks you wish to undo."
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
return
}
}
Invoke-WPFRunspace -ArgumentList $Tweaks -ScriptBlock {
param($Tweaks)