mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 00:54:47 -05:00
2023 09 23 test (#1117)
* move restore point to runspace (#1056)
* Add Guilded into Communication Tab (#1059)
* Add Guilded into Communication Tab
* Remove Choco Package due to there is no Chocolatey packages
* : Add ZeroTier One to utilities menu (#1061)
* Update applications.json (#1063)
Update to add [SuperF4 - Stefan Sundin](https://stefansundin.github.io/superf4/), as mentioned in #374 [Choco - SuperF4](https://community.chocolatey.org/packages/superf4) maintained by Xav83. [WinGet - SuperF4](https://winstall.app/apps/StefanSundin.Superf4) SuperF4 and Winget package published by Stefan Sundin.
* Update inputXML.xaml (#1062)
Updated inputXML.xaml to account for addition of the SuperF4 software.
* Added AIMP music player (#1064)
* Add Ventoy (Chocolatey Only Package) & .NET Core Runtime (Winget & Chocolatey) (#1066)
* Tidy up SuperF4 line.
* Tidy up SuperF4 line.
Used spaces instead of tabs.
* Add dotnet 7.0.11 Desktop Runtime
* Undone changes to SuperF4 line
* Addition of Ventoy (chocolatey only) package
* Comment Spacing, Indentation, and Capitalization (#1084)
* Comment Spacing, Indentation, and Capitalization
* Comment Grammar and Spacing
Makes grammar in comments better and more consistent
Adds space before comment and centers word in `Write-Host` commands
* More Grammar and Formatting
* Add some comments
* 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
* Tweak a few more comments
* Tweak another write-host statement
* Undo Catch statement adjustment
It's outside of the scope of this pull request
* Trim Trailing Whitespace (#1085)
* Trim Trailing Whitespace
* Revert "Trim Trailing Whitespace"
This reverts commit 0ce32aa2c2
.
* Trim Trailing Whitespace, take 2
* Bug Fixes
- Edge Removal pullback to local
- Formatting fixes
* testing refactor to ps1
* Update winget-install to 3.0.1 (#1086)
* Update tweaks.json (#1087)
Capitalized first letter of "path" --> "Path" keys
* Update edgeremoval.ps1
* Update edgeremoval.ps1
* Update edgeremoval.ps1
add error handling
* Update functions.Tests.ps1
* fix catch error
* add MSI Afterburner (#1097)
* Add GitHub stats
* Remove Application Experience
* Thorium addition
* remove sample submission
* testing
* Ultimate Performance
* Home GPEDIT
* Fix Winget Install on New System
---------
Co-authored-by: DeveloperDurp <developerdurp@durp.info>
Co-authored-by: Justawildwolf <62820836+blusewill@users.noreply.github.com>
Co-authored-by: Tim Stone <github@tsdev.au>
Co-authored-by: Will Barnard <5012445+mrwillbarnz@users.noreply.github.com>
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
Co-authored-by: Carter <60557606+Carterpersall@users.noreply.github.com>
Co-authored-by: Yorai Levi <yorai.email@gmail.com>
Co-authored-by: Saikrishnan K <53394202+K-Saikrishnan@users.noreply.github.com>
This commit is contained in:
@ -1,17 +1,18 @@
|
||||
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.
|
||||
#>
|
||||
|
||||
Param ([string]$Button)
|
||||
|
||||
#Use this to get the name of the button
|
||||
.SYNOPSIS
|
||||
Invokes the function associated with the clicked button
|
||||
|
||||
.PARAMETER Button
|
||||
The name of the button that was clicked
|
||||
|
||||
#>
|
||||
|
||||
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")
|
||||
|
||||
Switch -Wildcard ($Button){
|
||||
|
@ -1,9 +1,12 @@
|
||||
function Invoke-WPFControlPanel {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
Simple Switch for legacy windows
|
||||
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Opens the requested legacy panel
|
||||
|
||||
.PARAMETER Panel
|
||||
The panel to open
|
||||
|
||||
#>
|
||||
param($Panel)
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
function Invoke-WPFFeatureInstall {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
GUI Function to install Windows Features
|
||||
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Installs selected 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)
|
||||
}
|
||||
}
|
@ -1,14 +1,18 @@
|
||||
function Invoke-WPFFixesNetwork {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
PlaceHolder
|
||||
|
||||
|
||||
.SYNOPSIS
|
||||
Resets various network configurations
|
||||
|
||||
#>
|
||||
|
||||
Write-Host "Resetting Network with netsh"
|
||||
|
||||
# Reset WinSock catalog to a clean state
|
||||
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winsock", "reset"
|
||||
# Resets WinHTTP proxy setting to DIRECT
|
||||
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winhttp", "reset", "proxy"
|
||||
# Removes all user configured IP settings
|
||||
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "int", "ip", "reset"
|
||||
|
||||
Write-Host "Process complete. Please reboot your computer."
|
||||
@ -19,7 +23,7 @@ function Invoke-WPFFixesNetwork {
|
||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||
|
||||
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||
Write-Host "================================="
|
||||
Write-Host "-- Reset Network Configuration --"
|
||||
Write-Host "================================="
|
||||
Write-Host "=========================================="
|
||||
Write-Host "-- Network Configuration has been Reset --"
|
||||
Write-Host "=========================================="
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
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.
|
||||
# Reset Windows Update Script - reregister dlls, services, and remove registry entries
|
||||
Write-Host "1. Stopping Windows Update Services..."
|
||||
Stop-Service -Name BITS
|
||||
Stop-Service -Name wuauserv
|
||||
@ -83,7 +83,7 @@ Write-Host "12) Forcing discovery..."
|
||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||
|
||||
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||
Write-Host "================================="
|
||||
Write-Host "-- Reset ALL Updates to Factory -"
|
||||
Write-Host "================================="
|
||||
Write-Host "==============================================="
|
||||
Write-Host "-- Reset All Windows Update Settings to Stock -"
|
||||
Write-Host "==============================================="
|
||||
}
|
@ -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 }
|
||||
|
||||
|
@ -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)
|
||||
@ -31,9 +34,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
|
||||
|
@ -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,
|
||||
@ -18,7 +23,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 +33,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
|
||||
|
@ -1,9 +1,9 @@
|
||||
function Invoke-WPFInstall {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
PlaceHolder
|
||||
|
||||
|
||||
.SYNOPSIS
|
||||
Installs the selected programs using winget
|
||||
|
||||
#>
|
||||
|
||||
if($sync.ProcessRunning){
|
||||
@ -28,14 +28,14 @@ function Invoke-WPFInstall {
|
||||
# Ensure winget is installed
|
||||
Install-WinUtilWinget
|
||||
|
||||
# Install all winget programs in new window
|
||||
# Install all selected programs in new window
|
||||
Install-WinUtilProgramWinget -ProgramsToInstall $WingetInstall
|
||||
|
||||
$ButtonType = [System.Windows.MessageBoxButton]::OK
|
||||
$MessageboxTitle = "Installs are Finished "
|
||||
$Messageboxbody = ("Done")
|
||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||
|
||||
|
||||
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||
|
||||
Write-Host "==========================================="
|
||||
|
@ -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 "==========================================="
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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'
|
||||
|
||||
#>
|
||||
|
||||
|
@ -1,40 +1,41 @@
|
||||
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()]
|
||||
Param (
|
||||
$ScriptBlock,
|
||||
$ArgumentList
|
||||
)
|
||||
)
|
||||
|
||||
#Crate a PowerShell instance.
|
||||
# Create a PowerShell instance
|
||||
$script:powershell = [powershell]::Create()
|
||||
|
||||
#Add Scriptblock and Arguments to runspace
|
||||
# Add Scriptblock and Arguments to runspace
|
||||
$script:powershell.AddScript($ScriptBlock)
|
||||
$script:powershell.AddArgument($ArgumentList)
|
||||
$script:powershell.RunspacePool = $sync.runspace
|
||||
|
||||
#Run our RunspacePool.
|
||||
|
||||
# Execute the RunspacePool
|
||||
$script:handle = $script:powershell.BeginInvoke()
|
||||
|
||||
#Cleanup our RunspacePool threads when they are complete ie. GC.
|
||||
# Clean up the RunspacePool threads when they are complete, and invoke the garbage collector to clean up the memory
|
||||
if ($script:handle.IsCompleted)
|
||||
{
|
||||
$script:powershell.EndInvoke($script:handle)
|
||||
|
@ -1,15 +1,18 @@
|
||||
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)
|
||||
|
||||
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 +31,6 @@ function Invoke-WPFShortcut {
|
||||
$Shortcut.TargetPath = $SourceExe
|
||||
$Shortcut.Arguments = $ArgumentsToSourceExe
|
||||
$Shortcut.Save()
|
||||
|
||||
|
||||
Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName)"
|
||||
}
|
@ -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)
|
||||
@ -13,7 +16,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
|
||||
}
|
||||
|
@ -1,17 +1,18 @@
|
||||
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.
|
||||
#>
|
||||
|
||||
Param ([string]$Button)
|
||||
|
||||
#Use this to get the name of the button
|
||||
.SYNOPSIS
|
||||
Invokes the scriptblock for the given toggle
|
||||
|
||||
.PARAMETER Button
|
||||
The name of the toggle to invoke
|
||||
|
||||
#>
|
||||
|
||||
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")
|
||||
|
||||
Switch -Wildcard ($Button){
|
||||
|
@ -1,46 +1,51 @@
|
||||
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{
|
||||
|
||||
if($state -eq "Enabled"){
|
||||
# Define the name and GUID of the power scheme you want to add
|
||||
# Define the name and GUID of the power scheme
|
||||
$powerSchemeName = "Ultimate Performance"
|
||||
$powerSchemeGuid = "e9a42b02-d5df-448d-aa00-03f14749eb61"
|
||||
|
||||
# Get all power schemes
|
||||
$schemes = powercfg /list | Out-String -Stream
|
||||
|
||||
# Find the scheme you want to add
|
||||
# Check if the power scheme already exists
|
||||
$ultimateScheme = $schemes | Where-Object { $_ -match $powerSchemeName }
|
||||
|
||||
# If the scheme does not exist, add it
|
||||
if ($null -eq $ultimateScheme) {
|
||||
Write-Host "Power scheme '$powerSchemeName' not found. Adding..."
|
||||
|
||||
# Add the power scheme
|
||||
powercfg /duplicatescheme $powerSchemeGuid
|
||||
powercfg -attributes SUB_SLEEP 7bc4a2f9-d8fc-4469-b07b-33eb785aaca0 -ATTRIB_HIDE
|
||||
powercfg -setactive $powerSchemeGuid
|
||||
powercfg -change -monitor-timeout-ac 0
|
||||
|
||||
|
||||
Write-Host "Power scheme added successfully."
|
||||
}
|
||||
else {
|
||||
Write-Host "Power scheme '$powerSchemeName' already exists."
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($state -eq "Disabled"){
|
||||
# Define the name of the power scheme you want to remove
|
||||
# Define the name of the power scheme
|
||||
$powerSchemeName = "Ultimate Performance"
|
||||
|
||||
# Get all power schemes
|
||||
$schemes = powercfg /list | Out-String -Stream
|
||||
|
||||
# Find the scheme you want to remove
|
||||
# Find the scheme to be removed
|
||||
$ultimateScheme = $schemes | Where-Object { $_ -match $powerSchemeName }
|
||||
|
||||
# If the scheme exists, remove it
|
||||
@ -50,10 +55,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 +70,7 @@ Function Invoke-WPFUltimatePerformance {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Catch{
|
||||
Write-Warning $psitem.Exception.Message
|
||||
|
@ -1,13 +1,13 @@
|
||||
function Invoke-WPFUnInstall {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
PlaceHolder
|
||||
|
||||
|
||||
.SYNOPSIS
|
||||
Uninstalls the selected programs
|
||||
|
||||
#>
|
||||
|
||||
if($sync.ProcessRunning){
|
||||
$msg = "Install process is currently running."
|
||||
$msg = "Install process is currently running"
|
||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||
return
|
||||
}
|
||||
@ -22,7 +22,7 @@ function Invoke-WPFUnInstall {
|
||||
|
||||
$ButtonType = [System.Windows.MessageBoxButton]::YesNo
|
||||
$MessageboxTitle = "Are you sure?"
|
||||
$Messageboxbody = ("This will uninstall the following applications `n $WingetInstall")
|
||||
$Messageboxbody = ("This will uninstall the following applications: `n $WingetInstall")
|
||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||
|
||||
$confirm = [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||
@ -34,23 +34,23 @@ function Invoke-WPFUnInstall {
|
||||
try{
|
||||
$sync.ProcessRunning = $true
|
||||
|
||||
# Install all winget programs in new window
|
||||
# Install all selected programs in new window
|
||||
Install-WinUtilProgramWinget -ProgramsToInstall $WingetInstall -Manage "Uninstalling"
|
||||
|
||||
$ButtonType = [System.Windows.MessageBoxButton]::OK
|
||||
$MessageboxTitle = "Uninstalls are Finished "
|
||||
$Messageboxbody = ("Done")
|
||||
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
||||
|
||||
|
||||
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Uninstalls have finished ---"
|
||||
Write-Host "-- Uninstalls have finished ---"
|
||||
Write-Host "==========================================="
|
||||
}
|
||||
Catch {
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Winget failed to install ---"
|
||||
Write-Host "-- Winget failed to install ---"
|
||||
Write-Host "==========================================="
|
||||
}
|
||||
$sync.ProcessRunning = $False
|
||||
|
@ -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
|
||||
@ -39,7 +39,7 @@ function Invoke-WPFUpdatesdefault {
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "BranchReadinessLevel" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferFeatureUpdatesPeriodInDays" -ErrorAction SilentlyContinue
|
||||
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays" -ErrorAction SilentlyContinue
|
||||
Write-Host "================================="
|
||||
Write-Host "--- Updates Set to Default ---"
|
||||
Write-Host "================================="
|
||||
Write-Host "==================================================="
|
||||
Write-Host "--- Windows Update Settings Reset to Default ---"
|
||||
Write-Host "==================================================="
|
||||
}
|
@ -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
|
||||
@ -27,6 +30,6 @@ function Invoke-WPFUpdatesdisable {
|
||||
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
|
||||
}
|
||||
Write-Host "================================="
|
||||
Write-Host "--- Updates ARE DISABLED ---"
|
||||
Write-Host "--- Updates ARE DISABLED ---"
|
||||
Write-Host "================================="
|
||||
}
|
@ -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")) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
function Invoke-WPFtweaksbutton {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
PlaceHolder
|
||||
|
||||
|
||||
.SYNOPSIS
|
||||
Invokes the functions associated with each group of checkboxes
|
||||
|
||||
#>
|
||||
|
||||
if($sync.ProcessRunning){
|
||||
@ -22,13 +22,13 @@ function Invoke-WPFtweaksbutton {
|
||||
return
|
||||
}
|
||||
|
||||
Set-WinUtilRestorePoint
|
||||
|
||||
Invoke-WPFRunspace -ArgumentList $Tweaks -ScriptBlock {
|
||||
param($Tweaks)
|
||||
|
||||
$sync.ProcessRunning = $true
|
||||
|
||||
Set-WinUtilRestorePoint
|
||||
|
||||
Foreach ($tweak in $tweaks){
|
||||
Invoke-WinUtilTweaks $tweak
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
function Invoke-WPFundoall {
|
||||
<#
|
||||
|
||||
.DESCRIPTION
|
||||
PlaceHolder
|
||||
|
||||
|
||||
.SYNOPSIS
|
||||
Undoes every selected tweak
|
||||
|
||||
#>
|
||||
|
||||
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)
|
||||
|
||||
|
Reference in New Issue
Block a user