diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 00000000..2a267c93
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,59 @@
+# This is a comment.
+# Each line is a file pattern followed by one or more owners.
+
+# These owners will be the default owners for everything in
+# the repo. Unless a later match takes precedence,
+# @global-owner1 and @global-owner2 will be requested for
+# review when someone opens a pull request.
+* @ChrisTitusTech
+
+# Order is important; the last matching pattern takes the most
+# precedence. When someone opens a pull request that only
+# modifies JS files, only @js-owner and not the global
+# owner(s) will be requested for a review.
+# *.js @js-owner #This is an inline comment.
+
+# You can also use email addresses if you prefer. They'll be
+# used to look up users just like we do for commit author
+# emails.
+# *.go docs@example.com
+
+# Teams can be specified as code owners as well. Teams should
+# be identified in the format @org/team-name. Teams must have
+# explicit write access to the repository. In this example,
+# the octocats team in the octo-org organization owns all .txt files.
+# *.txt @octo-org/octocats
+
+# In this example, @doctocat owns any files in the build/logs
+# directory at the root of the repository and any of its
+# subdirectories.
+# /build/logs/ @doctocat
+
+# The `docs/*` pattern will match files like
+# `docs/getting-started.md` but not further nested files like
+# `docs/build-app/troubleshooting.md`.
+# docs/* docs@example.com
+
+# In this example, @octocat owns any file in an apps directory
+# anywhere in your repository.
+# apps/ @octocat
+
+# In this example, @doctocat owns any file in the `/docs`
+# directory in the root of your repository and any of its
+# subdirectories.
+# /docs/ @doctocat
+
+# In this example, any change inside the `/scripts` directory
+# will require approval from @doctocat or @octocat.
+# /scripts/ @doctocat @octocat
+
+# In this example, @octocat owns any file in a `/logs` directory such as
+# `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes
+# in a `/logs` directory will require approval from @octocat.
+# **/logs @octocat
+
+# In this example, @octocat owns any file in the `/apps`
+# directory in the root of your repository except for the `/apps/github`
+# subdirectory, as its owners are left empty.
+# /apps/ @octocat
+# /apps/github
\ No newline at end of file
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 66d0120d..1f73b1f7 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -4,21 +4,18 @@ on:
push:
branches:
- main
- - test
+ - test*
jobs:
- build:
- runs-on: ubuntu-latest
+ build-runspace:
+ runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Create local changes
run: |
- sed -i "/\$BranchToUse = /c\$BranchToUse = '$GITHUB_REF_NAME'" $GITHUB_WORKSPACE/runspace.ps1
- grep "\$BranchToUse =" $GITHUB_WORKSPACE/runspace.ps1
- sed -i "/\$BranchToUse = /c\$BranchToUse = '$GITHUB_REF_NAME'" $GITHUB_WORKSPACE/winutil.ps1
- grep "\$BranchToUse =" $GITHUB_WORKSPACE/winutil.ps1
+ powershell.exe -f Compile.ps1
- uses: stefanzweifel/git-auto-commit-action@v4
with:
- commit_message: Update Branch in script
+ commit_message: Compile Winutil
\ No newline at end of file
diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml
index 273c4a3f..e7dd5723 100644
--- a/.github/workflows/unittests.yaml
+++ b/.github/workflows/unittests.yaml
@@ -4,6 +4,19 @@ on:
push:
jobs:
+ lint:
+ name: PS Script Analyzer
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: lint
+ uses: devblackops/github-action-psscriptanalyzer@master
+ with:
+ sendComment: false
+ settingsPath: lint/PSScriptAnalyser.ps1
+ failOnErrors: false
+ failOnWarnings: false
+ failOnInfos: false
test:
runs-on: windows-latest
steps:
diff --git a/.gitignore b/.gitignore
index af9d3355..b1f1a5bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,38 @@
+### VSCode ###
-ooshutup10.cfg
-OOSU10.exe
+# Configuration folder
+.vscode/
+
+### Visual Studio ###
+
+# Visual Studio user-specific files
+.vs/
+
+winutil.pdb
+
+### Windows ###
+
+# Folder config file
+[Dd]esktop.ini
+
+# Executables and Configs
*.exe
+winget.msixbundle
+pester.ps1
+*.psd*
+ooshutup10.cfg
+winutil.exe.config
+Microsoft.UI.Xaml*
+license1.xml
+
+# Libraries
System.Management.Automation.dll
Microsoft.PowerShell.ConsoleHost.dll
-winutil.exe.config
-winutil.pdb
+
+# Compressed files
*.zip
-.vs/
-*.psd*
-pester.ps1
-Microsoft.UI.Xaml*
-winget.msixbundle
-license1.xml
\ No newline at end of file
+
+### MacOS ###
+
+# General
+.DS_Store
\ No newline at end of file
diff --git a/Compile.ps1 b/Compile.ps1
new file mode 100644
index 00000000..38b32a9b
--- /dev/null
+++ b/Compile.ps1
@@ -0,0 +1,33 @@
+$OFS = "`r`n"
+$scriptname = "winutil.ps1"
+
+
+Remove-Item .\$scriptname
+
+Write-output '
+################################################################################################################
+### ###
+### WARNING: This file is automatically generated DO NOT modify this file directly as it will be overwritten ###
+### ###
+################################################################################################################
+' | Out-File ./$scriptname -Append -Encoding ascii
+
+(Get-Content .\scripts\start.ps1).replace('#{replaceme}',"$(get-date -format yy.MM.dd)") | Out-File ./$scriptname -Append -Encoding ascii
+
+Get-ChildItem .\functions -Recurse -File | ForEach-Object {
+ Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
+}
+
+Get-ChildItem .\xaml | ForEach-Object {
+ $xaml = (Get-Content $psitem.FullName).replace("'","''")
+
+ Write-output "`$$($psitem.BaseName) = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii
+}
+
+Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
+ $json = (Get-Content $psitem.FullName).replace("'","''")
+
+ Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" | Out-File ./$scriptname -Append -Encoding ascii
+}
+
+Get-Content .\scripts\main.ps1 | Out-File ./$scriptname -Append -Encoding ascii
diff --git a/MainWindow-runspace.xaml b/MainWindow-runspace.xaml
deleted file mode 100644
index 9f819aed..00000000
--- a/MainWindow-runspace.xaml
+++ /dev/null
@@ -1,305 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
- Recommended selections are for normal users and if you are unsure do NOT check anything else!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This is the default settings that come with Windows. No modifications are made and will remove any custom windows update settings.Note: If you still encounter update errors, reset all updates in the config tab. That will restore ALL Microsoft Update Services from their servers and reinstall them to default settings.
-
-
-
- This is my recommended setting I use on all computers. It will delay feature updates by 2 years and will install security updates 4 days after release.Feature Updates: Adds features and often bugs to systems when they are released. You want to delay these as long as possible.Security Updates: Typically these are pressing security flaws that need to be patched quickly. You only want to delay these a couple of days just to see if they are safe and don't break other systems. You don't want to go without these for ANY extended periods of time.
-
-
-
- This completely disables ALL Windows Updates and is NOT RECOMMENDED. However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. Note: Your system will be easier to hack and infect without security updates.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/README.md b/README.md
index 7782f36e..fb44a207 100644
--- a/README.md
+++ b/README.md
@@ -21,6 +21,7 @@ If you are having TLS 1.2 Issues or You cannot find or resolve `christitus.com/w
```
[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;iex(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/winutil.ps1')
```
+If you are still having issues try changing your DNS provider to 1.1.1.1 or 8.8.8.8
EXE Wrapper for $10 @ https://www.cttstore.com/windows-toolbox
diff --git a/config/applications.json b/config/applications.json
index e23718cb..dde19552 100644
--- a/config/applications.json
+++ b/config/applications.json
@@ -47,6 +47,10 @@
"winget": "CPUID.CPU-Z",
"choco": "cpu-z"
},
+ "WPFInstalldeluge": {
+ "winget": "DelugeTeam.Deluge",
+ "choco": "deluge"
+ },
"WPFInstalldiscord": {
"winget": "Discord.Discord",
"choco": "discord"
@@ -204,7 +208,7 @@
"choco": "putty"
},
"WPFInstallpython3": {
- "winget": "Python.Python.3",
+ "winget": "Python.Python.3.11",
"choco": "python"
},
"WPFInstallrevo": {
@@ -399,6 +403,10 @@
"Winget": "Rustlang.Rust.MSVC",
"choco": "rust"
},
+ "WPFInstallgolang": {
+ "Winget": "GoLang.Go.1.19",
+ "choco": "golang"
+ },
"WPFInstallalacritty": {
"Winget": "Alacritty.Alacritty",
"choco": "alacritty"
diff --git a/config/dns.json b/config/dns.json
new file mode 100644
index 00000000..f661ef0a
--- /dev/null
+++ b/config/dns.json
@@ -0,0 +1,30 @@
+{
+ "Google":{
+ "Primary": "8.8.8.8",
+ "Secondary": "8.8.4.4"
+ },
+ "Cloudflare":{
+ "Primary": "1.1.1.1",
+ "Secondary": "1.0.0.1"
+ },
+ "Cloudflare_Malware":{
+ "Primary": "1.1.1.2",
+ "Secondary": "1.0.0.2"
+ },
+ "Cloudflare_Malware_Adult":{
+ "Primary": "1.1.1.3",
+ "Secondary": "1.0.0.3"
+ },
+ "Level3":{
+ "Primary": "4.2.2.2",
+ "Secondary": "4.2.2.1"
+ },
+ "Open_DNS":{
+ "Primary": "208.67.222.222",
+ "Secondary": "208.67.220.220"
+ },
+ "Quad9":{
+ "Primary": "9.9.9.9",
+ "Secondary": "149.112.112.112"
+ }
+}
\ No newline at end of file
diff --git a/config/helperscript.ps1 b/config/helperscript.ps1
index 51a92624..403faa8c 100644
--- a/config/helperscript.ps1
+++ b/config/helperscript.ps1
@@ -1,5 +1,9 @@
#This file is meant to assist in building out the json files inside this folder.
+#===========================================================================
+# applications.json
+#===========================================================================
+
<#
Applications.json
-----------------
@@ -10,25 +14,22 @@
The structure of the json is as follows
{
- "install": {
- "Name of Button": {
- "winget": "Winget command"
- "choco": "Chocolatey command"
+ "Name of Button": {
+ "winget": "Winget command"
+ "choco": "Chocolatey command"
},
}
Example:
{
- "install": {
- "WPFInstalladobe": {
- "winget": "Adobe.Acrobat.Reader.64-bit"
- "choco": "adobereader"
- },
- "WPFInstalladvancedip": {
- "winget": "Famatech.AdvancedIPScanner"
- "choco": "advanced-ip-scanner"
- }
+ "WPFInstalladobe": {
+ "winget": "Adobe.Acrobat.Reader.64-bit"
+ "choco": "adobereader"
+ },
+ "WPFInstalladvancedip": {
+ "winget": "Famatech.AdvancedIPScanner"
+ "choco": "advanced-ip-scanner"
}
}
@@ -45,8 +46,8 @@ $ButtonToAdd = New-Object psobject
$jsonfile = Get-Content ./config/applications.json | ConvertFrom-Json
#remove if already exists
-if($jsonfile.install.$NameofButton){
- $jsonfile.install.psobject.Properties.remove($NameofButton)
+if($jsonfile.$NameofButton){
+ $jsonfile.psobject.Properties.remove($NameofButton)
}
Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "Winget" -Value $WingetCommand
@@ -55,6 +56,10 @@ Add-Member -InputObject $jsonfile.install -MemberType NoteProperty -Name $Nameof
$jsonfile | ConvertTo-Json | Out-File ./config/applications.json
+#===========================================================================
+# feature.json
+#===========================================================================
+
<#
feature.json
-----------------
@@ -101,6 +106,10 @@ Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -
$jsonfile | ConvertTo-Json | Out-File ./config/feature.json
+#===========================================================================
+# preset.json
+#===========================================================================
+
<#
preset.json
-----------------
@@ -159,6 +168,10 @@ Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -
$jsonfile | ConvertTo-Json | Out-File ./config/preset.json
+#===========================================================================
+# tweaks.json
+#===========================================================================
+
<#
tweaks.json
-----------------
@@ -276,8 +289,6 @@ Example:
#Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request.
#Make sure to uncomment the sections you which to add.
-$NameofButton = ""
-
#$Registry = @(
# #to add more repeat this seperated by a comma
# @{
@@ -319,6 +330,8 @@ $NameofButton = ""
# ""
#)
+$NameofButton = "WPF" + ""
+
$ButtonToAdd = New-Object psobject
$jsonfile = Get-Content ./config/tweaks.json | ConvertFrom-Json
@@ -337,3 +350,50 @@ if($UndoScript){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -N
Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -Value $ButtonToAdd
($jsonfile | ConvertTo-Json -Depth 5).replace('\r\n',"`r`n") | Out-File ./config/tweaks.json
+
+#===========================================================================
+# dns.json
+#===========================================================================
+
+<#
+ dns.json
+ -----------------
+ This file holds all the DNS entrees.
+
+ The structure of the json is as follows
+
+{
+ "DNS Provider": [
+ "Primary": "IP address",
+ "Secondary": "IP address"
+ ]
+}
+
+Example:
+{
+ "Cloudflare":{
+ "Primary": "1.1.1.1",
+ "Secondary": "1.0.0.1"
+ }
+}
+#>
+
+#Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request.
+
+$NameofProvider = "" -replace " ","_"
+$IPAddress = @{
+ "Primary" = "0.0.0.0"
+ "Secondary" = "0.0.0.0"
+}
+
+$ButtonToAdd = New-Object psobject
+$jsonfile = Get-Content ./config/dns.json | ConvertFrom-Json
+
+#remove if already exists
+if($jsonfile.$NameofProvider){
+ $jsonfile.psobject.Properties.remove($NameofProvider)
+}
+
+Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofProvider -Value $IPAddress
+
+($jsonfile | ConvertTo-Json -Depth 5).replace('\r\n',"`r`n") | Out-File ./config/dns.json
\ No newline at end of file
diff --git a/config/tweaks.json b/config/tweaks.json
index 0737812c..fba5e2f8 100644
--- a/config/tweaks.json
+++ b/config/tweaks.json
@@ -1,5 +1,5 @@
{
- "EssTweaksAH": {
+ "WPFEssTweaksAH": {
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
@@ -24,57 +24,25 @@
}
]
},
- "EssTweaksDVR": {
- "registry": [
- {
- "Path": "HKLM:\\System\\GameConfigStore",
- "Name": "GameDVR_DXGIHonorFSEWindowsCompatible",
- "Type": "Hex",
- "Value": "00000000",
- "OriginalValue": "1"
- },
- {
- "Path": "HKLM:\\System\\GameConfigStore",
- "Name": "GameDVR_HonorUserFSEBehaviorMode",
- "Type": "Hex",
- "Value": "00000000",
- "OriginalValue": "1"
- },
- {
- "Path": "HKLM:\\System\\GameConfigStore",
- "Name": "GameDVR_EFSEFeatureFlags",
- "Type": "Hex",
- "Value": "00000000",
- "OriginalValue": "1"
- },
- {
- "Path": "HKLM:\\System\\GameConfigStore",
- "Name": "GameDVR_Enabled",
- "Type": "Hex",
- "Value": "00000000",
- "OriginalValue": "1"
- }
- ]
- },
- "EssTweaksHiber": {
+ "WPFEssTweaksHiber": {
"registry": [
{
"Path": "HKLM:\\System\\CurrentControlSet\\Control\\Session Manager\\Power",
- "Name": "GameDVR_DXGIHonorFSEWindowsCompatible",
+ "Name": "HibernateEnabled",
"Type": "Dword",
"Value": "0",
"OriginalValue": "1"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings",
- "Name": "GameDVR_HonorUserFSEBehaviorMode",
+ "Name": "ShowHibernateOption",
"Type": "Dword",
"Value": "0",
"OriginalValue": "1"
}
]
},
- "EssTweaksHome": {
+ "WPFEssTweaksHome": {
"service": [
{
"Name": "HomeGroupListener",
@@ -88,7 +56,7 @@
}
]
},
- "EssTweaksLoc": {
+ "WPFEssTweaksLoc": {
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\location",
@@ -120,7 +88,7 @@
}
]
},
- "EssTweaksServices": {
+ "WPFEssTweaksServices": {
"service": [
{
"StartupType": "Manual",
@@ -464,7 +432,7 @@
}
]
},
- "EssTweaksTele": {
+ "WPFEssTweaksTele": {
"ScheduledTask": [
{
"Name": "Microsoft\\Windows\\Application Experience\\Microsoft Compatibility Appraiser",
@@ -681,74 +649,53 @@
"value": 1,
"type": "Dword"
},
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FileSystem",
+ "OriginalValue": "0",
+ "name": "LongPathsEnabled",
+ "value": 1,
+ "type": "Dword"
+ },
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DriverSearching",
"OriginalValue": "1",
"name": "SearchOrderConfig",
- "value": "00000000",
+ "value": "0",
"type": "Dword"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile",
"OriginalValue": "1",
"name": "SystemResponsiveness",
- "value": "0000000a",
+ "value": "0",
"type": "Dword"
},
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile",
"OriginalValue": "1",
"name": "NetworkThrottlingIndex",
- "value": "0000000a",
+ "value": "4294967295",
"type": "Dword"
},
{
- "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control",
- "OriginalValue": "1",
- "name": "WaitToKillServiceTimeout",
- "value": "2000",
- "type": "Dword"
- },
- {
- "Path": "HKLM:\\Control Panel\\Desktop",
+ "Path": "HKCU:\\Control Panel\\Desktop",
"OriginalValue": "1",
"name": "MenuShowDelay",
- "value": "0",
+ "value": "1",
"type": "Dword"
},
{
- "Path": "HKLM:\\Control Panel\\Desktop",
- "OriginalValue": "1",
- "name": "WaitToKillAppTimeout",
- "value": "5000",
- "type": "Dword"
- },
- {
- "Path": "HKLM:\\Control Panel\\Desktop",
+ "Path": "HKCU:\\Control Panel\\Desktop",
"OriginalValue": "1",
"name": "AutoEndTasks",
"value": "1",
"type": "Dword"
},
- {
- "Path": "HKLM:\\Control Panel\\Desktop",
- "OriginalValue": "1",
- "name": "LowLevelHooksTimeout",
- "value": "00001000",
- "type": "Dword"
- },
- {
- "Path": "HKLM:\\Control Panel\\Desktop",
- "OriginalValue": "1",
- "name": "WaitToKillServiceTimeout",
- "value": "00002000",
- "type": "Dword"
- },
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",
"OriginalValue": "0",
"name": "ClearPageFileAtShutdown",
- "value": "00000000",
+ "value": "0",
"type": "Dword"
},
{
@@ -759,11 +706,11 @@
"type": "Dword"
},
{
- "Path": "HKLM:\\Control Panel\\Mouse",
+ "Path": "HKCU:\\Control Panel\\Mouse",
"OriginalValue": "1",
"name": "MouseHoverTime",
- "value": "00000010",
- "type": "Dword"
+ "value": "400",
+ "type": "String"
},
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters",
@@ -792,6 +739,27 @@
"name": "HideSCAMeetNow",
"value": "1",
"type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile\\Tasks\\Games",
+ "OriginalValue": "1",
+ "name": "GPU Priority",
+ "value": "8",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile\\Tasks\\Games",
+ "OriginalValue": "1",
+ "name": "Priority",
+ "value": "6",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile\\Tasks\\Games",
+ "OriginalValue": "High",
+ "name": "Scheduling Category",
+ "value": "High",
+ "type": "String"
}
],
"service": [
@@ -833,10 +801,21 @@
If (Test-Path \"$autoLoggerDir\\AutoLogger-Diagtrack-Listener.etl\") {
Remove-Item \"$autoLoggerDir\\AutoLogger-Diagtrack-Listener.etl\"
}
- icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null"
+ icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null
+
+ #Timeout Tweaks cause flickering on Windows now
+ #Remove-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"WaitToKillAppTimeout\" -ErrorAction SilentlyContinue
+ #Remove-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"HungAppTimeout\" -ErrorAction SilentlyContinue
+ #Remove-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\" -Name \"WaitToKillServiceTimeout\" -ErrorAction SilentlyContinue
+ #Remove-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"LowLevelHooksTimeout\" -ErrorAction SilentlyContinue
+ #Remove-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"WaitToKillServiceTimeout\" -ErrorAction SilentlyContinue
+
+ $ram = (Get-CimInstance -ClassName \"Win32_PhysicalMemory\" | Measure-Object -Property Capacity -Sum).Sum / 1kb
+ Set-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\" -Name \"SvcHostSplitThresholdInKB\" -Type DWord -Value $ram -Force
+ "
]
},
- "EssTweaksWifi": {
+ "WPFEssTweaksWifi": {
"registry": [
{
"Path": "HKLM:\\Software\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting",
@@ -854,7 +833,7 @@
}
]
},
- "MiscTweaksLapPower": {
+ "WPFMiscTweaksLapPower": {
"registry": [
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerThrottling",
@@ -872,7 +851,7 @@
}
]
},
- "MiscTweaksPower": {
+ "WPFMiscTweaksPower": {
"registry": [
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerThrottling",
@@ -890,7 +869,7 @@
}
]
},
- "MiscTweaksExt": {
+ "WPFMiscTweaksExt": {
"registry": [
{
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
@@ -901,7 +880,7 @@
}
]
},
- "MiscTweaksUTC": {
+ "WPFMiscTweaksUTC": {
"registry": [
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
@@ -912,7 +891,7 @@
}
]
},
- "MiscTweaksDisplay": {
+ "WPFMiscTweaksDisplay": {
"registry": [
{
"path": "HKCU:\\Control Panel\\Desktop",
@@ -982,7 +961,7 @@
"Set-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"UserPreferencesMask\" -Type Binary -Value ([byte[]](144,18,3,128,16,0,0,0))"
]
},
- "EssTweaksDeBloat": {
+ "WPFEssTweaksDeBloat": {
"appx": [
"Microsoft.Microsoft3DViewer",
"Microsoft.AppConnector",
@@ -1058,142 +1037,256 @@
"*AdobePhotoshopExpress*",
"*HotspotShieldFreeVPN*",
"*Microsoft.Advertising.Xaml*"
- ]
- },
- "EssTweaksOO": {
+ ],
"InvokeScript": [
- "Import-Module BitsTransfer
- Start-BitsTransfer -Source \"https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg\" -Destination C:\\Windows\\Temp\\ooshutup10.cfg
- Start-BitsTransfer -Source \"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe\" -Destination C:\\Windows\\Temp\\OOSU10.exe
- C:\\Windows\\Temp\\OOSU10.exe C:\\Windows\\Temp\\ooshutup10.cfg /quiet"
+ "
+ $TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, 'Microsoft', 'Teams')
+ $TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, 'Update.exe')
+
+ Write-Host \"Stopping Teams process...\"
+ Stop-Process -Name \"*teams*\" -Force -ErrorAction SilentlyContinue
+
+ Write-Host \"Uninstalling Teams from AppData\\Microsoft\\Teams\"
+ if ([System.IO.File]::Exists($TeamsUpdateExePath)) {
+ # Uninstall app
+ $proc = Start-Process $TeamsUpdateExePath \"-uninstall -s\" -PassThru
+ $proc.WaitForExit()
+ }
+
+ Write-Host \"Removing Teams AppxPackage...\"
+ Get-AppxPackage \"*Teams*\" | Remove-AppxPackage -ErrorAction SilentlyContinue
+ Get-AppxPackage \"*Teams*\" -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
+
+ Write-Host \"Deleting Teams directory\"
+ if ([System.IO.Directory]::Exists($TeamsPath)) {
+ Remove-Item $TeamsPath -Force -Recurse -ErrorAction SilentlyContinue
+ }
+
+ Write-Host \"Deleting Teams uninstall registry key\"
+ # Uninstall from Uninstall registry key UninstallString
+ $us = (Get-ChildItem -Path HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall, HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like '*Teams*'}).UninstallString
+ if ($us.Length -gt 0) {
+ $us = ($us.Replace('/I', '/uninstall ') + ' /quiet').Replace(' ', ' ')
+ $FilePath = ($us.Substring(0, $us.IndexOf('.exe') + 4).Trim())
+ $ProcessArgs = ($us.Substring($us.IndexOf('.exe') + 5).Trim().replace(' ', ' '))
+ $proc = Start-Process -FilePath $FilePath -Args $ProcessArgs -PassThru
+ $proc.WaitForExit()
+ }
+ "
]
},
- "EssTweaksRP": {
+ "WPFEssTweaksOO": {
"InvokeScript": [
- "Enable-ComputerRestore -Drive \"C:\\\"
- Checkpoint-Computer -Description \"RestorePoint1\" -RestorePointType \"MODIFY_SETTINGS\""
+ "curl.exe -s \"https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/ooshutup10.cfg\" -o $ENV:temp\\ooshutup10.cfg
+ curl.exe -s \"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe\" -o $ENV:temp\\OOSU10.exe
+ Start-Process $ENV:temp\\OOSU10.exe -ArgumentList \"$ENV:temp\\ooshutup10.cfg /quiet\"
+ "
]
},
- "EssTweaksStorage": {
+ "WPFEssTweaksRP": {
+ "InvokeScript": [
+ "Enable-ComputerRestore -Drive \"$env:SystemDrive\"
+ Checkpoint-Computer -Description \"RestorePoint1\" -RestorePointType \"MODIFY_SETTINGS\""
+ ]
+ },
+ "WPFEssTweaksStorage": {
"InvokeScript": [
"Remove-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Recurse -ErrorAction SilentlyContinue"
]
},
- "MiscTweaksLapNum": {
- "InvokeScript": [
- "If (!(Test-Path \"HKU:\")) {
- New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
- }
- Set-ItemProperty -Path \"HKU:\\.DEFAULT\\Control Panel\\Keyboard\" -Name \"InitialKeyboardIndicators\" -Type DWord -Value 0"
+ "WPFMiscTweaksLapNum": {
+ "Registry": [
+ {
+ "path": "HKU:\\.DEFAULT\\Control Panel\\Keyboard",
+ "OriginalValue": "1",
+ "name": "InitialKeyboardIndicators",
+ "value": "0",
+ "type": "DWord"
+ }
]
},
- "MiscTweaksNum": {
- "InvokeScript": [
- "If (!(Test-Path \"HKU:\")) {
- New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
- }
- Set-ItemProperty -Path \"HKU:\\.DEFAULT\\Control Panel\\Keyboard\" -Name \"InitialKeyboardIndicators\" -Type DWord -Value 2"
+ "WPFMiscTweaksNum": {
+ "Registry": [
+ {
+ "path": "HKU:\\.DEFAULT\\Control Panel\\Keyboard",
+ "OriginalValue": "1",
+ "name": "InitialKeyboardIndicators",
+ "value": "80000002",
+ "type": "DWord"
+ }
]
},
- "EssTweaksRemoveEdge": {
+ "WPFEssTweaksRemoveEdge": {
"InvokeScript": [
"Invoke-WebRequest -useb https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/Edge_Removal.bat | Invoke-Expression"
]
},
- "MiscTweaksDisableNotifications": {
- "InvokeScript": [
- "New-Item -Path \"HKCU:\\Software\\Policies\\Microsoft\\Windows\" -Name \"Explorer\" -force
- New-ItemProperty -Path \"HKCU:\\Software\\Policies\\Microsoft\\Windows\\Explorer\" -Name \"DisableNotificationCenter\" -PropertyType \"DWord\" -Value 1
- New-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\" -Name \"ToastEnabled\" -PropertyType \"DWord\" -Value 0 -force"
+ "WPFMiscTweaksDisableNotifications": {
+ "registry": [
+ {
+ "Path": "HKCU:\\Software\\Policies\\Microsoft\\Windows\\Explorer",
+ "Name": "DisableNotificationCenter",
+ "Type": "DWord",
+ "Value": "1",
+ "OriginalValue": "0"
+ },
+ {
+ "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\PushNotifications",
+ "Name": "ToastEnabled",
+ "Type": "DWord",
+ "Value": "0",
+ "OriginalValue": "1"
+ }
]
},
- "MiscTweaksRightClickMenu": {
+ "WPFMiscTweaksRightClickMenu": {
"InvokeScript": [
"New-Item -Path \"HKCU:\\Software\\Classes\\CLSID\\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\" -Name \"InprocServer32\" -force -value \"\" "
]
},
- "EssTweaksDiskCleanup": {
+ "WPFEssTweaksDiskCleanup": {
"InvokeScript": [
"cleanmgr.exe /d C: /VERYLOWDISK"
]
},
- "MiscTweaksDisableTPMCheck": {
- "InvokeScript": [
- "If (!(Test-Path \"HKLM:\\SYSTEM\\Setup\\MoSetup\")) {
- New-Item -Path \"HKLM:\\SYSTEM\\Setup\\MoSetup\" -Force | Out-Null
- }
- Set-ItemProperty -Path \"HKLM:\\SYSTEM\\Setup\\MoSetup\" -Name \"AllowUpgradesWithUnsupportedTPM\" -Type DWord -Value 1"
- ]
- },
- "MiscTweaksDisableUAC": {
- "InvokeScript": [
- "# This below is the pussy mode which can break some apps. Please. Leave this on 1.
- # below i will show a way to do it without breaking some Apps that check UAC. U need to be admin tho.
- # Set-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"EnableLUA\" -Type DWord -Value 0
- Set-ItemProperty -Path HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System -Name ConsentPromptBehaviorAdmin -Type DWord -Value 0 # Default is 5
- # This will set the GPO Entry in Security so that Admin users elevate without any prompt while normal users still elevate and u can even leave it ennabled.
- # It will just not bother u anymore"
- ]
- },
- "MiscTweaksDisableMouseAcceleration": {
- "registry": [
+ "WPFMiscTweaksDisableTPMCheck": {
+ "registry": [
{
- "path": "HKCU:\\Control Panel\\Mouse",
- "OriginalValue": "1",
- "name": "MouseSpeed",
- "value": "0",
- "type": "String"
- },
- {
- "path": "HKCU:\\Control Panel\\Mouse",
- "OriginalValue": "6",
- "name": "MouseThreshold1",
- "value": "0",
- "type": "String"
- },
- {
- "path": "HKCU:\\Control Panel\\Mouse",
- "OriginalValue": "10",
- "name": "MouseThreshold2",
- "value": "0",
- "type": "String"
+ "Path": "HKLM:\\SYSTEM\\Setup\\MoSetup",
+ "Name": "AllowUpgradesWithUnsupportedTPM",
+ "Type": "DWord",
+ "Value": "1",
+ "OriginalValue": "0"
}
]
},
- "MiscTweaksEnableMouseAcceleration": {
- "registry": [
+ "WPFMiscTweaksDisableUAC": {
+ "registry": [
{
- "path": "HKCU:\\Control Panel\\Mouse",
- "OriginalValue": "1",
- "name": "MouseSpeed",
- "value": "1",
- "type": "String"
- },
- {
- "path": "HKCU:\\Control Panel\\Mouse",
- "OriginalValue": "6",
- "name": "MouseThreshold1",
- "value": "6",
- "type": "String"
- },
- {
- "path": "HKCU:\\Control Panel\\Mouse",
- "OriginalValue": "10",
- "name": "MouseThreshold2",
- "value": "10",
- "type": "String"
+ "path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",
+ "OriginalValue": "5",
+ "name": "ConsentPromptBehaviorAdmin",
+ "value": "0",
+ "type": "DWord"
}
]
},
- "EssTweaksDeleteTempFiles": {
+ "WPFMiscTweaksDisableMouseAcceleration": {
+ "registry": [
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "1",
+ "name": "MouseSpeed",
+ "value": "0",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "6",
+ "name": "MouseThreshold1",
+ "value": "0",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "10",
+ "name": "MouseThreshold2",
+ "value": "0",
+ "type": "String"
+ }
+ ]
+ },
+ "WPFMiscTweaksEnableMouseAcceleration": {
+ "registry": [
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "1",
+ "name": "MouseSpeed",
+ "value": "1",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "6",
+ "name": "MouseThreshold1",
+ "value": "6",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "10",
+ "name": "MouseThreshold2",
+ "value": "10",
+ "type": "String"
+ }
+ ]
+ },
+ "WPFEssTweaksDeleteTempFiles": {
"InvokeScript": [
"Get-ChildItem -Path \"C:\\Windows\\Temp\" *.* -Recurse | Remove-Item -Force -Recurse
Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse"
]
},
- "EssTweaksRemoveCortana": {
+ "WPFEssTweaksRemoveCortana": {
"InvokeScript": [
"Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage"
]
+ },
+ "WPFEssTweaksDVR": {
+ "registry": [
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_FSEBehavior",
+ "Value": "2",
+ "OriginalValue": "1",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_Enabled",
+ "Value": "0",
+ "OriginalValue": "1",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_DXGIHonorFSEWindowsCompatible",
+ "Value": "1",
+ "OriginalValue": "0",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_HonorUserFSEBehaviorMode",
+ "Value": "1",
+ "OriginalValue": "0",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_EFSEFeatureFlags",
+ "Value": "0",
+ "OriginalValue": "1",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR",
+ "Name": "AllowGameDVR",
+ "Value": "0",
+ "OriginalValue": "1",
+ "Type": "DWord"
+ }
+ ]
+ },
+ "WPFBingSearch": {
+ "registry": [
+ {
+ "OriginalValue": "1",
+ "Name": "BingSearchEnabled",
+ "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Search",
+ "Type": "DWORD",
+ "Value": "0"
+ }
+ ]
}
}
diff --git a/functions/private/Get-WinUtilCheckBoxes.ps1 b/functions/private/Get-WinUtilCheckBoxes.ps1
new file mode 100644
index 00000000..a227da62
--- /dev/null
+++ b/functions/private/Get-WinUtilCheckBoxes.ps1
@@ -0,0 +1,52 @@
+Function Get-WinUtilCheckBoxes {
+
+ <#
+
+ .DESCRIPTION
+ Function is meant to find all checkboxes that are checked on the specefic tab and input them into a script.
+
+ Outputed data will be the names of the checkboxes that were checked
+
+ .EXAMPLE
+
+ Get-WinUtilCheckBoxes "WPFInstall"
+
+ #>
+
+ Param(
+ $Group,
+ [boolean]$unCheck = $true
+ )
+
+
+ $Output = New-Object System.Collections.Generic.List[System.Object]
+
+ if($Group -eq "WPFInstall"){
+ $CheckBoxes = get-variable | Where-Object {$psitem.name -like "WPFInstall*" -and $psitem.value.GetType().name -eq "CheckBox"}
+ Foreach ($CheckBox in $CheckBoxes){
+ if($CheckBox.value.ischecked -eq $true){
+ $sync.configs.applications.$($CheckBox.name).winget -split ";" | ForEach-Object {
+ $Output.Add($psitem)
+ }
+ if ($uncheck -eq $true){
+ $CheckBox.value.ischecked = $false
+ }
+
+ }
+ }
+ }
+ if($Group -eq "WPFTweaks"){
+ $CheckBoxes = get-variable | Where-Object {$psitem.name -like "WPF*Tweaks*" -and $psitem.value.GetType().name -eq "CheckBox"}
+ Foreach ($CheckBox in $CheckBoxes){
+ if($CheckBox.value.ischecked -eq $true){
+ $Output.Add($Checkbox.Name)
+
+ if ($uncheck -eq $true){
+ $CheckBox.value.ischecked = $false
+ }
+ }
+ }
+ }
+
+ Write-Output $($Output | Select-Object -Unique)
+}
diff --git a/functions/private/Get-WinUtilDarkMode.ps1 b/functions/private/Get-WinUtilDarkMode.ps1
new file mode 100644
index 00000000..bc2fab83
--- /dev/null
+++ b/functions/private/Get-WinUtilDarkMode.ps1
@@ -0,0 +1,16 @@
+Function Get-WinUtilDarkMode {
+ <#
+
+ .DESCRIPTION
+ Meant to pull the registry keys responsible for Dark Mode and returns true or false
+
+ #>
+ $app = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
+ $system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
+ if($app -eq 0 -and $system -eq 0){
+ return $true
+ }
+ else{
+ return $false
+ }
+}
\ No newline at end of file
diff --git a/functions/private/Get-WinUtilInstallerProcess.ps1 b/functions/private/Get-WinUtilInstallerProcess.ps1
new file mode 100644
index 00000000..a297b539
--- /dev/null
+++ b/functions/private/Get-WinUtilInstallerProcess.ps1
@@ -0,0 +1,18 @@
+function Get-WinUtilInstallerProcess {
+ <#
+
+ .DESCRIPTION
+ Meant to check for running processes and will return a boolean response
+
+ #>
+
+ param($Process)
+
+ if ($Null -eq $Process){
+ return $false
+ }
+ if (Get-Process -Id $Process.Id -ErrorAction SilentlyContinue){
+ return $true
+ }
+ return $false
+}
\ No newline at end of file
diff --git a/functions/private/Install-WinUtilChoco.ps1 b/functions/private/Install-WinUtilChoco.ps1
new file mode 100644
index 00000000..9585858d
--- /dev/null
+++ b/functions/private/Install-WinUtilChoco.ps1
@@ -0,0 +1,30 @@
+function Install-WinUtilChoco {
+
+ <#
+
+ .DESCRIPTION
+ Function is meant to ensure Choco is installed
+
+ #>
+
+ try{
+ Write-Host "Checking if Chocolatey is Installed..."
+
+ if((Test-WinUtilPackageManager -choco)){
+ Write-Host "Chocolatey Already Installed"
+ return
+ }
+
+ Write-Host "Seems Chocolatey is not installed, installing now?"
+ #Let user decide if he wants to install Chocolatey
+ $confirmation = Read-Host "Are you Sure You Want To Proceed:(y/n)"
+ if ($confirmation -eq 'y') {
+ Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
+ powershell choco feature enable -n allowGlobalConfirmation
+ }
+ }
+ Catch{
+ throw [ChocoFailedInstall]::new('Failed to install')
+ }
+
+}
diff --git a/functions/private/Install-WinUtilProgramWinget.ps1 b/functions/private/Install-WinUtilProgramWinget.ps1
new file mode 100644
index 00000000..798ea339
--- /dev/null
+++ b/functions/private/Install-WinUtilProgramWinget.ps1
@@ -0,0 +1,28 @@
+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.
+
+ #>
+
+ param($ProgramsToInstall)
+
+ $x = 0
+ $count = $($ProgramsToInstall -split ",").Count
+
+ Write-Progress -Activity "Installing Applications" -Status "Starting" -PercentComplete 0
+
+ Foreach ($Program in $($ProgramsToInstall -split ",")){
+
+ Write-Progress -Activity "Installing Applications" -Status "Installing $Program $($x + 1) of $count" -PercentComplete $($x/$count*100)
+ Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --silent $Program" -NoNewWindow -Wait;
+ $X++
+ }
+
+ Write-Progress -Activity "Installing Applications" -Status "Finished" -Completed
+
+}
diff --git a/functions/private/Install-WinUtilWinget.ps1 b/functions/private/Install-WinUtilWinget.ps1
new file mode 100644
index 00000000..9a15041d
--- /dev/null
+++ b/functions/private/Install-WinUtilWinget.ps1
@@ -0,0 +1,68 @@
+function Install-WinUtilWinget {
+
+ <#
+
+ .DESCRIPTION
+ Function is meant to ensure winget is installed
+
+ #>
+ Try{
+ Write-Host "Checking if Winget is Installed..."
+ if (Test-WinUtilPackageManager -winget) {
+ #Checks if winget executable exists and if the Windows Version is 1809 or higher
+ Write-Host "Winget Already Installed"
+ return
+ }
+
+ #Gets the computer's information
+ if ($null -eq $sync.ComputerInfo){
+ $ComputerInfo = Get-ComputerInfo -ErrorAction Stop
+ }
+ Else {
+ $ComputerInfo = $sync.ComputerInfo
+ }
+
+ if (($ComputerInfo.WindowsVersion) -lt "1809") {
+ #Checks if Windows Version is too old for winget
+ Write-Host "Winget is not supported on this version of Windows (Pre-1809)"
+ return
+ }
+
+ #Gets the Windows Edition
+ $OSName = if ($ComputerInfo.OSName) {
+ $ComputerInfo.OSName
+ }else {
+ $ComputerInfo.WindowsProductName
+ }
+
+ if (((($OSName.IndexOf("LTSC")) -ne -1) -or ($OSName.IndexOf("Server") -ne -1)) -and (($ComputerInfo.WindowsVersion) -ge "1809")) {
+
+ Write-Host "Running Alternative Installer for LTSC/Server Editions"
+
+ # Switching to winget-install from PSGallery from asheroto
+ # Source: https://github.com/asheroto/winget-installer
+
+ Start-Process powershell.exe -Verb RunAs -ArgumentList "-command irm https://raw.githubusercontent.com/ChrisTitusTech/winutil/$BranchToUse/winget.ps1 | iex | Out-Host" -WindowStyle Normal -ErrorAction Stop
+
+ if(!(Test-WinUtilPackageManager -winget)){
+ break
+ }
+ }
+
+ else {
+ #Installing Winget from the Microsoft Store
+ Write-Host "Winget not found, installing it now."
+ Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
+ $nid = (Get-Process AppInstaller).Id
+ Wait-Process -Id $nid
+
+ if(!(Test-WinUtilPackageManager -winget)){
+ break
+ }
+ }
+ Write-Host "Winget Installed"
+ }
+ Catch{
+ throw [WingetFailedInstall]::new('Failed to install')
+ }
+}
diff --git a/functions/private/Invoke-WinUtilScript.ps1 b/functions/private/Invoke-WinUtilScript.ps1
new file mode 100644
index 00000000..1bee592b
--- /dev/null
+++ b/functions/private/Invoke-WinUtilScript.ps1
@@ -0,0 +1,26 @@
+function Invoke-WinUtilScript {
+ <#
+
+ .DESCRIPTION
+ This function will run a seperate powershell script. Meant for things that can't be handled with the other functions
+
+ .EXAMPLE
+
+ $Scriptblock = [scriptblock]::Create({"Write-output 'Hello World'"})
+ Invoke-WinUtilScript -ScriptBlock $scriptblock -Name "Hello World"
+
+ #>
+ param (
+ $Name,
+ [scriptblock]$scriptblock
+ )
+
+ Try{
+ Invoke-Command $scriptblock -ErrorAction stop
+ Write-Host "Running Script for $name"
+ }
+ Catch{
+ Write-Warning "Unable to run script for $name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
\ No newline at end of file
diff --git a/functions/private/Invoke-WinUtilTweaks.ps1 b/functions/private/Invoke-WinUtilTweaks.ps1
new file mode 100644
index 00000000..61f10e10
--- /dev/null
+++ b/functions/private/Invoke-WinUtilTweaks.ps1
@@ -0,0 +1,57 @@
+function Invoke-WinUtilTweaks {
+ <#
+
+ .DESCRIPTION
+ This function converts all the values from the tweaks.json and routes them to the appropriate function
+
+ #>
+
+ param(
+ $CheckBox,
+ $undo = $false
+ )
+ if($undo){
+ $Values = @{
+ Registry = "OriginalValue"
+ ScheduledTask = "OriginalState"
+ Service = "OriginalType"
+ }
+ }
+ Else{
+ $Values = @{
+ Registry = "Value"
+ ScheduledTask = "State"
+ Service = "StartupType"
+ }
+ }
+
+ if($sync.configs.tweaks.$CheckBox.registry){
+ $sync.configs.tweaks.$CheckBox.registry | ForEach-Object {
+ Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
+ }
+ }
+ if($sync.configs.tweaks.$CheckBox.ScheduledTask){
+ $sync.configs.tweaks.$CheckBox.ScheduledTask | ForEach-Object {
+ Set-WinUtilScheduledTask -Name $psitem.Name -State $psitem.$($values.ScheduledTask)
+ }
+ }
+ if($sync.configs.tweaks.$CheckBox.service){
+ $sync.configs.tweaks.$CheckBox.service | ForEach-Object {
+ Set-WinUtilService -Name $psitem.Name -StartupType $psitem.$($values.Service)
+ }
+ }
+
+ if(!$undo){
+ if($sync.configs.tweaks.$CheckBox.appx){
+ $sync.configs.tweaks.$CheckBox.appx | ForEach-Object {
+ Remove-WinUtilAPPX -Name $psitem
+ }
+ }
+ if($sync.configs.tweaks.$CheckBox.InvokeScript){
+ $sync.configs.tweaks.$CheckBox.InvokeScript | ForEach-Object {
+ $Scriptblock = [scriptblock]::Create($psitem)
+ Invoke-WinUtilScript -ScriptBlock $scriptblock -Name $CheckBox
+ }
+ }
+ }
+}
diff --git a/functions/private/Remove-WinUtilAPPX.ps1 b/functions/private/Remove-WinUtilAPPX.ps1
new file mode 100644
index 00000000..dd6c25bd
--- /dev/null
+++ b/functions/private/Remove-WinUtilAPPX.ps1
@@ -0,0 +1,34 @@
+function Remove-WinUtilAPPX {
+ <#
+
+ .DESCRIPTION
+ This function will remove any of the provided APPX names
+
+ .EXAMPLE
+
+ Remove-WinUtilAPPX -Name "Microsoft.Microsoft3DViewer"
+
+ #>
+ param (
+ $Name
+ )
+
+ Try{
+ Write-Host "Removing $Name"
+ Get-AppxPackage "*$Name*" | Remove-AppxPackage -ErrorAction SilentlyContinue
+ Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*$Name*" | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
+ }
+ Catch [System.Exception] {
+ if($psitem.Exception.Message -like "*The requested operation requires elevation*"){
+ Write-Warning "Unable to uninstall $name due to a Security Exception"
+ }
+ Else{
+ Write-Warning "Unable to uninstall $name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+ }
+ Catch{
+ Write-Warning "Unable to uninstall $name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
\ No newline at end of file
diff --git a/functions/private/Set-WinUtilDNS.ps1 b/functions/private/Set-WinUtilDNS.ps1
new file mode 100644
index 00000000..daf7e752
--- /dev/null
+++ b/functions/private/Set-WinUtilDNS.ps1
@@ -0,0 +1,32 @@
+function Set-WinUtilDNS {
+ <#
+
+ .DESCRIPTION
+ This function will set the DNS of all interfaces that are in the "Up" state. It will lookup the values from the DNS.Json file
+
+ .EXAMPLE
+
+ Set-WinUtilDNS -DNSProvider "google"
+
+ #>
+ param($DNSProvider)
+ if($DNSProvider -eq "Default"){return}
+ Try{
+ $Adapters = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
+ Write-Host "Ensuring DNS is set to $DNSProvider on the following interfaces"
+ Write-Host $($Adapters | Out-String)
+
+ Foreach ($Adapter in $Adapters){
+ if($DNSProvider -eq "DHCP"){
+ Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ResetServerAddresses
+ }
+ Else{
+ Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ("$($sync.configs.dns.$DNSProvider.Primary)", "$($sync.configs.dns.$DNSProvider.Secondary)")
+ }
+ }
+ }
+ Catch{
+ Write-Warning "Unable to set DNS Provider due to an unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
diff --git a/functions/private/Set-WinUtilRegistry.ps1 b/functions/private/Set-WinUtilRegistry.ps1
new file mode 100644
index 00000000..58be4345
--- /dev/null
+++ b/functions/private/Set-WinUtilRegistry.ps1
@@ -0,0 +1,40 @@
+function Set-WinUtilRegistry {
+ <#
+
+ .DESCRIPTION
+ This function will make all modifications to the registry
+
+ .EXAMPLE
+
+ Set-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0"
+
+ #>
+ param (
+ $Name,
+ $Path,
+ $Type,
+ $Value
+ )
+
+ Try{
+ if(!(Test-Path 'HKU:\')){New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS}
+
+ If (!(Test-Path $Path)) {
+ Write-Host "$Path was not found, Creating..."
+ New-Item -Path $Path -Force -ErrorAction Stop | Out-Null
+ }
+
+ Write-Host "Set $Path\$Name to $Value"
+ Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
+ }
+ Catch [System.Security.SecurityException] {
+ Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
+ }
+ Catch [System.Management.Automation.ItemNotFoundException] {
+ Write-Warning $psitem.Exception.ErrorRecord
+ }
+ Catch{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
diff --git a/functions/private/Set-WinUtilScheduledTask.ps1 b/functions/private/Set-WinUtilScheduledTask.ps1
new file mode 100644
index 00000000..fc1c07e3
--- /dev/null
+++ b/functions/private/Set-WinUtilScheduledTask.ps1
@@ -0,0 +1,40 @@
+function Set-WinUtilScheduledTask {
+ <#
+
+ .DESCRIPTION
+ This function will enable/disable the provided Scheduled Task
+
+ .EXAMPLE
+
+ Set-WinUtilScheduledTask -Name "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" -State "Disabled"
+
+ #>
+ param (
+ $Name,
+ $State
+ )
+
+ Try{
+ if($State -eq "Disabled"){
+ Write-Host "Disabling Scheduled Task $Name"
+ Disable-ScheduledTask -TaskName $Name -ErrorAction Stop
+ }
+ if($State -eq "Enabled"){
+ Write-Host "Enabling Scheduled Task $Name"
+ Enable-ScheduledTask -TaskName $Name -ErrorAction Stop
+ }
+ }
+ Catch [System.Exception]{
+ if($psitem.Exception.Message -like "*The system cannot find the file specified*"){
+ Write-Warning "Scheduled Task $name was not Found"
+ }
+ Else{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.Message
+ }
+ }
+ Catch{
+ Write-Warning "Unable to run script for $name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
\ No newline at end of file
diff --git a/functions/private/Set-WinUtilService.ps1 b/functions/private/Set-WinUtilService.ps1
new file mode 100644
index 00000000..cb2ec79e
--- /dev/null
+++ b/functions/private/Set-WinUtilService.ps1
@@ -0,0 +1,43 @@
+Function Set-WinUtilService {
+ <#
+
+ .DESCRIPTION
+ This function will change the startup type of services and start/stop them as needed
+
+ .EXAMPLE
+
+ Set-WinUtilService -Name "HomeGroupListener" -StartupType "Manual"
+
+ #>
+ param (
+ $Name,
+ $StartupType
+ )
+ Try{
+ Write-Host "Setting Services $Name to $StartupType"
+ Set-Service -Name $Name -StartupType $StartupType -ErrorAction Stop
+
+ if($StartupType -eq "Disabled"){
+ Write-Host "Stopping $Name"
+ Stop-Service -Name $Name -Force -ErrorAction Stop
+ }
+ if($StartupType -eq "Enabled"){
+ Write-Host "Starting $Name"
+ Start-Service -Name $Name -Force -ErrorAction Stop
+ }
+ }
+ Catch [System.Exception]{
+ if($psitem.Exception.Message -like "*Cannot find any service with service name*" -or
+ $psitem.Exception.Message -like "*was not found on computer*"){
+ Write-Warning "Service $name was not Found"
+ }
+ Else{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.Message
+ }
+ }
+ Catch{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
diff --git a/functions/private/Test-WinUtilPackageManager.ps1 b/functions/private/Test-WinUtilPackageManager.ps1
new file mode 100644
index 00000000..f1054c3a
--- /dev/null
+++ b/functions/private/Test-WinUtilPackageManager.ps1
@@ -0,0 +1,27 @@
+function Test-WinUtilPackageManager {
+ <#
+
+ .DESCRIPTION
+ Checks for Winget or Choco depending on the paramater
+
+ #>
+
+ Param(
+ [System.Management.Automation.SwitchParameter]$winget,
+ [System.Management.Automation.SwitchParameter]$choco
+ )
+
+ if($winget){
+ if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) {
+ return $true
+ }
+ }
+
+ if($choco){
+ if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)){
+ return $true
+ }
+ }
+
+ return $false
+}
\ No newline at end of file
diff --git a/functions/private/Update-WinUtilProgramWinget.ps1 b/functions/private/Update-WinUtilProgramWinget.ps1
new file mode 100644
index 00000000..6835972f
--- /dev/null
+++ b/functions/private/Update-WinUtilProgramWinget.ps1
@@ -0,0 +1,22 @@
+Function Update-WinUtilProgramWinget {
+
+ <#
+
+ .DESCRIPTION
+ This will update programs via Winget using a new powershell.exe instance to prevent the GUI from locking up.
+
+ #>
+
+ [ScriptBlock]$wingetinstall = {
+
+ $host.ui.RawUI.WindowTitle = """Winget Install"""
+
+ Start-Transcript $ENV:TEMP\winget-update.log -Append
+ winget upgrade --all
+
+ Pause
+ }
+
+ $global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru
+
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1
new file mode 100644
index 00000000..07cf642f
--- /dev/null
+++ b/functions/public/Invoke-WPFButton.ps1
@@ -0,0 +1,49 @@
+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
+ #[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")
+
+ Switch -Wildcard ($Button){
+
+ "WPFTab?BT" {Invoke-WPFTab $Button}
+ "WPFinstall" {Invoke-WPFInstall}
+ "WPFInstallUpgrade" {Invoke-WPFInstallUpgrade}
+ "WPFdesktop" {Invoke-WPFPresets "Desktop"}
+ "WPFlaptop" {Invoke-WPFPresets "laptop"}
+ "WPFminimal" {Invoke-WPFPresets "minimal"}
+ "WPFexport" {Invoke-WPFImpex -type "export"}
+ "WPFimport" {Invoke-WPFImpex -type "import"}
+ "WPFclear" {Invoke-WPFPresets -preset $null -imported $true}
+ "WPFtweaksbutton" {Invoke-WPFtweaksbutton}
+ "WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enabled"}
+ "WPFRemoveUltPerf" {Invoke-WPFUltimatePerformance -State "Disabled"}
+ "WPFToggleDarkMode" {Invoke-WPFDarkMode -DarkMoveEnabled $(Get-WinUtilDarkMode)}
+ "WPFundoall" {Invoke-WPFundoall}
+ "WPFFeatureInstall" {Invoke-WPFFeatureInstall}
+ "WPFPanelDISM" {Invoke-WPFPanelDISM}
+ "WPFPanelAutologin" {Invoke-WPFPanelAutologin}
+ "WPFPanelcontrol" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPanelnetwork" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPanelpower" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPanelsound" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPaneluser" {Invoke-WPFControlPanel -Panel $button}
+ "WPFUpdatesdefault" {Invoke-WPFUpdatesdefault}
+ "WPFFixesUpdate" {Invoke-WPFFixesUpdate}
+ "WPFUpdatesdisable" {Invoke-WPFUpdatesdisable}
+ "WPFUpdatessecurity" {Invoke-WPFUpdatessecurity}
+
+
+ }
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFControlPanel.ps1 b/functions/public/Invoke-WPFControlPanel.ps1
new file mode 100644
index 00000000..07ecbe6a
--- /dev/null
+++ b/functions/public/Invoke-WPFControlPanel.ps1
@@ -0,0 +1,18 @@
+function Invoke-WPFControlPanel {
+ <#
+
+ .DESCRIPTION
+ Simple Switch for lagacy windows
+
+ #>
+ param($Panel)
+
+ switch ($Panel){
+ "WPFPanelcontrol" {cmd /c control}
+ "WPFPanelnetwork" {cmd /c ncpa.cpl}
+ "WPFPanelpower" {cmd /c powercfg.cpl}
+ "WPFPanelsound" {cmd /c mmsys.cpl}
+ "WPFPanelsystem" {cmd /c sysdm.cpl}
+ "WPFPaneluser" {cmd /c "control userpasswords2"}
+ }
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFDarkMode.ps1 b/functions/public/Invoke-WPFDarkMode.ps1
new file mode 100644
index 00000000..fd7753b7
--- /dev/null
+++ b/functions/public/Invoke-WPFDarkMode.ps1
@@ -0,0 +1,33 @@
+Function Invoke-WPFDarkMode {
+ <#
+
+ .DESCRIPTION
+ Sets Dark Mode on or off
+
+ #>
+ Param($DarkMoveEnabled)
+ Try{
+ if ($DarkMoveEnabled -eq $false){
+ Write-Host "Enabling Dark Mode"
+ $DarkMoveValue = 0
+ }
+ else {
+ Write-Host "Disabling Dark Mode"
+ $DarkMoveValue = 1
+ }
+
+ $Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
+ Set-ItemProperty -Path $Theme -Name AppsUseLightTheme -Value $DarkMoveValue
+ Set-ItemProperty -Path $Theme -Name SystemUsesLightTheme -Value $DarkMoveValue
+ }
+ Catch [System.Security.SecurityException] {
+ Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
+ }
+ Catch [System.Management.Automation.ItemNotFoundException] {
+ Write-Warning $psitem.Exception.ErrorRecord
+ }
+ Catch{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFFeatureInstall.ps1 b/functions/public/Invoke-WPFFeatureInstall.ps1
new file mode 100644
index 00000000..3cc3488b
--- /dev/null
+++ b/functions/public/Invoke-WPFFeatureInstall.ps1
@@ -0,0 +1,56 @@
+function Invoke-WPFFeatureInstall {
+ <#
+
+ .DESCRIPTION
+ GUI Function to install Windows Features
+
+ #>
+ If ( $WPFFeaturesdotnet.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "NetFx4-AdvSrvs" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -All -NoRestart
+ }
+ If ( $WPFFeatureshyperv.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "HypervisorPlatform" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-All" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Tools-All" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Management-PowerShell" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Hypervisor" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Services" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Management-Clients" -All -NoRestart
+ cmd /c bcdedit /set hypervisorschedulertype classic
+ Write-Host "HyperV is now installed and configured. Please Reboot before using."
+ }
+ If ( $WPFFeatureslegacymedia.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "MediaPlayback" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "DirectPlay" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "LegacyComponents" -All -NoRestart
+ }
+ If ( $WPFFeaturewsl.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -All -NoRestart
+ Write-Host "WSL is now installed and configured. Please Reboot before using."
+ }
+ If ( $WPFFeaturenfs.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "ServicesForNFS-ClientOnly" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "ClientForNFS-Infrastructure" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "NFS-Administration" -All -NoRestart
+ nfsadmin client stop
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default" -Name "AnonymousUID" -Type DWord -Value 0
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default" -Name "AnonymousGID" -Type DWord -Value 0
+ nfsadmin client start
+ nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i
+ Write-Host "NFS is now setup for user based NFS mounts"
+ }
+ $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)
+
+ Write-Host "================================="
+ Write-Host "--- Features are Installed ---"
+ Write-Host "================================="
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFFixesUpdate.ps1 b/functions/public/Invoke-WPFFixesUpdate.ps1
new file mode 100644
index 00000000..6aace97e
--- /dev/null
+++ b/functions/public/Invoke-WPFFixesUpdate.ps1
@@ -0,0 +1,111 @@
+function Invoke-WPFFixesUpdate {
+
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+
+ ### Reset Windows Update Script - reregister dlls, services, and remove registry entires.
+ Write-Host "1. Stopping Windows Update Services..."
+ Stop-Service -Name BITS
+ Stop-Service -Name wuauserv
+ Stop-Service -Name appidsvc
+ Stop-Service -Name cryptsvc
+
+ Write-Host "2. Remove QMGR Data file..."
+ Remove-Item "$env:allusersprofile\Application Data\Microsoft\Network\Downloader\qmgr*.dat" -ErrorAction SilentlyContinue
+
+ Write-Host "3. Renaming the Software Distribution and CatRoot Folder..."
+ Rename-Item $env:systemroot\SoftwareDistribution SoftwareDistribution.bak -ErrorAction SilentlyContinue
+ Rename-Item $env:systemroot\System32\Catroot2 catroot2.bak -ErrorAction SilentlyContinue
+
+ Write-Host "4. Removing old Windows Update log..."
+ Remove-Item $env:systemroot\WindowsUpdate.log -ErrorAction SilentlyContinue
+
+ Write-Host "5. Resetting the Windows Update Services to defualt settings..."
+ "sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
+ "sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
+ Set-Location $env:systemroot\system32
+
+ Write-Host "6. Registering some DLLs..."
+ regsvr32.exe /s atl.dll
+ regsvr32.exe /s urlmon.dll
+ regsvr32.exe /s mshtml.dll
+ regsvr32.exe /s shdocvw.dll
+ regsvr32.exe /s browseui.dll
+ regsvr32.exe /s jscript.dll
+ regsvr32.exe /s vbscript.dll
+ regsvr32.exe /s scrrun.dll
+ regsvr32.exe /s msxml.dll
+ regsvr32.exe /s msxml3.dll
+ regsvr32.exe /s msxml6.dll
+ regsvr32.exe /s actxprxy.dll
+ regsvr32.exe /s softpub.dll
+ regsvr32.exe /s wintrust.dll
+ regsvr32.exe /s dssenh.dll
+ regsvr32.exe /s rsaenh.dll
+ regsvr32.exe /s gpkcsp.dll
+ regsvr32.exe /s sccbase.dll
+ regsvr32.exe /s slbcsp.dll
+ regsvr32.exe /s cryptdlg.dll
+ regsvr32.exe /s oleaut32.dll
+ regsvr32.exe /s ole32.dll
+ regsvr32.exe /s shell32.dll
+ regsvr32.exe /s initpki.dll
+ regsvr32.exe /s wuapi.dll
+ regsvr32.exe /s wuaueng.dll
+ regsvr32.exe /s wuaueng1.dll
+ regsvr32.exe /s wucltui.dll
+ regsvr32.exe /s wups.dll
+ regsvr32.exe /s wups2.dll
+ regsvr32.exe /s wuweb.dll
+ regsvr32.exe /s qmgr.dll
+ regsvr32.exe /s qmgrprxy.dll
+ regsvr32.exe /s wucltux.dll
+ regsvr32.exe /s muweb.dll
+ regsvr32.exe /s wuwebv.dll
+
+ Write-Host "7) Removing WSUS client settings..."
+ REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f
+ REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f
+ REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f
+
+ Write-Host "8) Resetting the WinSock..."
+ netsh winsock reset
+ netsh winhttp reset proxy
+ netsh int ip reset
+
+ Write-Host "9) Delete all BITS jobs..."
+ Get-BitsTransfer | Remove-BitsTransfer
+
+ Write-Host "10) Attempting to install the Windows Update Agent..."
+ If ([System.Environment]::Is64BitOperatingSystem) {
+ wusa Windows8-RT-KB2937636-x64 /quiet
+ }
+ else {
+ wusa Windows8-RT-KB2937636-x86 /quiet
+ }
+
+ Write-Host "11) Starting Windows Update Services..."
+ Start-Service -Name BITS
+ Start-Service -Name wuauserv
+ Start-Service -Name appidsvc
+ Start-Service -Name cryptsvc
+
+ Write-Host "12) Forcing discovery..."
+ wuauclt /resetauthorization /detectnow
+
+ Write-Host "Process complete. Please reboot your computer."
+
+ $ButtonType = [System.Windows.MessageBoxButton]::OK
+ $MessageboxTitle = "Reset Windows Update "
+ $Messageboxbody = ("Stock settings loaded.`n Please reboot your computer")
+ $MessageIcon = [System.Windows.MessageBoxImage]::Information
+
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+ Write-Host "================================="
+ Write-Host "-- Reset ALL Updates to Factory -"
+ Write-Host "================================="
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFFormVariables.ps1 b/functions/public/Invoke-WPFFormVariables.ps1
new file mode 100644
index 00000000..f2e4a3d2
--- /dev/null
+++ b/functions/public/Invoke-WPFFormVariables.ps1
@@ -0,0 +1,37 @@
+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 }
+
+
+ Write-Host ""
+ Write-Host " CCCCCCCCCCCCCTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT "
+ Write-Host " CCC::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
+ Write-Host "CC:::::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
+ Write-Host "C:::::CCCCCCCC::::CT:::::TT:::::::TT:::::TT:::::TT:::::::TT:::::T "
+ Write-Host "C:::::C CCCCCCTTTTTT T:::::T TTTTTTTTTTTT T:::::T TTTTTT"
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C CCCCCC T:::::T T:::::T "
+ Write-Host "C:::::CCCCCCCC::::C TT:::::::TT TT:::::::TT "
+ Write-Host "CC:::::::::::::::C T:::::::::T T:::::::::T "
+ Write-Host "CCC::::::::::::C T:::::::::T T:::::::::T "
+ Write-Host " CCCCCCCCCCCCC TTTTTTTTTTT TTTTTTTTTTT "
+ Write-Host ""
+ Write-Host "====Chris Titus Tech====="
+ Write-Host "=====Windows Toolbox====="
+
+
+ #====DEBUG GUI Elements====
+
+ #Write-Host "Found the following interactable elements from our form" -ForegroundColor Cyan
+ #get-variable WPF*
+}
diff --git a/functions/public/Invoke-WPFImpex.ps1 b/functions/public/Invoke-WPFImpex.ps1
new file mode 100644
index 00000000..2c1f832b
--- /dev/null
+++ b/functions/public/Invoke-WPFImpex.ps1
@@ -0,0 +1,37 @@
+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)
+
+ if ($type -eq "export"){
+ $FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
+ }
+ if ($type -eq "import"){
+ $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
+ }
+
+ $FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
+ $FileBrowser.Filter = "JSON Files (*.json)|*.json"
+ $FileBrowser.ShowDialog() | Out-Null
+
+ if($FileBrowser.FileName -eq ""){
+ return
+ }
+
+ if ($type -eq "export"){
+ $jsonFile = Get-WinUtilCheckBoxes WPFTweaks -unCheck $false
+ $jsonFile | ConvertTo-Json | Out-File $FileBrowser.FileName -Force
+ }
+ if ($type -eq "import"){
+ $jsonFile = Get-Content $FileBrowser.FileName | ConvertFrom-Json
+ Invoke-WPFPresets -preset $jsonFile -imported $true
+ }
+}
diff --git a/functions/public/Invoke-WPFInstall.ps1 b/functions/public/Invoke-WPFInstall.ps1
new file mode 100644
index 00000000..484f4b27
--- /dev/null
+++ b/functions/public/Invoke-WPFInstall.ps1
@@ -0,0 +1,52 @@
+function Invoke-WPFInstall {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+
+ if($sync.ProcessRunning){
+ $msg = "Install process is currently running."
+ [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+ }
+
+ $WingetInstall = Get-WinUtilCheckBoxes -Group "WPFInstall"
+
+ if ($wingetinstall.Count -eq 0) {
+ $WarningMsg = "Please select the program(s) to install"
+ [System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+ }
+
+ Invoke-WPFRunspace -ArgumentList $WingetInstall -scriptblock {
+ param($WingetInstall)
+ try{
+ $sync.ProcessRunning = $true
+
+ # Ensure winget is installed
+ Install-WinUtilWinget
+
+ # Install all winget 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 "==========================================="
+ Write-Host "-- Installs have finished ---"
+ Write-Host "==========================================="
+ }
+ Catch {
+ Write-Host "==========================================="
+ Write-Host "-- Winget failed to install ---"
+ Write-Host "==========================================="
+ }
+ $sync.ProcessRunning = $False
+ }
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFInstallUpgrade.ps1 b/functions/public/Invoke-WPFInstallUpgrade.ps1
new file mode 100644
index 00000000..0e49cf0d
--- /dev/null
+++ b/functions/public/Invoke-WPFInstallUpgrade.ps1
@@ -0,0 +1,27 @@
+function Invoke-WPFInstallUpgrade {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+ if(!(Test-WinUtilPackageManager -winget)){
+ Write-Host "==========================================="
+ Write-Host "-- Winget is not installed ---"
+ Write-Host "==========================================="
+ return
+ }
+
+ if(Get-WinUtilInstallerProcess -Process $global:WinGetInstall){
+ $msg = "Install process is currently running. Please check for a powershell window labled 'Winget Install'"
+ [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+ }
+
+ Update-WinUtilProgramWinget
+
+ Write-Host "==========================================="
+ Write-Host "-- Updates started ---"
+ Write-Host "-- You can close this window if desired ---"
+ Write-Host "==========================================="
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFPanelAutologin.ps1 b/functions/public/Invoke-WPFPanelAutologin.ps1
new file mode 100644
index 00000000..a9aa2fcb
--- /dev/null
+++ b/functions/public/Invoke-WPFPanelAutologin.ps1
@@ -0,0 +1,10 @@
+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
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFPanelDISM.ps1 b/functions/public/Invoke-WPFPanelDISM.ps1
new file mode 100644
index 00000000..9212682c
--- /dev/null
+++ b/functions/public/Invoke-WPFPanelDISM.ps1
@@ -0,0 +1,13 @@
+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;
+ Write-Host '`n(3/4) DISM' -ForegroundColor Green; DISM /Online /Cleanup-Image /Restorehealth;
+ Write-Host '`n(4/4) SFC - 2nd scan' -ForegroundColor Green; sfc /scannow;
+ Read-Host '`nPress Enter to Continue'" -verb runas
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFPresets.ps1 b/functions/public/Invoke-WPFPresets.ps1
new file mode 100644
index 00000000..1b3bc193
--- /dev/null
+++ b/functions/public/Invoke-WPFPresets.ps1
@@ -0,0 +1,31 @@
+function Invoke-WPFPresets {
+ <#
+
+ .DESCRIPTION
+ Meant to make settings presets easier in the tweaks tab. Will pull the data from config/preset.json
+
+ #>
+
+ param(
+ $preset,
+ [bool]$imported = $false
+ )
+ if($imported -eq $true){
+ $CheckBoxesToCheck = $preset
+ }
+ Else{
+ $CheckBoxesToCheck = $sync.configs.preset.$preset
+ }
+
+ #Uncheck all
+ get-variable | Where-Object {$_.name -like "*tweaks*"} | ForEach-Object {
+ if ($psitem.value.gettype().name -eq "CheckBox"){
+ $CheckBox = Get-Variable $psitem.Name
+ if ($CheckBoxesToCheck -contains $CheckBox.name){
+ $checkbox.value.ischecked = $true
+ }
+ else{$checkbox.value.ischecked = $false}
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFRunspace.ps1 b/functions/public/Invoke-WPFRunspace.ps1
new file mode 100644
index 00000000..5b9ec321
--- /dev/null
+++ b/functions/public/Invoke-WPFRunspace.ps1
@@ -0,0 +1,73 @@
+function Invoke-WPFRunspace {
+
+ <#
+
+ .DESCRIPTION
+ Simple function to make it easier to invoke a runspace from inside the script.
+
+ .EXAMPLE
+
+ $params = @{
+ ScriptBlock = $sync.ScriptsInstallPrograms
+ ArgumentList = "Installadvancedip,Installbitwarden"
+ Verbose = $true
+ }
+
+ Invoke-WPFRunspace @params
+
+ #>
+
+ [CmdletBinding()]
+ Param (
+ $ScriptBlock,
+ $ArgumentList
+ )
+
+ #Configure max thread count for RunspacePool.
+ $maxthreads = [int]$env:NUMBER_OF_PROCESSORS
+
+ #Create a new session state for parsing variables ie hashtable into our runspace.
+ $hashVars = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'sync',$sync,$Null
+ $InitialSessionState = [System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault()
+
+ #Add the variable to the RunspacePool sessionstate
+ $InitialSessionState.Variables.Add($hashVars)
+
+ #Add functions
+ $functions = Get-ChildItem function:\ | Where-Object {$_.name -like "*winutil*" -or $_.name -like "*WPF*"}
+ foreach ($function in $functions){
+ $functionDefinition = Get-Content function:\$($function.name)
+ $functionEntry = New-Object System.Management.Automation.Runspaces.SessionStateFunctionEntry -ArgumentList $($function.name), $functionDefinition
+
+ # And add it to the iss object
+ $initialSessionState.Commands.Add($functionEntry)
+ }
+
+ #Create our runspace pool. We are entering three parameters here min thread count, max thread count and host machine of where these runspaces should be made.
+ $script:runspace = [runspacefactory]::CreateRunspacePool(1,$maxthreads,$InitialSessionState, $Host)
+
+
+ #Crate a PowerShell instance.
+ $script:powershell = [powershell]::Create()
+
+ #Open a RunspacePool instance.
+ $script:runspace.Open()
+
+ #Add Scriptblock and Arguments to runspace
+ $script:powershell.AddScript($ScriptBlock)
+ $script:powershell.AddArgument($ArgumentList)
+ $script:powershell.RunspacePool = $script:runspace
+
+ #Run our RunspacePool.
+ $script:handle = $script:powershell.BeginInvoke()
+
+ #Cleanup our RunspacePool threads when they are complete ie. GC.
+ if ($script:handle.IsCompleted)
+ {
+ $script:powershell.EndInvoke($script:handle)
+ $script:powershell.Dispose()
+ $script:runspace.Dispose()
+ $script:runspace.Close()
+ [System.GC]::Collect()
+ }
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFTab.ps1 b/functions/public/Invoke-WPFTab.ps1
new file mode 100644
index 00000000..46c68712
--- /dev/null
+++ b/functions/public/Invoke-WPFTab.ps1
@@ -0,0 +1,24 @@
+function Invoke-WPFTab {
+
+ <#
+
+ .DESCRIPTION
+ Sole purpose of this fuction reduce duplicated code for switching between tabs.
+
+ #>
+
+ Param ($ClickedTab)
+ $Tabs = Get-Variable WPFTab?BT
+ $TabNav = Get-Variable WPFTabNav
+ $x = [int]($ClickedTab -replace "WPFTab","" -replace "BT","") - 1
+
+ 0..($Tabs.Count -1 ) | ForEach-Object {
+
+ if ($x -eq $psitem){
+ $TabNav.value.Items[$psitem].IsSelected = $true
+ }
+ else{
+ $TabNav.value.Items[$psitem].IsSelected = $false
+ }
+ }
+}
diff --git a/functions/public/Invoke-WPFUltimatePerformance.ps1 b/functions/public/Invoke-WPFUltimatePerformance.ps1
new file mode 100644
index 00000000..bdcb458f
--- /dev/null
+++ b/functions/public/Invoke-WPFUltimatePerformance.ps1
@@ -0,0 +1,30 @@
+Function Invoke-WPFUltimatePerformance {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+ param($State)
+ Try{
+ $guid = "e9a42b02-d5df-448d-aa00-03f14749eb61"
+
+ if($state -eq "Enabled"){
+ Write-Host "Adding Ultimate Performance Profile"
+ [scriptblock]$command = {powercfg -duplicatescheme $guid}
+
+ }
+ if($state -eq "Disabled"){
+ Write-Host "Removing Ultimate Performance Profile"
+ [scriptblock]$command = {powercfg -delete $guid}
+ }
+
+ $output = Invoke-Command -ScriptBlock $command
+ if($output -like "*does not exist*"){
+ throw [GenericException]::new('Failed to modify profile')
+ }
+ }
+ Catch{
+ Write-Warning $psitem.Exception.Message
+ }
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFUpdatesdefault.ps1 b/functions/public/Invoke-WPFUpdatesdefault.ps1
new file mode 100644
index 00000000..bc007080
--- /dev/null
+++ b/functions/public/Invoke-WPFUpdatesdefault.ps1
@@ -0,0 +1,45 @@
+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
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 0
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 3
+ If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
+ New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
+
+ $services = @(
+ "BITS"
+ "wuauserv"
+ )
+
+ foreach ($service in $services) {
+ # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
+
+ Write-Host "Setting $service StartupType to Automatic"
+ Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic
+ }
+ Write-Host "Enabling driver offering through Windows Update..."
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
+ Write-Host "Enabling Windows Update automatic restart..."
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
+ Write-Host "Enabled driver offering through Windows Update"
+ 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 "================================="
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFUpdatesdisable.ps1 b/functions/public/Invoke-WPFUpdatesdisable.ps1
new file mode 100644
index 00000000..4cff5f5d
--- /dev/null
+++ b/functions/public/Invoke-WPFUpdatesdisable.ps1
@@ -0,0 +1,32 @@
+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
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
+ If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
+ New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
+
+ $services = @(
+ "BITS"
+ "wuauserv"
+ )
+
+ foreach ($service in $services) {
+ # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
+
+ Write-Host "Setting $service StartupType to Disabled"
+ Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
+ }
+ Write-Host "================================="
+ Write-Host "--- Updates ARE DISABLED ---"
+ Write-Host "================================="
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFUpdatessecurity.ps1 b/functions/public/Invoke-WPFUpdatessecurity.ps1
new file mode 100644
index 00000000..32052647
--- /dev/null
+++ b/functions/public/Invoke-WPFUpdatessecurity.ps1
@@ -0,0 +1,43 @@
+function Invoke-WPFUpdatessecurity {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+ Write-Host "Disabling driver offering through Windows Update..."
+ If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) {
+ New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Force | Out-Null
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value 1
+ If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching")) {
+ New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Force | Out-Null
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -Type DWord -Value 0
+ If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate")) {
+ New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" | Out-Null
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -Type DWord -Value 1
+ Write-Host "Disabling Windows Update automatic restart..."
+ If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
+ New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0
+ Write-Host "Disabled driver offering through Windows Update"
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "BranchReadinessLevel" -Type DWord -Value 20
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferFeatureUpdatesPeriodInDays" -Type DWord -Value 365
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays " -Type DWord -Value 4
+
+ $ButtonType = [System.Windows.MessageBoxButton]::OK
+ $MessageboxTitle = "Set Security Updates"
+ $Messageboxbody = ("Recommended Update settings loaded")
+ $MessageIcon = [System.Windows.MessageBoxImage]::Information
+
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+ Write-Host "================================="
+ Write-Host "-- Updates Set to Recommended ---"
+ Write-Host "================================="
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFtweaksbutton.ps1 b/functions/public/Invoke-WPFtweaksbutton.ps1
new file mode 100644
index 00000000..243242e2
--- /dev/null
+++ b/functions/public/Invoke-WPFtweaksbutton.ps1
@@ -0,0 +1,40 @@
+function Invoke-WPFtweaksbutton {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+
+ if($sync.ProcessRunning){
+ $msg = "Install process is currently running."
+ [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+}
+
+ $Tweaks = Get-WinUtilCheckBoxes -Group "WPFTweaks"
+
+ Set-WinUtilDNS -DNSProvider $WPFchangedns.text
+
+ Invoke-WPFRunspace -ArgumentList $Tweaks -ScriptBlock {
+ param($Tweaks)
+
+ $sync.ProcessRunning = $true
+
+ Foreach ($tweak in $tweaks){
+ Invoke-WinUtilTweaks $tweak
+ }
+
+ $sync.ProcessRunning = $false
+ Write-Host "================================="
+ Write-Host "-- Tweaks are Finished ---"
+ Write-Host "================================="
+
+ $ButtonType = [System.Windows.MessageBoxButton]::OK
+ $MessageboxTitle = "Tweaks are Finished "
+ $Messageboxbody = ("Done")
+ $MessageIcon = [System.Windows.MessageBoxImage]::Information
+
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+ }
+}
\ No newline at end of file
diff --git a/functions/public/Invoke-WPFundoall.ps1 b/functions/public/Invoke-WPFundoall.ps1
new file mode 100644
index 00000000..b7b7d8c0
--- /dev/null
+++ b/functions/public/Invoke-WPFundoall.ps1
@@ -0,0 +1,190 @@
+function Invoke-WPFundoall {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+
+ if($sync.ProcessRunning){
+ $msg = "Install process is currently running."
+ [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+ }
+
+ $Tweaks = Get-WinUtilCheckBoxes -Group "WPFTweaks"
+
+ Invoke-WPFRunspace -ArgumentList $Tweaks -ScriptBlock {
+ param($Tweaks)
+
+ $sync.ProcessRunning = $true
+
+ Foreach ($tweak in $tweaks){
+ Invoke-WinUtilTweaks $tweak -undo $true
+ }
+
+ $sync.ProcessRunning = $false
+ Write-Host "=================================="
+ Write-Host "--- Undo Tweaks are Finished ---"
+ Write-Host "=================================="
+
+ $ButtonType = [System.Windows.MessageBoxButton]::OK
+ $MessageboxTitle = "Tweaks are Finished "
+ $Messageboxbody = ("Done")
+ $MessageIcon = [System.Windows.MessageBoxImage]::Information
+
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+ }
+
+<#
+
+ Write-Host "Creating Restore Point in case something bad happens"
+ Enable-ComputerRestore -Drive "$env:SystemDrive"
+ Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS"
+
+ Write-Host "Enabling Telemetry..."
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1
+ Write-Host "Enabling Wi-Fi Sense"
+ Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
+ Write-Host "Enabling Application suggestions..."
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1
+ If (Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent") {
+ Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 0
+ Write-Host "Enabling Activity History..."
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 1
+ Write-Host "Enable Location Tracking..."
+ If (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location") {
+ Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Allow"
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
+ Write-Host "Enabling automatic Maps updates..."
+ Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 1
+ Write-Host "Enabling Feedback..."
+ If (Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules") {
+ Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 0
+ Write-Host "Enabling Tailored Experiences..."
+ If (Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent") {
+ Remove-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 0
+ Write-Host "Disabling Advertising ID..."
+ If (Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo") {
+ Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 0
+ Write-Host "Allow Error reporting..."
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 0
+ Write-Host "Allowing Diagnostics Tracking Service..."
+ Stop-Service "DiagTrack" -WarningAction SilentlyContinue
+ Set-Service "DiagTrack" -StartupType Manual
+ Write-Host "Allowing WAP Push Service..."
+ Stop-Service "dmwappushservice" -WarningAction SilentlyContinue
+ Set-Service "dmwappushservice" -StartupType Manual
+ Write-Host "Allowing Home Groups services..."
+ Stop-Service "HomeGroupListener" -WarningAction SilentlyContinue
+ Set-Service "HomeGroupListener" -StartupType Manual
+ Stop-Service "HomeGroupProvider" -WarningAction SilentlyContinue
+ Set-Service "HomeGroupProvider" -StartupType Manual
+ Write-Host "Enabling Storage Sense..."
+ New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" | Out-Null
+ Write-Host "Allowing Superfetch service..."
+ Stop-Service "SysMain" -WarningAction SilentlyContinue
+ Set-Service "SysMain" -StartupType Manual
+ Write-Host "Setting BIOS time to Local Time instead of UTC..."
+ Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 0
+ Write-Host "Enabling Hibernation..."
+ Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 1
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -ErrorAction SilentlyContinue
+
+ Write-Host "Hiding file operations details..."
+ If (Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager") {
+ Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 0
+ Write-Host "Showing Task View button..."
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 1
+
+ Write-Host "Changing default Explorer view to Quick Access..."
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 0
+
+ Write-Host "Unrestricting AutoLogger directory"
+ $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
+ icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null
+
+ Write-Host "Enabling and starting Diagnostics Tracking Service"
+ Set-Service "DiagTrack" -StartupType Automatic
+ Start-Service "DiagTrack"
+
+ Write-Host "Hiding known file extensions"
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1
+
+ Write-Host "Reset Local Group Policies to Stock Defaults"
+ # cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose
+ cmd /c RD /S /Q "%WinDir%\System32\GroupPolicyUsers"
+ cmd /c RD /S /Q "%WinDir%\System32\GroupPolicy"
+ cmd /c gpupdate /force
+ # Considered using Invoke-GPUpdate but requires module most people won't have installed
+
+ Write-Host "Adjusting visual effects for appearance..."
+ Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 1
+ Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 400
+ Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](158, 30, 7, 128, 18, 0, 0, 0))
+ Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 1
+ Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 1
+ Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -ErrorAction SilentlyContinue
+ Write-Host "Restoring Clipboard History..."
+ Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory" -ErrorAction SilentlyContinue
+ Write-Host "Enabling Notifications and Action Center"
+ Remove-Item -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
+ Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled"
+ Write-Host "Restoring Default Right Click Menu Layout"
+ Remove-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Recurse -Confirm:$false -Force
+
+ Write-Host "Reset News and Interests"
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name "EnableFeeds" -Type DWord -Value 1
+ # Remove "News and Interest" from taskbar
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 0
+ Write-Host "Done - Reverted to Stock Settings"
+
+ Write-Host "Essential Undo Completed"
+
+ $ButtonType = [System.Windows.MessageBoxButton]::OK
+ $MessageboxTitle = "Undo All"
+ $Messageboxbody = ("Done")
+ $MessageIcon = [System.Windows.MessageBoxImage]::Information
+
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+
+ Write-Host "================================="
+ Write-Host "--- Undo All is Finished ---"
+ Write-Host "================================="
+ #>
+}
\ No newline at end of file
diff --git a/lint/PSScriptAnalyser.ps1 b/lint/PSScriptAnalyser.ps1
new file mode 100644
index 00000000..6c075ff7
--- /dev/null
+++ b/lint/PSScriptAnalyser.ps1
@@ -0,0 +1,25 @@
+@{
+ # Only diagnostic records of the specified severity will be generated.
+ # Uncomment the following line if you only want Errors and Warnings but
+ # not Information diagnostic records.
+ # Severity = @('Error','Warning')
+
+ # Analyze **only** the following rules. Use IncludeRules when you want
+ # to invoke only a small subset of the defualt rules.
+<#
+ IncludeRules = @('PSAvoidDefaultValueSwitchParameter',
+ 'PSMisleadingBacktick',
+ 'PSMissingModuleManifestField',
+ 'PSReservedCmdletChar',
+ 'PSReservedParams',
+ 'PSShouldProcess',
+ 'PSUseApprovedVerbs',
+ 'PSUseDeclaredVarsMoreThanAssigments')
+#>
+ # Do not analyze the following rules. Use ExcludeRules when you have
+ # commented out the IncludeRules settings above and want to include all
+ # the default rules except for those you exclude below.
+ # Note: if a rule is in both IncludeRules and ExcludeRules, the rule
+ # will be excluded.
+ ExcludeRules = @('PSAvoidUsingWriteHost')
+}
\ No newline at end of file
diff --git a/ooshutup10_winutil_settings.cfg b/ooshutup10_winutil_settings.cfg
new file mode 100644
index 00000000..e0675fcc
--- /dev/null
+++ b/ooshutup10_winutil_settings.cfg
@@ -0,0 +1,237 @@
+############################################################################
+# This file was created with O&O ShutUp10++ V1.9.1434
+# and can be imported onto another computer.
+#
+# Download the application at https://www.oo-software.com/shutup10
+# You can then import the file from within the program.
+#
+# Alternatively you can import it automatically over a command line.
+# Simply use the following parameter:
+# OOSU10.exe
+#
+# Selecting the Option /quiet ends the app right after the import and the
+# user does not get any feedback about the import.
+#
+# We are always happy to answer any questions you may have!
+# © 2015-2022 O&O Software GmbH, Berlin. All rights reserved.
+# https://www.oo-software.com/
+############################################################################
+
+P001 +
+P002 +
+P003 +
+P004 +
+P005 +
+P006 +
+P008 +
+P026 +
+P027 +
+P028 +
+P064 +
+P065 +
+P066 +
+P067 +
+P070 +
+P069 +
+P009 -
+P010 -
+P015 +
+P068 -
+P016 -
+A001 +
+A002 +
+A003 +
+A004 -
+A006 -
+A005 +
+P007 +
+P036 +
+P025 +
+P033 +
+P023 +
+P056 +
+P057 -
+P012 -
+P034 -
+P013 -
+P035 -
+P062 -
+P063 -
+P081 +
+P047 -
+P019 -
+P048 -
+P049 -
+P020 -
+P037 -
+P011 -
+P038 -
+P050 -
+P051 -
+P018 -
+P039 -
+P021 -
+P040 -
+P022 -
+P041 -
+P014 -
+P042 -
+P052 -
+P053 -
+P054 -
+P055 -
+P029 -
+P043 -
+P030 -
+P044 -
+P031 -
+P045 -
+P032 -
+P046 -
+P058 -
+P059 -
+P060 -
+P061 -
+P071 -
+P072 -
+P073 -
+P074 -
+P075 -
+P076 -
+P077 -
+P078 -
+P079 -
+P080 -
+P024 +
+S001 +
+S002 +
+S003 +
+S008 -
+E101 +
+E201 -
+E115 +
+E215 -
+E118 +
+E218 -
+E107 +
+E207 -
+E111 +
+E211 -
+E112 +
+E212 +
+E109 +
+E209 +
+E121 +
+E221 -
+E103 +
+E203 -
+E123 -
+E223 +
+E124 -
+E224 -
+E119 -
+E219 -
+E120 -
+E220 -
+E122 -
+E222 -
+E125 -
+E225 -
+E126 -
+E226 -
+E106 -
+E206 -
+E127 -
+E227 -
+E001 +
+E002 +
+E003 +
+E008 +
+E007 +
+E010 +
+E011 +
+E012 +
+E009 -
+E004 -
+E005 -
+E013 -
+E014 -
+E006 -
+F002 -
+F014 +
+F015 -
+F016 -
+F001 -
+F003 +
+F004 +
+F005 +
+F007 -
+F008 -
+F009 -
+F006 -
+F010 -
+F011 -
+F012 -
+F013 -
+Y001 +
+Y002 +
+Y003 +
+Y004 +
+Y005 +
+Y006 +
+Y007 +
+C012 +
+C002 +
+C013 +
+C007 +
+C008 +
+C009 +
+C010 +
+C011 +
+C014 +
+L001 +
+L003 +
+L004 -
+L005 -
+U001 +
+U004 +
+U005 +
+U006 -
+U007 +
+W001 +
+W011 +
+W004 -
+W005 -
+W010 -
+W009 -
+P017 +
+W006 -
+W008 -
+M006 +
+M011 -
+M010 +
+O003 -
+O001 -
+S012 -
+S013 -
+S014 -
+K001 +
+K002 +
+K005 +
+M022 +
+M001 +
+M004 +
+M005 +
+M003 -
+M012 -
+M013 -
+M014 -
+M015 +
+M016 -
+M017 +
+M018 +
+M019 -
+M020 +
+M021 -
+N001 -
+
diff --git a/pester/runspace.Tests.ps1 b/pester/runspace.Tests.ps1
new file mode 100644
index 00000000..64faf47b
--- /dev/null
+++ b/pester/runspace.Tests.ps1
@@ -0,0 +1,115 @@
+#region Configurable Variables
+
+ <#
+ .NOTES
+ Use this section to configure testing variables. IE if the number of tabs change in the GUI update that variable here.
+ All variables need to be global to be passed between contexts
+
+ #>
+
+ $global:FormName = "Chris Titus Tech's Windows Utility"
+
+#endregion Configurable Variables
+
+#region Load Variables needed for testing
+
+ #Config Files
+ $global:importedconfigs = @{}
+ Get-ChildItem .\config | Where-Object {$_.Extension -eq ".json"} | ForEach-Object {
+ $global:importedconfigs[$psitem.BaseName] = Get-Content $psitem.FullName | ConvertFrom-Json
+ }
+
+
+#endregion Load Variables needed for testing
+
+#===========================================================================
+# Tests - Application Installs
+#===========================================================================
+
+Describe "Config Files" -ForEach @(
+ @{
+ name = "applications"
+ config = $('{
+ "winget": "value",
+ "choco": "value"
+ }' | ConvertFrom-Json)
+ },
+ @{
+ name = "tweaks"
+ undo = $true
+ }
+){
+ Context "$name config file" {
+ It "Imports with no errors" {
+ $global:importedconfigs.$name | should -Not -BeNullOrEmpty
+ }
+ if ($config){
+ It "Imports should be the correct structure" {
+ $applications = $global:importedconfigs.$name | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty name
+ $template = $config | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty name
+ $result = New-Object System.Collections.Generic.List[System.Object]
+ Foreach ($application in $applications) {
+ $compare = $global:importedconfigs.$name.$application | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty name
+ if ($(Compare-Object $compare $template) -ne $null){
+ $result.Add($application)
+ }
+ }
+
+ $result | Select-String "WPF*" | should -BeNullOrEmpty
+ }
+ }
+ if($undo){
+ It "Tweaks should contain original Value" {
+ $tweaks = $global:importedconfigs.$name | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty name
+ $result = New-Object System.Collections.Generic.List[System.Object]
+
+ foreach ($tweak in $tweaks){
+ $Originals = @(
+ @{
+ name = "registry"
+ value = "OriginalValue"
+ },
+ @{
+ name = "service"
+ value = "OriginalType"
+ },
+ @{
+ name = "ScheduledTask"
+ value = "OriginalState"
+ }
+ )
+ Foreach ($original in $Originals){
+ $TotalCount = ($global:importedconfigs.$name.$tweak.$($original.name)).count
+ $OriginalCount = ($global:importedconfigs.$name.$tweak.$($original.name).$($original.value) | Where-Object {$_}).count
+ if($TotalCount -ne $OriginalCount){
+ $result.Add("$Tweak,$($original.name)")
+ }
+ }
+ }
+ $result | Select-String "WPF*" | should -BeNullOrEmpty
+ }
+ }
+
+ }
+}
+
+
+#===========================================================================
+# Tests - Functions
+#===========================================================================
+
+Describe "Functions" -ForEach @(Get-ChildItem .\functions -Recurse -File){
+
+ BeforeEach -Scriptblock {
+ . $psitem.FullName
+ }
+
+ Context "$($psitem.BaseName)" {
+ It "Imports with no errors" {
+ Get-ChildItem function:\$($psitem.BaseName) | should -Not -BeNullOrEmpty
+ }
+ It "Contains Description" {
+ get-help $($psitem.BaseName) -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Description | should -Not -BeNullOrEmpty
+ }
+ }
+}
diff --git a/pester/winutil.Tests.ps1 b/pester/winutil.Tests.ps1
index 3f669082..649faad9 100644
--- a/pester/winutil.Tests.ps1
+++ b/pester/winutil.Tests.ps1
@@ -17,7 +17,8 @@
$global:configs = @{}
(
- "applications"
+ "applications",
+ "preset"
) | ForEach-Object {
$global:configs["$PSItem"] = Get-Content .\config\$PSItem.json | ConvertFrom-Json
}
@@ -33,7 +34,7 @@
#dotsource original script to pull in all variables and ensure no errors
$script = Get-Content .\winutil.ps1
- $output = $script[0..($script.count - 4)] | Out-File .\pester.ps1
+ $output = $script[0..($script.count - 14)] | Out-File .\pester.ps1
#endregion Load Variables needed for testing
@@ -49,11 +50,11 @@ Describe "Application Installs" {
}
}
Context "Winget Install" {
- $global:configs.applications.install | Get-Member -MemberType NoteProperty | ForEach-Object {
+ $global:configs.applications | Get-Member -MemberType NoteProperty | ForEach-Object {
$TestCase = @{ name = $psitem.name }
It "$($psitem.name) should include Winget Install" -TestCases $TestCase{
param($name)
- $null -eq $global:configs.applications.install.$name.winget | should -Befalse -because "$name Did not include a Winget Install"
+ $null -eq $global:configs.applications.$name.winget | should -Befalse -because "$name Did not include a Winget Install"
}
}
}
@@ -63,7 +64,7 @@ Describe "Application Installs" {
$TestCase = @{ name = $psitem }
It "$($psitem) should include application.json " -TestCases $TestCase{
param($name)
- $null -eq $global:configs.applications.install.$name | should -Befalse -because "$name Does not have entry in applications.json"
+ $null -eq $global:configs.applications.$name | should -Befalse -because "$name Does not have entry in applications.json"
}
}
}
@@ -105,12 +106,49 @@ Describe "GUI" {
}
}
+#===========================================================================
+# Tests - Functions
+#===========================================================================
+
+Describe "Functions" {
+ BeforeEach -Scriptblock {
+ . ./pester.ps1
+ $x = 0
+ while($sync.ConfigLoaded -ne $True -or $x -eq 100){
+ start-sleep -Milliseconds 100
+ $x ++
+ }
+ }
+
+ It "Get-InstallerProcess should return the correct values" {
+ Get-InstallerProcess | should -Befalse
+ $process = Start-Process powershell.exe -ArgumentList "-c start-sleep 5" -PassThru
+ Get-InstallerProcess $process | should -Not -Befalse
+ }
+
+ It "Runspace background load should have data" {
+ $sync.configs.applications | should -Not -BeNullOrEmpty
+ $sync.configs.tweaks | should -Not -BeNullOrEmpty
+ $sync.configs.preset | should -Not -BeNullOrEmpty
+ $sync.configs.feature | should -Not -BeNullOrEmpty
+ $sync.ComputerInfo | should -Not -BeNullOrEmpty
+ }
+
+}
+
#===========================================================================
# Tests - GUI Functions
#===========================================================================
Describe "GUI Functions" {
- BeforeEach -Scriptblock {. ./pester.ps1}
+ BeforeEach -Scriptblock {
+ . ./pester.ps1
+ $x = 0
+ while($sync.ConfigLoaded -ne $True -or $x -eq 100){
+ start-sleep -Milliseconds 100
+ $x ++
+ }
+ }
It "GUI should load with no errors" {
$WPFTab1BT | should -Not -BeNullOrEmpty
@@ -123,8 +161,6 @@ Describe "GUI Functions" {
$WPFUpdatessecurity | should -Not -BeNullOrEmpty
$WPFFeatureInstall | should -Not -BeNullOrEmpty
$WPFundoall | should -Not -BeNullOrEmpty
- $WPFDisableDarkMode | should -Not -BeNullOrEmpty
- $WPFEnableDarkMode | should -Not -BeNullOrEmpty
$WPFtweaksbutton | should -Not -BeNullOrEmpty
$WPFminimal | should -Not -BeNullOrEmpty
$WPFlaptop | should -Not -BeNullOrEmpty
@@ -135,31 +171,30 @@ Describe "GUI Functions" {
Context "Get-CheckBoxes" {
It "Get-CheckBoxes Install should return data" {
- . .\pester.ps1
- $TestCheckBoxes = @(
- "WPFInstallvc2015_32"
- "WPFInstallvscode"
- "WPFInstallgit"
- )
-
- $OutputResult = New-Object System.Collections.Generic.List[System.Object]
- $TestCheckBoxes | ForEach-Object {
+ $TestCheckBoxes = @(
+ "WPFInstallvc2015_32"
+ "WPFInstallvscode"
+ "WPFInstallgit"
+ )
+
+ $OutputResult = New-Object System.Collections.Generic.List[System.Object]
+ $TestCheckBoxes | ForEach-Object {
- $global:configs.applications.Install.$psitem.winget -split ";" | ForEach-Object {
- $OutputResult.Add($psitem)
+ $global:configs.applications.$psitem.winget -split ";" | ForEach-Object {
+ $OutputResult.Add($psitem)
+ }
}
+ $OutputResult = Sort-Object -InputObject $OutputResult
+
+ $TestCheckBoxes | ForEach-Object {(Get-Variable $PSItem).value.ischecked = $true}
+ $Output = Get-CheckBoxes -Group WPFInstall | Sort-Object
+ $Output | should -Not -BeNullOrEmpty -Because "Output did not contain applications to install"
+ $Output | Should -Not -Be $OutputResult -Because "Output contains duplicate values"
+ $Output | Should -Be $($OutputResult | Select-Object -Unique | Sort-Object) -Because "Output doesn't match"
+ $TestCheckBoxes | ForEach-Object {(Get-Variable $PSItem).value.ischecked | should -be $false}
}
- $OutputResult = Sort-Object -InputObject $OutputResult
-
- $TestCheckBoxes | ForEach-Object {(Get-Variable $PSItem).value.ischecked = $true}
- $Output = Get-CheckBoxes -Group WPFInstall | Sort-Object
- $Output | should -Not -BeNullOrEmpty -Because "Output did not containe applications to install"
- $Output | Should -Not -Be $OutputResult -Because "Output contains duplicate values"
- $Output | Should -Be $($OutputResult | Select-Object -Unique | Sort-Object) -Because "Output doesn't match"
- $TestCheckBoxes | ForEach-Object {(Get-Variable $PSItem).value.ischecked | should -be $false}
}
-
Context "Set-Presets" {
$global:configs.preset | Get-Member -MemberType NoteProperty | ForEach-Object {
$TestCase = @{ name = $psitem.name }
diff --git a/runspace.ps1 b/runspace.ps1
deleted file mode 100644
index afe287d1..00000000
--- a/runspace.ps1
+++ /dev/null
@@ -1,1529 +0,0 @@
-#for CI/CD
-$BranchToUse = 'main'
-
-<#
-.NOTES
- Author : @ChrisTitusTech
- Runspace Author : @DeveloperDurp
- Version 0.1
-#>
-
-#region Variables
-
- $sync = [Hashtable]::Synchronized(@{})
- $sync.logfile = "$env:TEMP\winutil.log"
-
- $sync.taskrunning = $false
- $sync.taskmessage = "There is currently a task running. Please try again once previous task is complete."
- $sync.tasktitle = "Task in progress"
-
- $VerbosePreference = "Continue"
- if(!$env:args){$gui = $true}
-
-#endregion Variables
-
-#region Functions
-
-#===========================================================================
-# Button clicks
-#===========================================================================
-
-function Invoke-Button {
-
- <#
-
- .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
- #[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")
-
- Switch -Wildcard ($Button){
-
- "*Tab*BT*" {switchtab $Button}
- "*InstallUpgrade*" {Invoke-command $sync.GUIInstallPrograms -ArgumentList "Upgrade"}
- "*desktop*" {Tweak-Buttons $Button}
- "*laptop*" {Tweak-Buttons $Button}
- "*minimal*" {Tweak-Buttons $Button}
- "*undoall*" {Invoke-command $Sync.GUIUndoTweaks}
- "install" {Invoke-command $sync.GUIInstallPrograms -ArgumentList "$(uncheckall "Install")"}
- "tweaksbutton" {Invoke-command $Sync.GUITweaks -ArgumentList "$(uncheckall "tweaks")"}
- "FeatureInstall" {Invoke-command $Sync.GUIFeatures -ArgumentList "$(uncheckall "feature")"}
- "Panelcontrol" {cmd /c control}
- "Panelnetwork" {cmd /c ncpa.cpl}
- "Panelpower" {cmd /c powercfg.cpl}
- "Panelsound" {cmd /c mmsys.cpl}
- "Panelsystem" {cmd /c sysdm.cpl}
- "Paneluser" {cmd /c "control userpasswords2"}
- "Updates*" {Invoke-command $sync.GUIUpdates -ArgumentList "$button"}
- "FixesUpdate" {Invoke-command $sync.GUIUpdates -ArgumentList "$button"}
- "*AutoLogin" {Invoke-Runspace $Sync.AutologinInstall}
- "DisableDarkMode" {Invoke-Runspace $Sync.DarkModeToggle -ArgumentList "$False"}
- "EnableDarkMode" {Invoke-Runspace $Sync.DarkModeToggle -ArgumentList "$True"}
- "PanelDISM" {
- 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;
- Write-Host '`n(3/4) DISM' -ForegroundColor Green; DISM /Online /Cleanup-Image /Restorehealth;
- Write-Host '`n(4/4) SFC - 2nd scan' -ForegroundColor Green; sfc /scannow;
- Read-Host '`nPress Enter to Continue'" -verb runas
- }
- }
-}
-
-function uncheckall {
-
- <#
-
- .DESCRIPTION
- Function is meant to find all checkboxes that are checked on the specefic tab and input them into a script.
-
- Outputed data will be the names of the checkboxes comma seperated.
-
- "Installadvancedip,Installbitwarden"
-
- .EXAMPLE
-
- uncheckall "Install"
-
- #>
-
- param($group)
-
- if ($sync.taskrunning -eq $true){
- return
- }
-
- $sync.keys | Where-Object {$psitem -like "*$($group)?*" `
- -and $psitem -notlike "$($group)Install" `
- -and $psitem -notlike "*GUI*" `
- -and $psitem -notlike "*Script*"
- } | ForEach-Object {
- if ($sync["$psitem"].IsChecked -eq $true){
- $output += ",$psitem"
- $sync["$psitem"].IsChecked = $false
- }
- }
-
- if($output){Write-Output $output.Substring(1)}
-}
-
-function Invoke-Runspace {
-
- <#
-
- .DESCRIPTION
- Simple function to make it easier to invoke a runspace from inside the script.
-
- .EXAMPLE
-
- $params = @{
- ScriptBlock = $sync.ScriptsInstallPrograms
- ArgumentList = "Installadvancedip,Installbitwarden"
- Verbose = $true
- }
-
- Invoke-Runspace @params
-
- #>
-
- [CmdletBinding()]
- Param (
- $ScriptBlock,
- $ArgumentList
- )
-
- $Script = [PowerShell]::Create().AddScript($ScriptBlock).AddArgument($ArgumentList)
-
- $Script.Runspace = $runspace
- $Script.BeginInvoke()
-}
-
-#===========================================================================
-# Navigation Controls
-#===========================================================================
-
-function switchtab {
-
- <#
-
- .DESCRIPTION
- Sole purpose of this fuction reduce duplicated code for switching between tabs.
-
- #>
-
- Param ($button)
- $x = [int]($button -replace "Tab","" -replace "BT","") - 1
-
- 0..3 | ForEach-Object {
-
- if ($x -eq $psitem){$sync["TabNav"].Items[$psitem].IsSelected = $true}
- else{$sync["TabNav"].Items[$psitem].IsSelected = $false}
- }
-}
-
-Function Tweak-Buttons {
-
- <#
-
- .DESCRIPTION
- Meant to make settings presets easier in the tweaks tab. Will pull the data from config/preset.json
-
- #>
-
- Param ($button)
- $preset = $sync.preset.$button
-
- $sync.keys | Where-Object {$psitem -like "*tweaks?*" -and $psitem -notlike "tweaksbutton"} | ForEach-Object {
- if ($preset -contains $psitem ){$sync["$psitem"].IsChecked = $True}
- Else{$sync["$psitem"].IsChecked = $false}
- }
-}
-
-#endregion Functions
-
-#===========================================================================
-# Scritps to be ran inside a runspace
-#===========================================================================
-
-#region Scripts
-
-#===========================================================================
-# Generic Scripts
-#===========================================================================
-
-$sync.WriteLogs = {
-
- <#
-
- .DESCRIPTION
- Simple function to write logs to a temp directory.
-
- .EXAMPLE
-
- $Level = "INFO"
- $Message = "This is a test message!"
- $LogPath = "$ENV:TEMP\winutil.log"
- Invoke-command $sync.WriteLogs -ArgumentList ($Level,$Message,$LogPath)
-
- #>
-
- [cmdletbinding()]
- param(
- $Level = "Info",
- $Message,
- $LogPath = "$env:TEMP\winutil.log"
- )
-
- $date = get-date
- $delimiter = '|'
- write-output "$date $delimiter $Level $delimiter $message" | out-file -Append -Encoding ascii -FilePath $LogPath
- if($Level -eq "ERROR" -or $Level -eq "FAILURE"){
- write-Error "$date $delimiter $Level $delimiter $message"
- return
- }
- if($Level -eq "Warning"){
- Write-Warning "$date $delimiter $Level $delimiter $message"
- return
- }
- Write-Verbose "$date $delimiter $Level $delimiter $message"
-}
-
-$Sync.AutologinInstall = {
-
- # Official Microsoft recommendation https://learn.microsoft.com/en-us/sysinternals/downloads/autologon
- Invoke-WebRequest "https://live.sysinternals.com/Autologon.exe" -OutFile $env:TEMP\autologin.exe
- Start-Process -FilePath powershell.exe -Verb runas -ArgumentList "-c $ENV:Temp\autologin.exe" -WindowStyle Hidden
-
-}
-
-$Sync.DarkModeToggle = {
- param($enabled)
-
- $Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
-
- if($enabled -eq $True){
- Set-ItemProperty $Theme AppsUseLightTheme -Value 0
- Invoke-command $sync.WriteLogs -ArgumentList ("INFO","Dark Mode has been enabled",$sync.logfile)
- }
- if($enabled -eq $False){
- Set-ItemProperty $Theme AppsUseLightTheme -Value 1
- Invoke-command $sync.WriteLogs -ArgumentList ("INFO","Dark Mode has been disabled",$sync.logfile)
- }
-
-}
-
-#===========================================================================
-# Install Tab
-#===========================================================================
-
-<#
-
- This section is working as expected and logs output to console and $ENV:Temp\winutil.log
-
- TODO: Error Handling with winget. Currently it does not handle errors as expected.
-
-#>
-
-$Sync.GUIInstallPrograms = {
-
- <#
-
- .DESCRIPTION
- This Scriptblock is meant to be ran from inside the GUI and will prevent the user from starting another install task.
-
- Input data will look like below and link with the name of the check box. This will then look to the config/applications.json file to find
- the winget install commands for the selected applications.
-
- Installadvancedip,Installbitwarden
-
- .EXAMPLE
-
- Invoke-command $sync.GUIInstallPrograms -ArgumentList "Installadvancedip,Installbitwarden"
-
- #>
-
- Param ($programstoinstall)
-
- #Check if any check boxes have been checked and if a task is currently running
-
- if ($sync.taskrunning -eq $true){
- [System.Windows.MessageBox]::Show($sync.taskmessage,$sync.tasktitle,"OK","Info")
- return
- }
-
- if($programstoinstall -notlike "*install*"){
- [System.Windows.MessageBox]::Show("Please check the applications you wish to install",'Nothing to do',"OK","Info")
- return
- }
-
- #Section to see if winget will upgrade all installs or which winget commands to run from config/applications.json
-
- $programstoinstall = $programstoinstall -split ","
-
- if($programstoinstall -eq "Upgrade"){
- $winget = ",Upgrade"
- }
- else{
- foreach ($program in $programstoinstall){
-
- $($sync.applications.install.$("WPF" + $program).winget) -split ";" | ForEach-Object {
- if($psitem){
- $winget += ",$psitem"
- }Else{
- Invoke-command $sync.WriteLogs -ArgumentList ("WARNING","$Program Not found")
- }
- }
- }
- }
-
- if($winget -eq $null){
- [System.Windows.MessageBox]::Show("No found applications to install",'Nothing to do',"OK","Info")
- return
- }
-
- #Invoke a runspace so that the GUI does not lock up
-
- $sync.taskrunning = $true
-
- $params = @{
- ScriptBlock = $sync.ScriptsInstallPrograms
- ArgumentList = "$($winget.substring(1))"
- Verbose = $true
- }
- Invoke-Runspace @params
-
-}
-
-$sync.ScriptsInstallPrograms = {
-
- <#
- .DESCRIPTION
- This scriptblock will detect if winget is installed and if not attempt to install it. Once ready it will then either upgrade any installs or attempt to install any applications provided.
-
- .EXAMPLE
-
- $params = @{
- ScriptBlock = $sync.ScriptsInstallPrograms
- ArgumentList = "git.git,WinDirStat.WinDirStat"
- }
- VerbosePreference = "Continue"
- Invoke-Command @params
-
- .EXAMPLE
-
- $params = @{
- ScriptBlock = $sync.ScriptsInstallPrograms
- ArgumentList = "Upgrade"
- }
-
- VerbosePreference = "Continue"
- Invoke-Command @params
-
- #>
-
- Param ($programstoinstall)
- $programstoinstall = $programstoinstall -split ","
-
- function Write-Logs {
- param($Level, $Message, $LogPath)
- Invoke-command $sync.WriteLogs -ArgumentList ($Level,$Message,$LogPath)
- }
-
- #region Check for WinGet and install if not present
-
- if (Test-Path $env:userprofile\AppData\Local\Microsoft\WindowsApps\winget.exe) {
- #Checks if winget executable exists and if the Windows Version is 1809 or higher
- Write-Logs -Level INFO -Message "WinGet was detected" -LogPath $sync.logfile
- }
- else {
-
- if (($sync.ComputerInfo.WindowsVersion) -lt "1809") {
- #Checks if Windows Version is too old for winget
- Write-Logs -Level Warning -Message "Winget is not supported on this version of Windows (Pre-1809). Stopping installs" -LogPath $sync.logfile
- return
- }
-
- Write-Logs -Level INFO -Message "WinGet was not detected" -LogPath $sync.logfile
-
- if (((($sync.ComputerInfo.OSName.IndexOf("LTSC")) -ne -1) -or ($sync.ComputerInfo.OSName.IndexOf("Server") -ne -1)) -and (($sync.ComputerInfo.WindowsVersion) -ge "1809")) {
- Try{
- #Checks if Windows edition is LTSC/Server 2019+
- #Manually Installing Winget
- Write-Logs -Level INFO -Message "LTSC/Server Edition detected. Running Alternative Installer" -LogPath $sync.logfile
-
- #Download Needed Files
- $step = "Downloading the required files"
- Write-Logs -Level INFO -Message $step -LogPath $sync.logfile
- Start-BitsTransfer -Source "https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx" -Destination "$ENV:TEMP\Microsoft.VCLibs.x64.14.00.Desktop.appx" -ErrorAction Stop
- Start-BitsTransfer -Source "https://github.com/microsoft/winget-cli/releases/download/v1.2.10271/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -Destination "$ENV:TEMP/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -ErrorAction Stop
- Start-BitsTransfer -Source "https://github.com/microsoft/winget-cli/releases/download/v1.2.10271/b0a0692da1034339b76dce1c298a1e42_License1.xml" -Destination "$ENV:TEMP/b0a0692da1034339b76dce1c298a1e42_License1.xml" -ErrorAction Stop
-
- #Installing Packages
- $step = "Installing Packages"
- Write-Logs -Level INFO -Message $step -LogPath $sync.logfile
- Add-AppxProvisionedPackage -Online -PackagePath "$ENV:TEMP\Microsoft.VCLibs.x64.14.00.Desktop.appx" -SkipLicense -ErrorAction Stop
- Add-AppxProvisionedPackage -Online -PackagePath "$ENV:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -LicensePath "$ENV:TEMP\b0a0692da1034339b76dce1c298a1e42_License1.xml" -ErrorAction Stop
-
- #Sleep for 5 seconds to maximize chance that winget will work without reboot
- Start-Sleep -s 5
-
- #Removing no longer needed Files
- $step = "Removing Files"
- Write-Logs -Level INFO -Message $step -LogPath $sync.logfile
- Remove-Item -Path "$ENV:TEMP\Microsoft.VCLibs.x64.14.00.Desktop.appx" -Force
- Remove-Item -Path "$ENV:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -Force
- Remove-Item -Path "$ENV:TEMP\b0a0692da1034339b76dce1c298a1e42_License1.xml" -Force
-
- $step = "WinGet Sucessfully installed"
- Write-Logs -Level INFO -Message $step -LogPath $sync.logfile
-
- }Catch{Write-Logs -Level FAILURE -Message "WinGet Install failed at $step" -LogPath $sync.logfile}
- }
- else {
- Try{
- #Installing Winget from the Microsoft Store
- $step = "Installing WinGet"
- Write-Logs -Level INFO -Message $step -LogPath $sync.logfile
- Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
- $nid = (Get-Process AppInstaller).Id
- Wait-Process -Id $nid
-
- $step = "Winget Installed"
- Write-Logs -Level INFO -Message $step -LogPath $sync.logfile
- }Catch{Write-Logs -Level FAILURE -Message "WinGet Install failed at $step" -LogPath $sync.logfile}
- }
- Write-Logs -Level INFO -Message "WinGet has been installed" -LogPath $sync.logfile
- Start-Sleep -Seconds 15
- }
-
- #endregion Check for WinGet and install if not present
-
- $results = @()
- foreach ($program in $programstoinstall){
- if($programstoinstall -eq "Upgrade"){
- $Message = "Attempting to upgrade packages"
- $ErrorMessage = "Failed to upgrade packages"
- $SuccessMessage = "Upgardes have completed"
- $ArgumentList = "upgrade --all"
- }
- else{
- $Message = "$($program) was selected to be installed."
- $ErrorMessage = "$($program) failed to installed."
- $SuccessMessage = "$($program) has been installed"
- $ArgumentList = "install -e --accept-source-agreements --accept-package-agreements --silent $($program)"
- }
-
- try {
- Write-Logs -Level INFO -Message "$Message" -LogPath $sync.logfile
- Write-Host ""
-
- $installs = Start-Process -FilePath winget -ArgumentList $ArgumentList -ErrorAction Stop -Wait -PassThru -NoNewWindow
- }
- catch {
- Write-Logs -Level FAILURE -Message $ErrorMessage -LogPath $sync.logfile
- $results += $program
- }
- }
-
- Write-Logs -Level INFO -Message "Installs have completed" -LogPath $sync.logfile
- if($sync["Form"]){
- $sync.taskrunning = $false
- [System.Windows.MessageBox]::Show("All applications have been installed",'Installs are done!',"OK","Info")
- }
-}
-
-#===========================================================================
-# Tab 2 - Tweaks Buttons
-#===========================================================================
-
-<#
-
- This section is working as expected and logs output to console and $ENV:Temp\winutil.log
-
- TODO: Error Handling as Try blocks and -erroraction stop causes runspace to lock up
-
-#>
-
-$Sync.GUITweaks = {
-
- <#
-
- .DESCRIPTION
- This Scriptblock is meant to be ran from inside the GUI and will prevent the user from starting another install task.
-
- Input data will look like below and link with the name of the check box. This will then look to the config/applications.json file to find
- the modifications for the selected task.
-
- EssTweaksDeBloat,MiscTweaksUTC
-
- .EXAMPLE
-
- Invoke-command $sync.GUIInstallPrograms -ArgumentList "EssTweaksDeBloat,MiscTweaksUTC"
-
- #>
-
- Param($Tweakstorun)
-
- #Check if any check boxes have been checked and if a task is currently running
-
- if ($sync.taskrunning -eq $true){
- [System.Windows.MessageBox]::Show($sync.taskmessage,$sync.tasktitle,"OK","Info")
- return
- }
-
- if($Tweakstorun -notlike "*Tweaks*"){
- [System.Windows.MessageBox]::Show("Please check the applications you wish to install",'Nothing to do',"OK","Info")
- return
- }
-
- $sync.taskrunning = $true
-
- #Invoke a runspace so that the GUI does not lock up
-
- $params = @{
- ScriptBlock = $sync.ScriptTweaks
- ArgumentList = ("$Tweakstorun")
- }
-
- Invoke-Runspace @params
-
-}
-
-$Sync.ScriptTweaks = {
-
- <#
-
- .DESCRIPTION
- This scriptblock will run a series of modifications included in the config/tweaks.json file.
-
- TODO: Figure out error handling as any errors in this runspace will crash the powershell session.
-
- .EXAMPLE
-
- $params = @{
- ScriptBlock = $sync.ScriptsInstallPrograms
- ArgumentList = "EssTweaksTele,EssTweaksServices"
- Verbose = $true
- }
- VerbosePreference = "Continue"
- Invoke-Command @params
-
- #>
-
- Param($Tweakstorun)
- $Tweakstorun = $Tweakstorun -split ","
-
- $ErrorActionPreference = "SilentlyContinue"
-
- function Write-Logs {
- param($Level, $Message, $LogPath)
- Invoke-command $sync.WriteLogs -ArgumentList ($Level,$Message, $LogPath)
- }
-
- Write-Logs -Level INFO -Message "Gathering required modifications" -LogPath $sync.logfile
-
- $RegistryToModify = $Tweakstorun | ForEach-Object {
- $sync.tweaks.$psitem.registry
- }
-
- $ServicesToModify = $Tweakstorun | ForEach-Object {
- $sync.tweaks.$psitem.service
- }
-
- $ScheduledTaskToModify = $Tweakstorun | ForEach-Object {
- $sync.tweaks.$psitem.ScheduledTask
- }
-
- $AppxToModify = $Tweakstorun | ForEach-Object {
- $sync.tweaks.$psitem.appx
- }
-
- $ScriptsToRun = $Tweakstorun | ForEach-Object {
- $sync.tweaks.$psitem.InvokeScript
- }
-
- if($RegistryToModify){
- Write-Logs -Level INFO -Message "Starting Registry Modification" -LogPath $sync.logfile
-
- $RegistryToModify | ForEach-Object {
- if(!(Test-Path $psitem.path)){
- $Step = "create"
- Write-Logs -Level INFO -Message "$($psitem.path) did not exist. Creating" -LogPath $sync.logfile
- New-Item -Path $psitem.path -Force | Out-Null
- }
-
- $step = "set"
- Write-Logs -Level INFO -Message "Setting $("$($psitem.path)\$($psitem.name)") to $($psitem.value)" -LogPath $sync.logfile
- Set-ItemProperty -Path $psitem.path -Name $psitem.name -Type $psitem.type -Value $psitem.value
- }
-
- Write-Logs -Level INFO -Message "Finished setting registry" -LogPath $sync.logfile
- }
-
- if($ServicesToModify){
- Write-Logs -Level INFO -Message "Starting Services Modification" -LogPath $sync.logfile
-
- $ServicesToModify | ForEach-Object {
- Stop-Service "$($psitem.name)"
- Set-Service "$($psitem.name)" -StartupType $($psitem.StartupType)
- Write-Logs -Level INFO -Message "Service $($psitem.name) set to $($psitem.StartupType)" -LogPath $sync.logfile
- }
-
- Write-Logs -Level INFO -Message "Finished setting Services" -LogPath $sync.logfile
- }
-
- if($ScheduledTaskToModify){
- Write-Logs -Level INFO -Message "Starting ScheduledTask Modification" -LogPath $sync.logfile
-
- $ScheduledTaskToModify | ForEach-Object {
- Try{
- if($($psitem.State) -eq "Disabled"){
- Disable-ScheduledTask -TaskName "$($psitem.name)" -ErrorAction Stop | Out-Null
- }
- if($($psitem.State) -eq "Enabled"){
- Enable-TaskName "$($psitem.name)" -ErrorAction Stop | Out-Null
- }
- Write-Logs -Level INFO -Message "Scheduled Task $($psitem.name) set to $($psitem.State)" -LogPath $sync.logfile
- }Catch{Write-Logs -Level ERROR -Message "Unable to set Scheduled Task $($psitem.name) set to $($psitem.State)" -LogPath $sync.logfile}
- }
-
- Write-Logs -Level INFO -Message "Finished setting ScheduledTasks" -LogPath $sync.logfile
- }
-
- if($AppxToModify){
- Write-Logs -Level INFO -Message "Starting Appx Modification" -LogPath $sync.logfile
-
- $AppxToModify | ForEach-Object {
- Try{
- Get-AppxPackage -Name $psitem| Remove-AppxPackage -ErrorAction Stop
- Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $psitem | Remove-AppxProvisionedPackage -ErrorAction stop -Online
- Write-Logs -Level INFO -Message "Uninstalled $psitem" -LogPath $sync.logfile
- }Catch{Write-Logs -Level ERROR -Message "Failed to uninstall $psitem" -LogPath $sync.logfile }
- }
-
- Write-Logs -Level INFO -Message "Finished uninstalling Appx" -LogPath $sync.logfile
- }
-
- if($ScriptsToRun){
- Write-Logs -Level INFO -Message "Running Scripts" -LogPath $sync.logfile
-
- $ScriptsToRun | ForEach-Object {
- $Scriptblock = [scriptblock]::Create($psitem)
- #Invoke-Command -ScriptBlock $Scriptblock
- Start-Process $PSHOME\powershell.exe -Verb runas -ArgumentList "-Command $scriptblock" -Wait
- }
-
- #
- # Fix bad tweaks made from previous versions
- #
- Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -ErrorAction SilentlyContinue
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "ClearPageFileAtShutdown" -Type DWord -Value 0
-
- Write-Logs -Level INFO -Message "Finished Scripts" -LogPath $sync.logfile
- }
-
- Write-Logs -Level INFO -Message "Tweaks finished" -LogPath $sync.logfile
-
- if($sync["Form"]){
- $sync.taskrunning = $false
- [System.Windows.MessageBox]::Show("All modifications have finished",'Tweaks are done!',"OK","Info")
- }
-}
-
-$Sync.GUIUndoTweaks = {
-
- <#
-
- .DESCRIPTION
- This Scriptblock is meant to be ran from inside the GUI and will prevent the user from starting another tweak task.
-
- .EXAMPLE
-
- Invoke-command $sync.GUIUndoTweaks
-
- #>
-
- #Check if any check boxes have been checked and if a task is currently running
-
- if ($sync.taskrunning -eq $true){
- [System.Windows.MessageBox]::Show($sync.taskmessage,$sync.tasktitle,"OK","Info")
- return
- }
-
- $sync.taskrunning = $true
-
- #Invoke a runspace so that the GUI does not lock up
-
- Invoke-Runspace $sync.ScriptUndoTweaks
-}
-
-$sync.ScriptUndoTweaks = {
-
- <#
-
- .DESCRIPTION
- This scriptblock will undo all modifications from this script.
-
- TODO: Figure out error handling as any errors in this runspace will crash the powershell session.
-
- .EXAMPLE
-
- VerbosePreference = "Continue"
- Invoke-Command -ScriptBlock $sync.ScriptUndoTweaks
- #>
-
- $ErrorActionPreference = "SilentlyContinue"
-
- function Write-Logs {
- param($Level, $Message, $LogPath)
- Invoke-command $sync.WriteLogs -ArgumentList ($Level,$Message, $LogPath)
- }
-
- Write-Logs -Level INFO -Message "Creating Restore Point incase something bad happens" -LogPath $sync.logfile
- Enable-ComputerRestore -Drive "C:\"
- Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS"
-
- foreach ($tweak in $($sync.tweaks.psobject.properties)) {
-
- #registry reset
- Foreach ($registries in $($tweak.value.registry)){
- foreach($registry in $registries){
- Write-Logs -Level INFO -Message "Setting $("$($registry.path)\$($registry.name)") to $($registry.OriginalValue)" -LogPath $sync.logfile
- Set-ItemProperty -Path $registry.path -Name $registry.name -Type $registry.type -Value $registry.OriginalValue
- }
- }
- Write-Logs -Level INFO -Message "Finished reseting $($tweak.name) registries" -LogPath $sync.logfile
-
- #Services modification
- Foreach ($services in $($tweak.value.service)){
- foreach($service in $services) {
- Stop-Service "$($service.name)"
- Set-Service "$($service.name)" -StartupType $($service.OriginalType)
- Write-Logs -Level INFO -Message "Service $($service.name) set to $($service.OriginalType)" -LogPath $sync.logfile
- }
- }
- Write-Logs -Level INFO -Message "Finished reseting $($tweak.name) Services" -LogPath $sync.logfile
-
- #Scheduled Tasks Modification
- Foreach ($ScheduledTasks in $($tweak.value.ScheduledTask)){
- foreach($ScheduledTask in $ScheduledTasks) {
- if($($ScheduledTask.OriginalState) -eq "Disabled"){
- Disable-ScheduledTask -TaskName "$($ScheduledTask.name)" | Out-Null
- }
- if($($ScheduledTask.OriginalState) -eq "Enabled"){
- Enable-TaskName "$($ScheduledTask.name)" | Out-Null
- }
- Write-Logs -Level INFO -Message "Scheduled Task $($ScheduledTask.name) set to $($ScheduledTask.OriginalState)" -LogPath $sync.logfile
- }
- }
- Write-Logs -Level INFO -Message "Finished reseting $($tweak.name) Scheduled Tasks" -LogPath $sync.logfile
- }
-
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 1
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -ErrorAction SilentlyContinue
-
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) {
- Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Recurse -ErrorAction SilentlyContinue
- }
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {
- Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Recurse -ErrorAction SilentlyContinue
- }
- If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
- Remove-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue
- }
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) {
- Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Recurse -ErrorAction SilentlyContinue
- }
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
- Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue
- }
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) {
- Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Recurse -ErrorAction SilentlyContinue
- }
-
- Write-Logs -Level INFO -Message "Unrestricting AutoLogger directory" -LogPath $sync.logfile
- $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
- icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null
-
- Write-Logs -Level INFO -Message "Reset Local Group Policies to Stock Defaults" -LogPath $sync.logfile
- # cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose
- cmd /c RD /S /Q "%WinDir%\System32\GroupPolicyUsers"
- cmd /c RD /S /Q "%WinDir%\System32\GroupPolicy"
- cmd /c gpupdate /force
-
- Write-Logs -Level INFO -Message "Restoring Clipboard History..." -LogPath $sync.logfile
- Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory" -ErrorAction SilentlyContinue
-
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](158,30,7,128,18,0,0,0))
-
- if($sync["Form"]){
- $sync.taskrunning = $false
- [System.Windows.MessageBox]::Show("All tweaks have been removed",'Undo is done!',"OK","Info")
- }
-}
-
-#===========================================================================
-# Tab 3 - Config Buttons
-#===========================================================================
-
-<#
-
- This section is working as expected and logs output to console and $ENV:Temp\winutil.log
-
- TODO: Error Handling as Try blocks and -erroraction stop causes runspace to lock up
-
-#>
-
-$Sync.GUIFeatures = {
-
- <#
-
- .DESCRIPTION
- This Scriptblock is meant to be ran from inside the GUI and will prevent the user from starting another install task.
-
- Input data will look like below and link with the name of the check box. This will then look to the config/features.json file to find
- the install commands for the selected features.
-
- Featureshyperv,Featureslegacymedia
-
- .EXAMPLE
-
- Invoke-command $sync.GUIInstallPrograms -ArgumentList "Featureshyperv,Featureslegacymedia"
-
- #>
-
- param ($featuretoinstall)
-
- #Check if any check boxes have been checked and if a task is currently running
-
- if ($sync.taskrunning -eq $true){
- [System.Windows.MessageBox]::Show($sync.taskmessage,$sync.tasktitle,"OK","Info")
- return
- }
-
- if($featuretoinstall -notlike "*Features*"){
- [System.Windows.MessageBox]::Show("Please check the features you wish to install",'Nothing to do',"OK","Info")
- return
- }
-
- $sync.taskrunning = $true
-
- #Invoke a runspace so that the GUI does not lock up
-
- $params = @{
- ScriptBlock = $sync.ScriptFeatureInstall
- ArgumentList = ("$featuretoinstall")
- }
-
- Invoke-Runspace @params
-
-}
-
-$sync.ScriptFeatureInstall = {
-
- <#
-
- .DESCRIPTION
- This scriptblock will install the selected features from the config/features.json file.
-
- TODO: Figure out error handling as any errors in this runspace will crash the powershell session.
-
- .EXAMPLE
-
- $params = @{
- ScriptBlock = $sync.ScriptFeatureInstall
- ArgumentList = "Featureshyperv,Featureslegacymedia"
- Verbose = $true
- }
- VerbosePreference = "Continue"
- Invoke-Command @params
-
- #>
-
- param ($featuretoinstall)
-
- $featuretoinstall = $featuretoinstall -split ","
-
- function Write-Logs {
- param($Level, $Message, $LogPath)
- Invoke-command $sync.WriteLogs -ArgumentList ($Level,$Message, $LogPath)
- }
-
- Foreach ($feature in $featuretoinstall){
-
- $sync.feature.$feature | ForEach-Object {
- Try{
- Write-Logs -Level INFO -Message "Installing Windows Feature $psitem" -LogPath $sync.logfile
- Enable-WindowsOptionalFeature -Online -FeatureName "$psitem" -All -NoRestart
- Write-output $psitem
- }Catch{Write-Logs -Level ERROR -Message "Failed to install $psitem" -LogPath $sync.logfile}
-
- }
-
- }
-
- Write-Logs -Level INFO -Message "Finished Installing features" -LogPath $sync.logfile
-
- if($sync["Form"]){
- $sync.taskrunning = $false
- [System.Windows.MessageBox]::Show("Features have been installed",'Installs are done!',"OK","Info")
- }
-
-}
-
-#===========================================================================
-# Tab 4 - Updates Buttons
-#===========================================================================
-
-$Sync.GUIUpdates = {
-
- <#
-
- .DESCRIPTION
-
- Current Options
-
- "Updatesdefault"
- "Updatesdisable"
- "Updatessecurity"
-
- .EXAMPLE
-
- Invoke-command $sync.GUIUpdates -ArgumentList "Updatesdefault"
-
- #>
-
- param ($updatestoconfigure)
-
- #Check if any check boxes have been checked and if a task is currently running
-
- if ($sync.taskrunning -eq $true){
- [System.Windows.MessageBox]::Show($sync.taskmessage,$sync.tasktitle,"OK","Info")
- return
- }
-
- $sync.taskrunning = $true
-
- #Invoke a runspace so that the GUI does not lock up
-
- $params = @{
- ScriptBlock = $sync.ScriptUpdates
- ArgumentList = ("$updatestoconfigure")
- }
-
- Invoke-Runspace @params
-
-}
-
-$sync.ScriptUpdates = {
-
- <#
-
- .DESCRIPTION
- This scriptblock will install the selected features from the config/features.json file.
-
- TODO: Figure out error handling as any errors in this runspace will crash the powershell session.
-
- .EXAMPLE
-
- $params = @{
- ScriptBlock = $sync.ScriptFeatureInstall
- ArgumentList = "Featureshyperv,Featureslegacymedia"
- Verbose = $true
- }
- VerbosePreference = "Continue"
- Invoke-Command @params
-
- #>
-
- param ($updatestoconfigure)
-
- function Write-Logs {
- param($Level, $Message, $LogPath)
- Invoke-command $sync.WriteLogs -ArgumentList ($Level,$Message, $LogPath)
- }
- if($updatestoconfigure -eq "FixesUpdate"){
- # Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1 reversed!
- Set-StrictMode -Version Latest
- $ProgressPreference = 'SilentlyContinue'
- $ErrorActionPreference = 'Stop'
- trap {
- Write-Logs -Level "ERROR" -LogPath $sync.logfile -Message $psitem
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Sleeping for 60m to give you time to look around the virtual machine before self-destruction..."
- }
-
- # disable automatic updates.
- # XXX this does not seem to work anymore.
- # see How to configure automatic updates by using Group Policy or registry settings
- # at https://support.microsoft.com/en-us/help/328010
- function New-Directory($path) {
- $p, $components = $path -split '[\\/]'
- $components | ForEach-Object {
- $p = "$p\$psitem"
- if (!(Test-Path $p)) {
- New-Item -ItemType Directory $p | Out-Null
- }
- }
- $null
- }
- $auPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
- New-Directory $auPath
- # set NoAutoUpdate.
- # 0: Automatic Updates is enabled (default).
- # 1: Automatic Updates is disabled.
- New-ItemProperty `
- -Path $auPath `
- -Name NoAutoUpdate `
- -Value 0 `
- -PropertyType DWORD `
- -Force `
- | Out-Null
- # set AUOptions.
- # 1: Keep my computer up to date has been disabled in Automatic Updates.
- # 2: Notify of download and installation.
- # 3: Automatically download and notify of installation.
- # 4: Automatically download and scheduled installation.
- New-ItemProperty `
- -Path $auPath `
- -Name AUOptions `
- -Value 3 `
- -PropertyType DWORD `
- -Force `
- | Out-Null
-
- # disable Windows Update Delivery Optimization.
- # NB this applies to Windows 10.
- # 0: Disabled
- # 1: PCs on my local network
- # 3: PCs on my local network, and PCs on the Internet
- $deliveryOptimizationPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config'
- if (Test-Path $deliveryOptimizationPath) {
- New-ItemProperty `
- -Path $deliveryOptimizationPath `
- -Name DODownloadMode `
- -Value 0 `
- -PropertyType DWORD `
- -Force `
- | Out-Null
- }
- # Service tweaks for Windows Update
-
- $services = @(
- "BITS"
- "wuauserv"
- )
-
- foreach ($service in $services) {
- # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Setting $service StartupType to Automatic"
- Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic
- }
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Enabling driver offering through Windows Update..."
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Enabling Windows Update automatic restart..."
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Enabled driver offering through Windows Update"
- 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
-
- ### Reset Windows Update Script - reregister dlls, services, and remove registry entires.
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "1. Stopping Windows Update Services..."
- Stop-Service -Name BITS
- Stop-Service -Name wuauserv
- Stop-Service -Name appidsvc
- Stop-Service -Name cryptsvc
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "2. Remove QMGR Data file..."
- Remove-Item "$env:allusersprofile\Application Data\Microsoft\Network\Downloader\qmgr*.dat" -ErrorAction SilentlyContinue
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "3. Renaming the Software Distribution and CatRoot Folder..."
- Rename-Item $env:systemroot\SoftwareDistribution SoftwareDistribution.bak -ErrorAction SilentlyContinue
- Rename-Item $env:systemroot\System32\Catroot2 catroot2.bak -ErrorAction SilentlyContinue
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "4. Removing old Windows Update log..."
- Remove-Item $env:systemroot\WindowsUpdate.log -ErrorAction SilentlyContinue
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "5. Resetting the Windows Update Services to defualt settings..."
- "sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
- "sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
-
- Set-Location $env:systemroot\system32
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "6. Registering some DLLs..."
- regsvr32.exe /s atl.dll
- regsvr32.exe /s urlmon.dll
- regsvr32.exe /s mshtml.dll
- regsvr32.exe /s shdocvw.dll
- regsvr32.exe /s browseui.dll
- regsvr32.exe /s jscript.dll
- regsvr32.exe /s vbscript.dll
- regsvr32.exe /s scrrun.dll
- regsvr32.exe /s msxml.dll
- regsvr32.exe /s msxml3.dll
- regsvr32.exe /s msxml6.dll
- regsvr32.exe /s actxprxy.dll
- regsvr32.exe /s softpub.dll
- regsvr32.exe /s wintrust.dll
- regsvr32.exe /s dssenh.dll
- regsvr32.exe /s rsaenh.dll
- regsvr32.exe /s gpkcsp.dll
- regsvr32.exe /s sccbase.dll
- regsvr32.exe /s slbcsp.dll
- regsvr32.exe /s cryptdlg.dll
- regsvr32.exe /s oleaut32.dll
- regsvr32.exe /s ole32.dll
- regsvr32.exe /s shell32.dll
- regsvr32.exe /s initpki.dll
- regsvr32.exe /s wuapi.dll
- regsvr32.exe /s wuaueng.dll
- regsvr32.exe /s wuaueng1.dll
- regsvr32.exe /s wucltui.dll
- regsvr32.exe /s wups.dll
- regsvr32.exe /s wups2.dll
- regsvr32.exe /s wuweb.dll
- regsvr32.exe /s qmgr.dll
- regsvr32.exe /s qmgrprxy.dll
- regsvr32.exe /s wucltux.dll
- regsvr32.exe /s muweb.dll
- regsvr32.exe /s wuwebv.dll
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "7) Removing WSUS client settings..."
- #Fix to stop runspace from locking up if values not found
- start-process powershell.exe -Verb RunAs -ArgumentList "-c `"
- REG DELETE `"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate`" /v AccountDomainSid /f
- REG DELETE `"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate`" /v PingID /f
- REG DELETE `"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate`" /v SusClientId /f`"
- "
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "8) Resetting the WinSock..."
- netsh winsock reset
- netsh winhttp reset proxy
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "9) Delete all BITS jobs..."
- Get-BitsTransfer | Remove-BitsTransfer
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "10) Attempting to install the Windows Update Agent..."
- if([System.Environment]::Is64BitOperatingSystem){
- wusa Windows8-RT-KB2937636-x64 /quiet
- }
- else{
- wusa Windows8-RT-KB2937636-x86 /quiet
- }
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "11) Starting Windows Update Services..."
- Start-Service -Name BITS
- Start-Service -Name wuauserv
- Start-Service -Name appidsvc
- Start-Service -Name cryptsvc
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "12) Forcing discovery..."
- wuauclt /resetauthorization /detectnow
- }
- if($updatestoconfigure -eq "Updatesdisable"){
- # Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1
- Set-StrictMode -Version Latest
- $ProgressPreference = 'SilentlyContinue'
- $ErrorActionPreference = 'Stop'
- trap {
- Write-Logs -Level "ERROR" -LogPath $sync.logfile -Message $psitem
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Sleeping for 60m to give you time to look around the virtual machine before self-destruction..."
- }
-
- # disable automatic updates.
- # XXX this does not seem to work anymore.
- # see How to configure automatic updates by using Group Policy or registry settings
- # at https://support.microsoft.com/en-us/help/328010
- function New-Directory($path) {
- $p, $components = $path -split '[\\/]'
- $components | ForEach-Object {
- $p = "$p\$_"
- If (!(Test-Path $p)) {
- New-Item -ItemType Directory $p | Out-Null
- }
- }
- $null
- }
- $auPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
- New-Directory $auPath
- # set NoAutoUpdate.
- # 0: Automatic Updates is enabled (default).
- # 1: Automatic Updates is disabled.
- New-ItemProperty `
- -Path $auPath `
- -Name NoAutoUpdate `
- -Value 1 `
- -PropertyType DWORD `
- -Force `
- | Out-Null
- # set AUOptions.
- # 1: Keep my computer up to date has been disabled in Automatic Updates.
- # 2: Notify of download and installation.
- # 3: Automatically download and notify of installation.
- # 4: Automatically download and scheduled installation.
- New-ItemProperty `
- -Path $auPath `
- -Name AUOptions `
- -Value 1 `
- -PropertyType DWORD `
- -Force `
- | Out-Null
-
- # disable Windows Update Delivery Optimization.
- # NB this applies to Windows 10.
- # 0: Disabled
- # 1: PCs on my local network
- # 3: PCs on my local network, and PCs on the Internet
- $deliveryOptimizationPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config'
- If (Test-Path $deliveryOptimizationPath) {
- New-ItemProperty `
- -Path $deliveryOptimizationPath `
- -Name DODownloadMode `
- -Value 0 `
- -PropertyType DWORD `
- -Force `
- | Out-Null
- }
- # Service tweaks for Windows Update
-
- $services = @(
- "BITS"
- "wuauserv"
- )
-
- foreach ($service in $services) {
- # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Setting $service StartupType to Disabled"
- Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
- }
- }
- if($updatestoconfigure -eq "Updatessecurity"){
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Disabling driver offering through Windows Update..."
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Type DWord -Value 1
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -Type DWord -Value 0
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -Type DWord -Value 1
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Disabling Windows Update automatic restart..."
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Disabled driver offering through Windows Update"
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "BranchReadinessLevel" -Type DWord -Value 20
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferFeatureUpdatesPeriodInDays" -Type DWord -Value 365
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays " -Type DWord -Value 4
- }
- if($updatestoconfigure -eq "Updatesdefault"){
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 3
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
-
- $services = @(
- "BITS"
- "wuauserv"
- )
-
- foreach ($service in $services) {
- # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
-
- Write-Host "Setting $service StartupType to Automatic"
- Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic
- }
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Enabling driver offering through Windows Update..."
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Enabling Windows Update automatic restart..."
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Enabled driver offering through Windows Update"
- 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-Logs -Level "INFO" -LogPath $sync.logfile -Message "Updates set to default"
- }
-
- Write-Logs -Level "INFO" -LogPath $sync.logfile -Message "Process complete. Please reboot your computer."
-
- if($sync["Form"]){
- $sync.taskrunning = $false
- [System.Windows.MessageBox]::Show("Updates have been configured",'Configuration is done!',"OK","Info")
- }
-
-}
-
-#endregion Scripts
-
-$runspace = [RunspaceFactory]::CreateRunspace()
-$runspace.ApartmentState = "STA"
-$runspace.ThreadOptions = "ReuseThread"
-$runspace.Open()
-$runspace.SessionStateProxy.SetVariable("sync", $sync)
-
-#Get ComputerInfo in the background
-Invoke-Runspace -ScriptBlock {$sync.ComputerInfo = Get-ComputerInfo} | Out-Null
-
-#region form
-
-#WinForms dependancies
-[Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
-Add-Type -AssemblyName System.Windows.Forms
-Add-Type -AssemblyName PresentationFramework
-[System.Windows.Forms.Application]::EnableVisualStyles()
-
-#List of config files to import
-$configs = (
- "applications",
- "tweaks",
- "preset",
- "feature"
-)
-
-#Test for admin credentials
-if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
- $IsAdmin = $false
-}
-
-#To use local files run $env:environment = "dev" before starting the ps1 file
-if($env:environment -eq "dev"){
-
- if($IsAdmin -eq $false){
- [System.Windows.MessageBox]::Show("This application needs to be run as Admin",'Administrative privileges required',"OK","Info")
- return
- }
-
- $confirm = [System.Windows.MessageBox]::Show('$ENV:Evnronment is set to dev. Do you wish to load the dev environment?','Dev Environment tag detected',"YesNo","Info")
-}
-
-if($confirm -eq "yes"){
- $inputXML = Get-Content "MainWindow.xaml"
- $configs | ForEach-Object {
- $sync["$PSItem"] = Get-Content .\config\$PSItem.json | ConvertFrom-Json
- }
-}
-else{
-
- #Select the working branch
- if($env:branch){
- $branch = $env:branch
- }
-
- Else {$branch = $BranchToUse}
-
- if($IsAdmin -eq $false){
- Write-Output "This application needs to be run as an administrator. Attempting relaunch"
- Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "iwr -useb https://christitus.com/win | iex"
- break
- }
-
- $inputXML = (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/ChrisTitusTech/winutil/$branch/MainWindow.xaml")
- $configs | ForEach-Object {
- $sync["$psitem"] = Invoke-RestMethod "https://raw.githubusercontent.com/ChrisTitusTech/winutil/$branch/config/$psitem.json"
- }
-}
-
-#endregion form
-
-write-host ""
-write-host " CCCCCCCCCCCCCTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT "
-write-host " CCC::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
-write-host "CC:::::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
-write-host "C:::::CCCCCCCC::::CT:::::TT:::::::TT:::::TT:::::TT:::::::TT:::::T "
-write-host "C:::::C CCCCCCTTTTTT T:::::T TTTTTTTTTTTT T:::::T TTTTTT"
-write-host "C:::::C T:::::T T:::::T "
-write-host "C:::::C T:::::T T:::::T "
-write-host "C:::::C T:::::T T:::::T "
-write-host "C:::::C T:::::T T:::::T "
-write-host "C:::::C T:::::T T:::::T "
-write-host "C:::::C T:::::T T:::::T "
-write-host "C:::::C CCCCCC T:::::T T:::::T "
-write-host "C:::::CCCCCCCC::::C TT:::::::TT TT:::::::TT "
-write-host "CC:::::::::::::::C T:::::::::T T:::::::::T "
-write-host "CCC::::::::::::C T:::::::::T T:::::::::T "
-write-host " CCCCCCCCCCCCC TTTTTTTTTTT TTTTTTTTTTT "
-write-host ""
-write-host "====Chris Titus Tech====="
-write-host "=====Windows Toolbox====="
-
-if($gui -eq $true){
- $inputXML = $inputXML -replace 'mc:Ignorable="d"','' -replace "x:N",'N' -replace '^
- Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed."
- }
-
- # Store Form Objects In PowerShell
- $xaml.SelectNodes("//*[@Name]") | ForEach-Object {$sync["$("$($psitem.Name)")"] = $sync["Form"].FindName($psitem.Name)}
-
- #Gives every button the invoke-button function
- $sync.keys | ForEach-Object {
- if($sync.$psitem){
- if($($sync["$psitem"].GetType() | Select-Object -ExpandProperty Name) -eq "Button"){
- $sync["$psitem"].Add_Click({
- [System.Object]$Sender = $args[0]
- Invoke-Button $Sender.name
- })
- }
- }
- }
-
- $sync["Form"].ShowDialog() | out-null
-}
-
-<#
-How to run Arguments
-
-First step is to set the $env:args variable with the setups you wish to do. To do multiple items put a " " space between each command.
-For commands that require input seperate the command with a colon ":" and provide the values to pass to that argument seperated by a comma ",". (IE: Install:git.git,windirstat.windirstat)
-
-Supported arguments:
-
- InstallUpgrade
- UndoTweaks
- PanelControl
- PanelNetwork
- PanelPower
- PanelSound
- PanelSystem
- PanelUser
- DefaultUpdates
- DisableUpdates
- EnableSecurity
- QuitAfter
- Install:value1,values2,...
- - Values should be the same values you would use for winget
- Tweaks:value1,values2,...
- - Values should be what you find inside the tweaks.json file
-
-Example usage:
-
- $env:args = "Install:git.git,WinDirStat.WinDirStat "; iwr -useb https://christitus.com/win | iex
-
- $env:args = "Tweaks:EssTweaksLoc,EssTweaksServices"; iwr -useb https://christitus.com/win | iex
-
- $env:args = "DefaultUpdates"; iwr -useb https://christitus.com/win | iex
-
- $env:args = "Install:git.git,WinDirStat.WinDirStat Tweaks:EssTweaksLoc,EssTweaksServices DefaultUpdates"; iwr -useb https://christitus.com/win | iex
-
-#>
-
-If($env:args){
-Write-Verbose "Arguments Detected, Running Args"
-
-#Ensure Computer Info is populated before continuing
-$x = 0
-do{
- Start-Sleep -Seconds 1
- $x++
-}until($sync.ComputerInfo -or $x -eq 10)
-if($x -eq 5){Invoke-command $sync.WriteLogs -ArgumentList ("WARINING","Failed to pull computer info after 5 seconds, this can cause some scripts to fail.", $sync.logfile)}
-
-If($env:args -match '\bInstallUpgrade\b'){Invoke-command $sync.ScriptsInstallPrograms -ArgumentList "Upgrade"}
-If($env:args -match '\bUndoTweaks\b'){Invoke-command $sync.ScriptUndoTweaks}
-If($env:args -match '\bPanelControl\b'){cmd /c control}
-If($env:args -match '\bPanelNetwork\b'){cmd /c ncpa.cpl}
-If($env:args -match '\bPanelPower\b'){cmd /c powercfg.cpl}
-If($env:args -match '\bPanelSound\b'){cmd /c mmsys.cpl}
-If($env:args -match '\bPanelSystem\b'){cmd /c sysdm.cpl}
-If($env:args -match '\bPanelUser\b'){cmd /c "control userpasswords2"}
-If($env:args -match '\bDefaultUpdates\b'){Invoke-command $sync.ScriptUpdates -ArgumentList "Updatesdefault"}
-If($env:args -match '\bDisableUpdates\b'){Invoke-command $sync.ScriptUpdates -ArgumentList "Updatesdisable"}
-If($env:args -match '\bEnableSecurity\b'){Invoke-command $sync.ScriptUpdates -ArgumentList "Updatessecurity"}
-If($env:args -match '\bQuitAfter\b'){Break}
-If($env:args -match '\bInstall\b'){
- $ProgramstoInstall = (($env:args-split " " | Where-Object {$_ -like "install*"} ) -split ":")[1]
- Write-Verbose "Installing $ProgramstoInstall."
- Invoke-command $sync.ScriptsInstallPrograms -ArgumentList "$ProgramstoInstall"
-}
-If($env:args -match '\bTweaks\b'){
- $Tweakstorun = (($env:args-split " " | Where-Object {$_ -like "Tweaks*"} ) -split ":")[1]
- Write-Verbose "Running the following tweaks $Tweakstorun."
- Invoke-command $sync.ScriptTweaks -ArgumentList "$Tweakstorun"
-}
-}
-
-Write-Host "Thank you for using winutil!"
-
diff --git a/scripts/main.ps1 b/scripts/main.ps1
new file mode 100644
index 00000000..210ed16b
--- /dev/null
+++ b/scripts/main.ps1
@@ -0,0 +1,87 @@
+#region exception classes
+
+ class WingetFailedInstall : Exception {
+ [string] $additionalData
+
+ WingetFailedInstall($Message) : base($Message) {}
+ }
+
+ class ChocoFailedInstall : Exception {
+ [string] $additionalData
+
+ ChocoFailedInstall($Message) : base($Message) {}
+ }
+
+ class GenericException : Exception {
+ [string] $additionalData
+
+ GenericException($Message) : base($Message) {}
+ }
+
+#endregion exception classes
+
+$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^
+ Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed."
+}
+
+#===========================================================================
+# Store Form Objects In PowerShell
+#===========================================================================
+
+$xaml.SelectNodes("//*[@Name]") | ForEach-Object { Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name) }
+
+$buttons = get-variable | Where-Object {$psitem.name -like "WPF*" -and $psitem.value -ne $null -and $psitem.value.GetType().name -eq "Button"}
+foreach ($button in $buttons){
+ $button.value.Add_Click({
+ [System.Object]$Sender = $args[0]
+ Invoke-WPFButton "WPF$($Sender.name)"
+ })
+}
+
+$WPFToggleDarkMode.IsChecked = Get-WinUtilDarkMode
+
+#===========================================================================
+# Setup background config
+#===========================================================================
+
+#Load information in the background
+Invoke-WPFRunspace -ScriptBlock {
+ $sync.ConfigLoaded = $False
+
+ $sync.ComputerInfo = Get-ComputerInfo
+
+ $sync.ConfigLoaded = $True
+} | Out-Null
+
+#===========================================================================
+# Shows the form
+#===========================================================================
+
+Invoke-WPFFormVariables
+
+try{
+ Install-WinUtilChoco
+}
+Catch [ChocoFailedInstall]{
+ Write-Host "==========================================="
+ Write-Host "-- Chocolatey failed to install ---"
+ Write-Host "==========================================="
+}
+$form.title = $form.title + " " + $sync.version
+$Form.ShowDialog() | out-null
+Stop-Transcript
diff --git a/scripts/start.ps1 b/scripts/start.ps1
new file mode 100644
index 00000000..9745e400
--- /dev/null
+++ b/scripts/start.ps1
@@ -0,0 +1,19 @@
+<#
+.NOTES
+ Author : Chris Titus @christitustech
+ Runspace Author: @DeveloperDurp
+ GitHub : https://github.com/ChrisTitusTech
+ Version : #{replaceme}
+#>
+
+Start-Transcript $ENV:TEMP\Winutil.log -Append
+
+#Load DLLs
+Add-Type -AssemblyName System.Windows.Forms
+
+# variable to sync between runspaces
+$sync = [Hashtable]::Synchronized(@{})
+$sync.PSScriptRoot = $PSScriptRoot
+$sync.version = "#{replaceme}"
+$sync.configs = @{}
+$sync.ProcessRunning = $false
diff --git a/winutil.ps1 b/winutil.ps1
index 069be2c2..35e068aa 100644
--- a/winutil.ps1
+++ b/winutil.ps1
@@ -1,1471 +1,1478 @@
-#for CI/CD
-$BranchToUse = 'main'
+
+################################################################################################################
+### ###
+### WARNING: This file is automatically generated DO NOT modify this file directly as it will be overwritten ###
+### ###
+################################################################################################################
<#
.NOTES
- Author : Chris Titus @christitustech
- GitHub : https://github.com/ChrisTitusTech
- Version 0.0.1
+ Author : Chris Titus @christitustech
+ Runspace Author: @DeveloperDurp
+ GitHub : https://github.com/ChrisTitusTech
+ Version : 23.03.07
#>
Start-Transcript $ENV:TEMP\Winutil.log -Append
-# $inputXML = Get-Content "MainWindow.xaml" #uncomment for development
-$inputXML = (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/ChrisTitusTech/winutil/$BranchToUse/MainWindow.xaml") #uncomment for Production
+#Load DLLs
+Add-Type -AssemblyName System.Windows.Forms
-# Check if chocolatey is installed and get its version
-if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)) {
- Write-Output "Chocolatey Version $chocoVersion is already installed"
-}else {
- Write-Output "Seems Chocolatey is not installed, installing now"
- Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- powershell choco feature enable -n allowGlobalConfirmation
-}
-
-#Load config files to hashtable
-$configs = @{}
-
-(
- "applications",
- "tweaks",
- "preset",
- "feature"
-) | ForEach-Object {
- #$configs["$PSItem"] = Get-Content .\config\$PSItem.json | ConvertFrom-Json
- $configs["$psitem"] = Invoke-RestMethod "https://raw.githubusercontent.com/ChrisTitusTech/winutil/$BranchToUse/config/$psitem.json"
-}
-
-
-$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^
- Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed."
-}
-
-#===========================================================================
-# Store Form Objects In PowerShell
-#===========================================================================
-
-$xaml.SelectNodes("//*[@Name]") | ForEach-Object { Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name) }
-
-#===========================================================================
-# Functions
-#===========================================================================
-
-Function Get-FormVariables {
- #If ($global:ReadmeDisplay -ne $true) { Write-host "If you need to reference this display again, run Get-FormVariables" -ForegroundColor Yellow; $global:ReadmeDisplay = $true }
-
-
- write-host ""
- write-host " CCCCCCCCCCCCCTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT "
- write-host " CCC::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
- write-host "CC:::::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
- write-host "C:::::CCCCCCCC::::CT:::::TT:::::::TT:::::TT:::::TT:::::::TT:::::T "
- write-host "C:::::C CCCCCCTTTTTT T:::::T TTTTTTTTTTTT T:::::T TTTTTT"
- write-host "C:::::C T:::::T T:::::T "
- write-host "C:::::C T:::::T T:::::T "
- write-host "C:::::C T:::::T T:::::T "
- write-host "C:::::C T:::::T T:::::T "
- write-host "C:::::C T:::::T T:::::T "
- write-host "C:::::C T:::::T T:::::T "
- write-host "C:::::C CCCCCC T:::::T T:::::T "
- write-host "C:::::CCCCCCCC::::C TT:::::::TT TT:::::::TT "
- write-host "CC:::::::::::::::C T:::::::::T T:::::::::T "
- write-host "CCC::::::::::::C T:::::::::T T:::::::::T "
- write-host " CCCCCCCCCCCCC TTTTTTTTTTT TTTTTTTTTTT "
- write-host ""
- write-host "====Chris Titus Tech====="
- write-host "=====Windows Toolbox====="
-
-
- #====DEBUG GUI Elements====
-
- #write-host "Found the following interactable elements from our form" -ForegroundColor Cyan
- #get-variable WPF*
-}
-
-Function Get-CheckBoxes {
+# variable to sync between runspaces
+$sync = [Hashtable]::Synchronized(@{})
+$sync.PSScriptRoot = $PSScriptRoot
+$sync.version = "23.03.07"
+$sync.configs = @{}
+$sync.ProcessRunning = $false
+Function Get-WinUtilCheckBoxes {
<#
-
+
.DESCRIPTION
Function is meant to find all checkboxes that are checked on the specefic tab and input them into a script.
- Outputed data will be the names of the checkboxes that were checked
+ Outputed data will be the names of the checkboxes that were checked
.EXAMPLE
- Get-CheckBoxes "WPFInstall"
-
+ Get-WinUtilCheckBoxes "WPFInstall"
+
#>
- Param($Group)
+ Param(
+ $Group,
+ [boolean]$unCheck = $true
+ )
+
- $CheckBoxes = get-variable | Where-Object {$psitem.name -like "$Group*" -and $psitem.value.GetType().name -eq "CheckBox"}
$Output = New-Object System.Collections.Generic.List[System.Object]
if($Group -eq "WPFInstall"){
+ $CheckBoxes = get-variable | Where-Object {$psitem.name -like "WPFInstall*" -and $psitem.value.GetType().name -eq "CheckBox"}
Foreach ($CheckBox in $CheckBoxes){
if($CheckBox.value.ischecked -eq $true){
- $Configs.applications.$($CheckBox.name).winget -split ";" | ForEach-Object {
+ $sync.configs.applications.$($CheckBox.name).winget -split ";" | ForEach-Object {
$Output.Add($psitem)
}
+ if ($uncheck -eq $true){
+ $CheckBox.value.ischecked = $false
+ }
- $CheckBox.value.ischecked = $false
}
}
}
-
+ if($Group -eq "WPFTweaks"){
+ $CheckBoxes = get-variable | Where-Object {$psitem.name -like "WPF*Tweaks*" -and $psitem.value.GetType().name -eq "CheckBox"}
+ Foreach ($CheckBox in $CheckBoxes){
+ if($CheckBox.value.ischecked -eq $true){
+ $Output.Add($Checkbox.Name)
+
+ if ($uncheck -eq $true){
+ $CheckBox.value.ischecked = $false
+ }
+ }
+ }
+ }
+
Write-Output $($Output | Select-Object -Unique)
}
-
-function Set-Presets {
+Function Get-WinUtilDarkMode {
<#
.DESCRIPTION
- Meant to make settings presets easier in the tweaks tab. Will pull the data from config/preset.json
+ Meant to pull the registry keys responsible for Dark Mode and returns true or false
+
+ #>
+ $app = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
+ $system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
+ if($app -eq 0 -and $system -eq 0){
+ return $true
+ }
+ else{
+ return $false
+ }
+}
+function Get-WinUtilInstallerProcess {
+ <#
+
+ .DESCRIPTION
+ Meant to check for running processes and will return a boolean response
#>
- param($preset)
- $CheckBoxesToCheck = $configs.preset.$preset
+ param($Process)
- #Uncheck all
+ if ($Null -eq $Process){
+ return $false
+ }
+ if (Get-Process -Id $Process.Id -ErrorAction SilentlyContinue){
+ return $true
+ }
+ return $false
+}
+function Install-WinUtilChoco {
+
+ <#
+
+ .DESCRIPTION
+ Function is meant to ensure Choco is installed
+
+ #>
+
+ try{
+ Write-Host "Checking if Chocolatey is Installed..."
+
+ if((Test-WinUtilPackageManager -choco)){
+ Write-Host "Chocolatey Already Installed"
+ return
+ }
+
+ Write-Host "Seems Chocolatey is not installed, installing now?"
+ #Let user decide if he wants to install Chocolatey
+ $confirmation = Read-Host "Are you Sure You Want To Proceed:(y/n)"
+ if ($confirmation -eq 'y') {
+ Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
+ powershell choco feature enable -n allowGlobalConfirmation
+ }
+ }
+ Catch{
+ throw [ChocoFailedInstall]::new('Failed to install')
+ }
+
+}
+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.
+
+ #>
+
+ param($ProgramsToInstall)
+
+ $x = 0
+ $count = $($ProgramsToInstall -split ",").Count
+
+ Write-Progress -Activity "Installing Applications" -Status "Starting" -PercentComplete 0
+
+ Foreach ($Program in $($ProgramsToInstall -split ",")){
+
+ Write-Progress -Activity "Installing Applications" -Status "Installing $Program $($x + 1) of $count" -PercentComplete $($x/$count*100)
+ Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --silent $Program" -NoNewWindow -Wait;
+ $X++
+ }
+
+ Write-Progress -Activity "Installing Applications" -Status "Finished" -Completed
+
+}
+function Install-WinUtilWinget {
+
+ <#
+
+ .DESCRIPTION
+ Function is meant to ensure winget is installed
+
+ #>
+ Try{
+ Write-Host "Checking if Winget is Installed..."
+ if (Test-WinUtilPackageManager -winget) {
+ #Checks if winget executable exists and if the Windows Version is 1809 or higher
+ Write-Host "Winget Already Installed"
+ return
+ }
+
+ #Gets the computer's information
+ if ($null -eq $sync.ComputerInfo){
+ $ComputerInfo = Get-ComputerInfo -ErrorAction Stop
+ }
+ Else {
+ $ComputerInfo = $sync.ComputerInfo
+ }
+
+ if (($ComputerInfo.WindowsVersion) -lt "1809") {
+ #Checks if Windows Version is too old for winget
+ Write-Host "Winget is not supported on this version of Windows (Pre-1809)"
+ return
+ }
+
+ #Gets the Windows Edition
+ $OSName = if ($ComputerInfo.OSName) {
+ $ComputerInfo.OSName
+ }else {
+ $ComputerInfo.WindowsProductName
+ }
+
+ if (((($OSName.IndexOf("LTSC")) -ne -1) -or ($OSName.IndexOf("Server") -ne -1)) -and (($ComputerInfo.WindowsVersion) -ge "1809")) {
+
+ Write-Host "Running Alternative Installer for LTSC/Server Editions"
+
+ # Switching to winget-install from PSGallery from asheroto
+ # Source: https://github.com/asheroto/winget-installer
+
+ Start-Process powershell.exe -Verb RunAs -ArgumentList "-command irm https://raw.githubusercontent.com/ChrisTitusTech/winutil/$BranchToUse/winget.ps1 | iex | Out-Host" -WindowStyle Normal -ErrorAction Stop
+
+ if(!(Test-WinUtilPackageManager -winget)){
+ break
+ }
+ }
+
+ else {
+ #Installing Winget from the Microsoft Store
+ Write-Host "Winget not found, installing it now."
+ Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
+ $nid = (Get-Process AppInstaller).Id
+ Wait-Process -Id $nid
+
+ if(!(Test-WinUtilPackageManager -winget)){
+ break
+ }
+ }
+ Write-Host "Winget Installed"
+ }
+ Catch{
+ throw [WingetFailedInstall]::new('Failed to install')
+ }
+}
+function Invoke-WinUtilScript {
+ <#
+
+ .DESCRIPTION
+ This function will run a seperate powershell script. Meant for things that can't be handled with the other functions
+
+ .EXAMPLE
+
+ $Scriptblock = [scriptblock]::Create({"Write-output 'Hello World'"})
+ Invoke-WinUtilScript -ScriptBlock $scriptblock -Name "Hello World"
+
+ #>
+ param (
+ $Name,
+ [scriptblock]$scriptblock
+ )
+
+ Try{
+ Invoke-Command $scriptblock -ErrorAction stop
+ Write-Host "Running Script for $name"
+ }
+ Catch{
+ Write-Warning "Unable to run script for $name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
+function Invoke-WinUtilTweaks {
+ <#
+
+ .DESCRIPTION
+ This function converts all the values from the tweaks.json and routes them to the appropriate function
+
+ #>
+
+ param(
+ $CheckBox,
+ $undo = $false
+ )
+ if($undo){
+ $Values = @{
+ Registry = "OriginalValue"
+ ScheduledTask = "OriginalState"
+ Service = "OriginalType"
+ }
+ }
+ Else{
+ $Values = @{
+ Registry = "Value"
+ ScheduledTask = "State"
+ Service = "StartupType"
+ }
+ }
+
+ if($sync.configs.tweaks.$CheckBox.registry){
+ $sync.configs.tweaks.$CheckBox.registry | ForEach-Object {
+ Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
+ }
+ }
+ if($sync.configs.tweaks.$CheckBox.ScheduledTask){
+ $sync.configs.tweaks.$CheckBox.ScheduledTask | ForEach-Object {
+ Set-WinUtilScheduledTask -Name $psitem.Name -State $psitem.$($values.ScheduledTask)
+ }
+ }
+ if($sync.configs.tweaks.$CheckBox.service){
+ $sync.configs.tweaks.$CheckBox.service | ForEach-Object {
+ Set-WinUtilService -Name $psitem.Name -StartupType $psitem.$($values.Service)
+ }
+ }
+
+ if(!$undo){
+ if($sync.configs.tweaks.$CheckBox.appx){
+ $sync.configs.tweaks.$CheckBox.appx | ForEach-Object {
+ Remove-WinUtilAPPX -Name $psitem
+ }
+ }
+ if($sync.configs.tweaks.$CheckBox.InvokeScript){
+ $sync.configs.tweaks.$CheckBox.InvokeScript | ForEach-Object {
+ $Scriptblock = [scriptblock]::Create($psitem)
+ Invoke-WinUtilScript -ScriptBlock $scriptblock -Name $CheckBox
+ }
+ }
+ }
+}
+function Remove-WinUtilAPPX {
+ <#
+
+ .DESCRIPTION
+ This function will remove any of the provided APPX names
+
+ .EXAMPLE
+
+ Remove-WinUtilAPPX -Name "Microsoft.Microsoft3DViewer"
+
+ #>
+ param (
+ $Name
+ )
+
+ Try{
+ Write-Host "Removing $Name"
+ Get-AppxPackage "*$Name*" | Remove-AppxPackage -ErrorAction SilentlyContinue
+ Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*$Name*" | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
+ }
+ Catch [System.Exception] {
+ if($psitem.Exception.Message -like "*The requested operation requires elevation*"){
+ Write-Warning "Unable to uninstall $name due to a Security Exception"
+ }
+ Else{
+ Write-Warning "Unable to uninstall $name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+ }
+ Catch{
+ Write-Warning "Unable to uninstall $name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
+function Set-WinUtilDNS {
+ <#
+
+ .DESCRIPTION
+ This function will set the DNS of all interfaces that are in the "Up" state. It will lookup the values from the DNS.Json file
+
+ .EXAMPLE
+
+ Set-WinUtilDNS -DNSProvider "google"
+
+ #>
+ param($DNSProvider)
+ if($DNSProvider -eq "Default"){return}
+ Try{
+ $Adapters = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
+ Write-Host "Ensuring DNS is set to $DNSProvider on the following interfaces"
+ Write-Host $($Adapters | Out-String)
+
+ Foreach ($Adapter in $Adapters){
+ if($DNSProvider -eq "DHCP"){
+ Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ResetServerAddresses
+ }
+ Else{
+ Set-DnsClientServerAddress -InterfaceIndex $Adapter.ifIndex -ServerAddresses ("$($sync.configs.dns.$DNSProvider.Primary)", "$($sync.configs.dns.$DNSProvider.Secondary)")
+ }
+ }
+ }
+ Catch{
+ Write-Warning "Unable to set DNS Provider due to an unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
+function Set-WinUtilRegistry {
+ <#
+
+ .DESCRIPTION
+ This function will make all modifications to the registry
+
+ .EXAMPLE
+
+ Set-WinUtilRegistry -Name "PublishUserActivities" -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Type "DWord" -Value "0"
+
+ #>
+ param (
+ $Name,
+ $Path,
+ $Type,
+ $Value
+ )
+
+ Try{
+ if(!(Test-Path 'HKU:\')){New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS}
+
+ If (!(Test-Path $Path)) {
+ Write-Host "$Path was not found, Creating..."
+ New-Item -Path $Path -Force -ErrorAction Stop | Out-Null
+ }
+
+ Write-Host "Set $Path\$Name to $Value"
+ Set-ItemProperty -Path $Path -Name $Name -Type $Type -Value $Value -Force -ErrorAction Stop | Out-Null
+ }
+ Catch [System.Security.SecurityException] {
+ Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
+ }
+ Catch [System.Management.Automation.ItemNotFoundException] {
+ Write-Warning $psitem.Exception.ErrorRecord
+ }
+ Catch{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
+function Set-WinUtilScheduledTask {
+ <#
+
+ .DESCRIPTION
+ This function will enable/disable the provided Scheduled Task
+
+ .EXAMPLE
+
+ Set-WinUtilScheduledTask -Name "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" -State "Disabled"
+
+ #>
+ param (
+ $Name,
+ $State
+ )
+
+ Try{
+ if($State -eq "Disabled"){
+ Write-Host "Disabling Scheduled Task $Name"
+ Disable-ScheduledTask -TaskName $Name -ErrorAction Stop
+ }
+ if($State -eq "Enabled"){
+ Write-Host "Enabling Scheduled Task $Name"
+ Enable-ScheduledTask -TaskName $Name -ErrorAction Stop
+ }
+ }
+ Catch [System.Exception]{
+ if($psitem.Exception.Message -like "*The system cannot find the file specified*"){
+ Write-Warning "Scheduled Task $name was not Found"
+ }
+ Else{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.Message
+ }
+ }
+ Catch{
+ Write-Warning "Unable to run script for $name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
+Function Set-WinUtilService {
+ <#
+
+ .DESCRIPTION
+ This function will change the startup type of services and start/stop them as needed
+
+ .EXAMPLE
+
+ Set-WinUtilService -Name "HomeGroupListener" -StartupType "Manual"
+
+ #>
+ param (
+ $Name,
+ $StartupType
+ )
+ Try{
+ Write-Host "Setting Services $Name to $StartupType"
+ Set-Service -Name $Name -StartupType $StartupType -ErrorAction Stop
+
+ if($StartupType -eq "Disabled"){
+ Write-Host "Stopping $Name"
+ Stop-Service -Name $Name -Force -ErrorAction Stop
+ }
+ if($StartupType -eq "Enabled"){
+ Write-Host "Starting $Name"
+ Start-Service -Name $Name -Force -ErrorAction Stop
+ }
+ }
+ Catch [System.Exception]{
+ if($psitem.Exception.Message -like "*Cannot find any service with service name*" -or
+ $psitem.Exception.Message -like "*was not found on computer*"){
+ Write-Warning "Service $name was not Found"
+ }
+ Else{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.Message
+ }
+ }
+ Catch{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
+function Test-WinUtilPackageManager {
+ <#
+
+ .DESCRIPTION
+ Checks for Winget or Choco depending on the paramater
+
+ #>
+
+ Param(
+ [System.Management.Automation.SwitchParameter]$winget,
+ [System.Management.Automation.SwitchParameter]$choco
+ )
+
+ if($winget){
+ if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) {
+ return $true
+ }
+ }
+
+ if($choco){
+ if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)){
+ return $true
+ }
+ }
+
+ return $false
+}
+Function Update-WinUtilProgramWinget {
+
+ <#
+
+ .DESCRIPTION
+ This will update programs via Winget using a new powershell.exe instance to prevent the GUI from locking up.
+
+ #>
+
+ [ScriptBlock]$wingetinstall = {
+
+ $host.ui.RawUI.WindowTitle = """Winget Install"""
+
+ Start-Transcript $ENV:TEMP\winget-update.log -Append
+ winget upgrade --all
+
+ Pause
+ }
+
+ $global:WinGetInstall = Start-Process -Verb runas powershell -ArgumentList "-command invoke-command -scriptblock {$wingetinstall} -argumentlist '$($ProgramsToInstall -join ",")'" -PassThru
+
+}
+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
+ #[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")
+
+ Switch -Wildcard ($Button){
+
+ "WPFTab?BT" {Invoke-WPFTab $Button}
+ "WPFinstall" {Invoke-WPFInstall}
+ "WPFInstallUpgrade" {Invoke-WPFInstallUpgrade}
+ "WPFdesktop" {Invoke-WPFPresets "Desktop"}
+ "WPFlaptop" {Invoke-WPFPresets "laptop"}
+ "WPFminimal" {Invoke-WPFPresets "minimal"}
+ "WPFexport" {Invoke-WPFImpex -type "export"}
+ "WPFimport" {Invoke-WPFImpex -type "import"}
+ "WPFclear" {Invoke-WPFPresets -preset $null -imported $true}
+ "WPFtweaksbutton" {Invoke-WPFtweaksbutton}
+ "WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enabled"}
+ "WPFRemoveUltPerf" {Invoke-WPFUltimatePerformance -State "Disabled"}
+ "WPFToggleDarkMode" {Invoke-WPFDarkMode -DarkMoveEnabled $(Get-WinUtilDarkMode)}
+ "WPFundoall" {Invoke-WPFundoall}
+ "WPFFeatureInstall" {Invoke-WPFFeatureInstall}
+ "WPFPanelDISM" {Invoke-WPFPanelDISM}
+ "WPFPanelAutologin" {Invoke-WPFPanelAutologin}
+ "WPFPanelcontrol" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPanelnetwork" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPanelpower" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPanelsound" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button}
+ "WPFPaneluser" {Invoke-WPFControlPanel -Panel $button}
+ "WPFUpdatesdefault" {Invoke-WPFUpdatesdefault}
+ "WPFFixesUpdate" {Invoke-WPFFixesUpdate}
+ "WPFUpdatesdisable" {Invoke-WPFUpdatesdisable}
+ "WPFUpdatessecurity" {Invoke-WPFUpdatessecurity}
+
+
+ }
+}
+function Invoke-WPFControlPanel {
+ <#
+
+ .DESCRIPTION
+ Simple Switch for lagacy windows
+
+ #>
+ param($Panel)
+
+ switch ($Panel){
+ "WPFPanelcontrol" {cmd /c control}
+ "WPFPanelnetwork" {cmd /c ncpa.cpl}
+ "WPFPanelpower" {cmd /c powercfg.cpl}
+ "WPFPanelsound" {cmd /c mmsys.cpl}
+ "WPFPanelsystem" {cmd /c sysdm.cpl}
+ "WPFPaneluser" {cmd /c "control userpasswords2"}
+ }
+}
+Function Invoke-WPFDarkMode {
+ <#
+
+ .DESCRIPTION
+ Sets Dark Mode on or off
+
+ #>
+ Param($DarkMoveEnabled)
+ Try{
+ if ($DarkMoveEnabled -eq $false){
+ Write-Host "Enabling Dark Mode"
+ $DarkMoveValue = 0
+ }
+ else {
+ Write-Host "Disabling Dark Mode"
+ $DarkMoveValue = 1
+ }
+
+ $Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
+ Set-ItemProperty -Path $Theme -Name AppsUseLightTheme -Value $DarkMoveValue
+ Set-ItemProperty -Path $Theme -Name SystemUsesLightTheme -Value $DarkMoveValue
+ }
+ Catch [System.Security.SecurityException] {
+ Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
+ }
+ Catch [System.Management.Automation.ItemNotFoundException] {
+ Write-Warning $psitem.Exception.ErrorRecord
+ }
+ Catch{
+ Write-Warning "Unable to set $Name due to unhandled exception"
+ Write-Warning $psitem.Exception.StackTrace
+ }
+}
+function Invoke-WPFFeatureInstall {
+ <#
+
+ .DESCRIPTION
+ GUI Function to install Windows Features
+
+ #>
+ If ( $WPFFeaturesdotnet.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "NetFx4-AdvSrvs" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -All -NoRestart
+ }
+ If ( $WPFFeatureshyperv.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "HypervisorPlatform" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-All" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Tools-All" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Management-PowerShell" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Hypervisor" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Services" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Management-Clients" -All -NoRestart
+ cmd /c bcdedit /set hypervisorschedulertype classic
+ Write-Host "HyperV is now installed and configured. Please Reboot before using."
+ }
+ If ( $WPFFeatureslegacymedia.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "MediaPlayback" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "DirectPlay" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "LegacyComponents" -All -NoRestart
+ }
+ If ( $WPFFeaturewsl.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -All -NoRestart
+ Write-Host "WSL is now installed and configured. Please Reboot before using."
+ }
+ If ( $WPFFeaturenfs.IsChecked -eq $true ) {
+ Enable-WindowsOptionalFeature -Online -FeatureName "ServicesForNFS-ClientOnly" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "ClientForNFS-Infrastructure" -All -NoRestart
+ Enable-WindowsOptionalFeature -Online -FeatureName "NFS-Administration" -All -NoRestart
+ nfsadmin client stop
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default" -Name "AnonymousUID" -Type DWord -Value 0
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default" -Name "AnonymousGID" -Type DWord -Value 0
+ nfsadmin client start
+ nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i
+ Write-Host "NFS is now setup for user based NFS mounts"
+ }
+ $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)
+
+ Write-Host "================================="
+ Write-Host "--- Features are Installed ---"
+ Write-Host "================================="
+}
+function Invoke-WPFFixesUpdate {
+
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+
+ ### Reset Windows Update Script - reregister dlls, services, and remove registry entires.
+ Write-Host "1. Stopping Windows Update Services..."
+ Stop-Service -Name BITS
+ Stop-Service -Name wuauserv
+ Stop-Service -Name appidsvc
+ Stop-Service -Name cryptsvc
+
+ Write-Host "2. Remove QMGR Data file..."
+ Remove-Item "$env:allusersprofile\Application Data\Microsoft\Network\Downloader\qmgr*.dat" -ErrorAction SilentlyContinue
+
+ Write-Host "3. Renaming the Software Distribution and CatRoot Folder..."
+ Rename-Item $env:systemroot\SoftwareDistribution SoftwareDistribution.bak -ErrorAction SilentlyContinue
+ Rename-Item $env:systemroot\System32\Catroot2 catroot2.bak -ErrorAction SilentlyContinue
+
+ Write-Host "4. Removing old Windows Update log..."
+ Remove-Item $env:systemroot\WindowsUpdate.log -ErrorAction SilentlyContinue
+
+ Write-Host "5. Resetting the Windows Update Services to defualt settings..."
+ "sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
+ "sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
+ Set-Location $env:systemroot\system32
+
+ Write-Host "6. Registering some DLLs..."
+ regsvr32.exe /s atl.dll
+ regsvr32.exe /s urlmon.dll
+ regsvr32.exe /s mshtml.dll
+ regsvr32.exe /s shdocvw.dll
+ regsvr32.exe /s browseui.dll
+ regsvr32.exe /s jscript.dll
+ regsvr32.exe /s vbscript.dll
+ regsvr32.exe /s scrrun.dll
+ regsvr32.exe /s msxml.dll
+ regsvr32.exe /s msxml3.dll
+ regsvr32.exe /s msxml6.dll
+ regsvr32.exe /s actxprxy.dll
+ regsvr32.exe /s softpub.dll
+ regsvr32.exe /s wintrust.dll
+ regsvr32.exe /s dssenh.dll
+ regsvr32.exe /s rsaenh.dll
+ regsvr32.exe /s gpkcsp.dll
+ regsvr32.exe /s sccbase.dll
+ regsvr32.exe /s slbcsp.dll
+ regsvr32.exe /s cryptdlg.dll
+ regsvr32.exe /s oleaut32.dll
+ regsvr32.exe /s ole32.dll
+ regsvr32.exe /s shell32.dll
+ regsvr32.exe /s initpki.dll
+ regsvr32.exe /s wuapi.dll
+ regsvr32.exe /s wuaueng.dll
+ regsvr32.exe /s wuaueng1.dll
+ regsvr32.exe /s wucltui.dll
+ regsvr32.exe /s wups.dll
+ regsvr32.exe /s wups2.dll
+ regsvr32.exe /s wuweb.dll
+ regsvr32.exe /s qmgr.dll
+ regsvr32.exe /s qmgrprxy.dll
+ regsvr32.exe /s wucltux.dll
+ regsvr32.exe /s muweb.dll
+ regsvr32.exe /s wuwebv.dll
+
+ Write-Host "7) Removing WSUS client settings..."
+ REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f
+ REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f
+ REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f
+
+ Write-Host "8) Resetting the WinSock..."
+ netsh winsock reset
+ netsh winhttp reset proxy
+ netsh int ip reset
+
+ Write-Host "9) Delete all BITS jobs..."
+ Get-BitsTransfer | Remove-BitsTransfer
+
+ Write-Host "10) Attempting to install the Windows Update Agent..."
+ If ([System.Environment]::Is64BitOperatingSystem) {
+ wusa Windows8-RT-KB2937636-x64 /quiet
+ }
+ else {
+ wusa Windows8-RT-KB2937636-x86 /quiet
+ }
+
+ Write-Host "11) Starting Windows Update Services..."
+ Start-Service -Name BITS
+ Start-Service -Name wuauserv
+ Start-Service -Name appidsvc
+ Start-Service -Name cryptsvc
+
+ Write-Host "12) Forcing discovery..."
+ wuauclt /resetauthorization /detectnow
+
+ Write-Host "Process complete. Please reboot your computer."
+
+ $ButtonType = [System.Windows.MessageBoxButton]::OK
+ $MessageboxTitle = "Reset Windows Update "
+ $Messageboxbody = ("Stock settings loaded.`n Please reboot your computer")
+ $MessageIcon = [System.Windows.MessageBoxImage]::Information
+
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+ Write-Host "================================="
+ Write-Host "-- Reset ALL Updates to Factory -"
+ Write-Host "================================="
+}
+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 }
+
+
+ Write-Host ""
+ Write-Host " CCCCCCCCCCCCCTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT "
+ Write-Host " CCC::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
+ Write-Host "CC:::::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T "
+ Write-Host "C:::::CCCCCCCC::::CT:::::TT:::::::TT:::::TT:::::TT:::::::TT:::::T "
+ Write-Host "C:::::C CCCCCCTTTTTT T:::::T TTTTTTTTTTTT T:::::T TTTTTT"
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C T:::::T T:::::T "
+ Write-Host "C:::::C CCCCCC T:::::T T:::::T "
+ Write-Host "C:::::CCCCCCCC::::C TT:::::::TT TT:::::::TT "
+ Write-Host "CC:::::::::::::::C T:::::::::T T:::::::::T "
+ Write-Host "CCC::::::::::::C T:::::::::T T:::::::::T "
+ Write-Host " CCCCCCCCCCCCC TTTTTTTTTTT TTTTTTTTTTT "
+ Write-Host ""
+ Write-Host "====Chris Titus Tech====="
+ Write-Host "=====Windows Toolbox====="
+
+
+ #====DEBUG GUI Elements====
+
+ #Write-Host "Found the following interactable elements from our form" -ForegroundColor Cyan
+ #get-variable WPF*
+}
+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)
+
+ if ($type -eq "export"){
+ $FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
+ }
+ if ($type -eq "import"){
+ $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
+ }
+
+ $FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
+ $FileBrowser.Filter = "JSON Files (*.json)|*.json"
+ $FileBrowser.ShowDialog() | Out-Null
+
+ if($FileBrowser.FileName -eq ""){
+ return
+ }
+
+ if ($type -eq "export"){
+ $jsonFile = Get-WinUtilCheckBoxes WPFTweaks -unCheck $false
+ $jsonFile | ConvertTo-Json | Out-File $FileBrowser.FileName -Force
+ }
+ if ($type -eq "import"){
+ $jsonFile = Get-Content $FileBrowser.FileName | ConvertFrom-Json
+ Invoke-WPFPresets -preset $jsonFile -imported $true
+ }
+}
+function Invoke-WPFInstall {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+
+ if($sync.ProcessRunning){
+ $msg = "Install process is currently running."
+ [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+ }
+
+ $WingetInstall = Get-WinUtilCheckBoxes -Group "WPFInstall"
+
+ if ($wingetinstall.Count -eq 0) {
+ $WarningMsg = "Please select the program(s) to install"
+ [System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+ }
+
+ Invoke-WPFRunspace -ArgumentList $WingetInstall -scriptblock {
+ param($WingetInstall)
+ try{
+ $sync.ProcessRunning = $true
+
+ # Ensure winget is installed
+ Install-WinUtilWinget
+
+ # Install all winget 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 "==========================================="
+ Write-Host "-- Installs have finished ---"
+ Write-Host "==========================================="
+ }
+ Catch {
+ Write-Host "==========================================="
+ Write-Host "-- Winget failed to install ---"
+ Write-Host "==========================================="
+ }
+ $sync.ProcessRunning = $False
+ }
+}
+function Invoke-WPFInstallUpgrade {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+ if(!(Test-WinUtilPackageManager -winget)){
+ Write-Host "==========================================="
+ Write-Host "-- Winget is not installed ---"
+ Write-Host "==========================================="
+ return
+ }
+
+ if(Get-WinUtilInstallerProcess -Process $global:WinGetInstall){
+ $msg = "Install process is currently running. Please check for a powershell window labled 'Winget Install'"
+ [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+ }
+
+ Update-WinUtilProgramWinget
+
+ Write-Host "==========================================="
+ Write-Host "-- Updates started ---"
+ Write-Host "-- You can close this window if desired ---"
+ Write-Host "==========================================="
+}
+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
+}
+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;
+ Write-Host '`n(3/4) DISM' -ForegroundColor Green; DISM /Online /Cleanup-Image /Restorehealth;
+ Write-Host '`n(4/4) SFC - 2nd scan' -ForegroundColor Green; sfc /scannow;
+ Read-Host '`nPress Enter to Continue'" -verb runas
+}
+function Invoke-WPFPresets {
+ <#
+
+ .DESCRIPTION
+ Meant to make settings presets easier in the tweaks tab. Will pull the data from config/preset.json
+
+ #>
+
+ param(
+ $preset,
+ [bool]$imported = $false
+ )
+ if($imported -eq $true){
+ $CheckBoxesToCheck = $preset
+ }
+ Else{
+ $CheckBoxesToCheck = $sync.configs.preset.$preset
+ }
+
+ #Uncheck all
get-variable | Where-Object {$_.name -like "*tweaks*"} | ForEach-Object {
if ($psitem.value.gettype().name -eq "CheckBox"){
- $CheckBox = Get-Variable $psitem.Name
+ $CheckBox = Get-Variable $psitem.Name
if ($CheckBoxesToCheck -contains $CheckBox.name){
$checkbox.value.ischecked = $true
}
else{$checkbox.value.ischecked = $false}
- }
+ }
}
}
+function Invoke-WPFRunspace {
-#===========================================================================
-# Global Variables
-#===========================================================================
-
-$AppTitle = "Chris Titus Tech's Windows Utility"
-
-#===========================================================================
-# Navigation Controls
-#===========================================================================
-
-$WPFTab1BT.Add_Click({
- $WPFTabNav.Items[0].IsSelected = $true
- $WPFTabNav.Items[1].IsSelected = $false
- $WPFTabNav.Items[2].IsSelected = $false
- $WPFTabNav.Items[3].IsSelected = $false
- })
-$WPFTab2BT.Add_Click({
- $WPFTabNav.Items[0].IsSelected = $false
- $WPFTabNav.Items[1].IsSelected = $true
- $WPFTabNav.Items[2].IsSelected = $false
- $WPFTabNav.Items[3].IsSelected = $false
- })
-$WPFTab3BT.Add_Click({
- $WPFTabNav.Items[0].IsSelected = $false
- $WPFTabNav.Items[1].IsSelected = $false
- $WPFTabNav.Items[2].IsSelected = $true
- $WPFTabNav.Items[3].IsSelected = $false
- })
-$WPFTab4BT.Add_Click({
- $WPFTabNav.Items[0].IsSelected = $false
- $WPFTabNav.Items[1].IsSelected = $false
- $WPFTabNav.Items[2].IsSelected = $false
- $WPFTabNav.Items[3].IsSelected = $true
- })
-
-#===========================================================================
-# Tab 1 - Install
-#===========================================================================
-
-$WPFinstall.Add_Click({
- $WingetInstall = Get-CheckBoxes -Group "WPFInstall"
-
- # Check if winget is installed
- Write-Host "Checking if Winget is Installed..."
- if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) {
- #Checks if winget executable exists and if the Windows Version is 1809 or higher
- Write-Host "Winget Already Installed"
- }
- else {
- #Gets the computer's information
- $ComputerInfo = Get-ComputerInfo
-
- #Gets the Windows Edition
- $OSName = if ($ComputerInfo.OSName) {
- $ComputerInfo.OSName
- }else {
- $ComputerInfo.WindowsProductName
- }
-
- if (((($OSName.IndexOf("LTSC")) -ne -1) -or ($OSName.IndexOf("Server") -ne -1)) -and (($ComputerInfo.WindowsVersion) -ge "1809")) {
-
- Write-Host "Running Alternative Installer for LTSC/Server Editions"
-
- # Switching to winget-install from PSGallery from asheroto
- # Source: https://github.com/asheroto/winget-installer
-
- Start-Process powershell.exe -Verb RunAs -ArgumentList "-command irm https://raw.githubusercontent.com/ChrisTitusTech/winutil/$BranchToUse/winget.ps1 | iex | Out-Host" -WindowStyle Normal
-
- }
- elseif (((Get-ComputerInfo).WindowsVersion) -lt "1809") {
- #Checks if Windows Version is too old for winget
- Write-Host "Winget is not supported on this version of Windows (Pre-1809)"
- }
- else {
- #Installing Winget from the Microsoft Store
- Write-Host "Winget not found, installing it now."
- Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
- $nid = (Get-Process AppInstaller).Id
- Wait-Process -Id $nid
- Write-Host "Winget Installed"
- }
- }
-
- if ($wingetinstall.Count -eq 0) {
- $WarningMsg = "Please select the program(s) to install"
- [System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
- return
- }
-
- # Install all winget programs in new window
- #$wingetinstall.ToArray()
- # Define Output variable
- $wingetResult = New-Object System.Collections.Generic.List[System.Object]
- foreach ( $node in $wingetinstall ) {
- try {
- Start-Process powershell.exe -Verb RunAs -ArgumentList "-command Start-Transcript $ENV:TEMP\winget-$node.log -Append; winget install -e --accept-source-agreements --accept-package-agreements --silent $node | Out-Host" -WindowStyle Normal
- $wingetResult.Add("$node`n")
- Start-Sleep -s 6
- Wait-Process winget -Timeout 90 -ErrorAction SilentlyContinue
- }
- catch [System.InvalidOperationException] {
- Write-Warning "Allow Yes on User Access Control to Install"
- }
- catch {
- Write-Error $_.Exception
- }
- }
- $wingetResult.ToArray()
- $wingetResult | ForEach-Object { $_ } | Out-Host
-
- # Popup after finished
- $ButtonType = [System.Windows.MessageBoxButton]::OK
- if ($wingetResult -ne "") {
- $Messageboxbody = "Installed Programs `n$($wingetResult)"
- }
- else {
- $Messageboxbody = "No Program(s) are installed"
- }
- $MessageIcon = [System.Windows.MessageBoxImage]::Information
-
- [System.Windows.MessageBox]::Show($Messageboxbody, $AppTitle, $ButtonType, $MessageIcon)
-
- Write-Host "================================="
- Write-Host "--- Installs are Finished ---"
- Write-Host "================================="
-
- })
-
-$WPFInstallUpgrade.Add_Click({
- $isUpgradeSuccess = $false
- try {
- Start-Process powershell.exe -Verb RunAs -ArgumentList "-command winget upgrade --all | Out-Host" -Wait -WindowStyle Normal
- $isUpgradeSuccess = $true
- }
- catch [System.InvalidOperationException] {
- Write-Warning "Allow Yes on User Access Control to Upgrade"
- }
- catch {
- Write-Error $_.Exception
- }
- $ButtonType = [System.Windows.MessageBoxButton]::OK
- $Messageboxbody = if ($isUpgradeSuccess) { "Upgrade Done" } else { "Upgrade was not succesful" }
- $MessageIcon = [System.Windows.MessageBoxImage]::Information
-
- [System.Windows.MessageBox]::Show($Messageboxbody, $AppTitle, $ButtonType, $MessageIcon)
- })
-
-#===========================================================================
-# Tab 2 - Tweak Buttons
-#===========================================================================
-$WPFdesktop.Add_Click({
- Set-Presets "Desktop"
-})
-
-$WPFlaptop.Add_Click({
- Set-Presets "laptop"
-})
-
-$WPFminimal.Add_Click({
- Set-Presets "minimal"
-})
-
-$WPFtweaksbutton.Add_Click({
-
- If ( $WPFEssTweaksAH.IsChecked -eq $true ) {
- Write-Host "Disabling Activity History..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 0
- $WPFEssTweaksAH.IsChecked = $false
- }
-
- If ( $WPFEssTweaksDeleteTempFiles.IsChecked -eq $true ) {
- Write-Host "Delete Temp Files"
- Get-ChildItem -Path "C:\Windows\Temp" *.* -Recurse | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
- Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue
- $WPFEssTweaksDeleteTempFiles.IsChecked = $false
- Write-Host "======================================="
- Write-Host "--- Cleaned following folders:"
- Write-Host "--- C:\Windows\Temp"
- Write-Host "--- "$env:TEMP
- Write-Host "======================================="
- }
-
- If ( $WPFEssTweaksDVR.IsChecked -eq $true ) {
- If (!(Test-Path "HKCU:\System\GameConfigStore")) {
- New-Item -Path "HKCU:\System\GameConfigStore" -Force
- }
- Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_DXGIHonorFSEWindowsCompatible" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_HonorUserFSEBehaviorMode" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_EFSEFeatureFlags" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_Enabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name "GameDVR_FSEBehavior" -Type DWord -Value 2
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Force
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -Type DWord -Value 0
- $WPFEssTweaksDVR.IsChecked = $false
- }
-
- If ( $WPFEssTweaksHiber.IsChecked -eq $true ) {
- Write-Host "Disabling Hibernation..."
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernateEnabled" -Type Dword -Value 0
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 0
- $WPFEssTweaksHiber.IsChecked = $false
- }
- If ( $WPFEssTweaksHome.IsChecked -eq $true ) {
- $WPFEssTweaksHome.IsChecked = $false
- }
- If ( $WPFEssTweaksLoc.IsChecked -eq $true ) {
- Write-Host "Disabling Location Tracking..."
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Deny"
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0
- Write-Host "Disabling automatic Maps updates..."
- Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0
- $WPFEssTweaksLoc.IsChecked = $false
- }
- If ( $WPFMiscTweaksDisableTPMCheck.IsChecked -eq $true ) {
- Write-Host "Disabling TPM Check..."
- If (!(Test-Path "HKLM:\SYSTEM\Setup\MoSetup")) {
- New-Item -Path "HKLM:\SYSTEM\Setup\MoSetup" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SYSTEM\Setup\MoSetup" -Name "AllowUpgradesWithUnsupportedTPM" -Type DWord -Value 1
- $WPFMiscTweaksDisableTPMCheck.IsChecked = $false
- }
- If ( $WPFEssTweaksDiskCleanup.IsChecked -eq $true ) {
- Write-Host "Running Disk Cleanup on Drive C:..."
- cmd /c cleanmgr.exe /d C: /VERYLOWDISK
- $WPFEssTweaksDiskCleanup.IsChecked = $false
- }
- If ( $WPFMiscTweaksDisableUAC.IsChecked -eq $true) {
- Write-Host "Disabling UAC..."
- # This below is the pussy mode which can break some apps. Please. Leave this on 1.
- # below i will show a way to do it without breaking some Apps that check UAC. U need to be admin tho.
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLUA" -Type DWord -Value 0
- Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -Type DWord -Value 0 # Default is 5
- # This will set the GPO Entry in Security so that Admin users elevate without any prompt while normal users still elevate and u can even leave it ennabled.
- # It will just not bother u anymore
- $WPFMiscTweaksDisableUAC.IsChecked = $false
- }
-
- If ( $WPFMiscTweaksDisableNotifications.IsChecked -eq $true ) {
- Write-Host "Disabling Notifications and Action Center..."
- New-Item -Path "HKCU:\Software\Policies\Microsoft\Windows" -Name "Explorer" -force
- New-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -PropertyType "DWord" -Value 1
- New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -PropertyType "DWord" -Value 0 -force
- $WPFMiscTweaksDisableNotifications.IsChecked = $false
- }
-
- If ( $WPFMiscTweaksRightClickMenu.IsChecked -eq $true ) {
- Write-Host "Setting Classic Right-Click Menu..."
- New-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Name "InprocServer32" -force -value ""
- $WPFMiscTweaksRightClickMenu.IsChecked = $false
- }
- If ( $WPFchangedns.text -eq 'Google' ) {
- Write-Host "Setting DNS to Google for all connections..."
- $DC = "8.8.8.8"
- $Internet = "8.8.4.4"
- $dns = "$DC", "$Internet"
- $Interfaces = [System.Management.ManagementClass]::new("Win32_NetworkAdapterConfiguration").GetInstances()
- $Interfaces.SetDNSServerSearchOrder($dns) | Out-Null
- }
- If ( $WPFchangedns.text -eq 'Cloud Flare' ) {
- Write-Host "Setting DNS to Cloud Flare for all connections..."
- $DC = "1.1.1.1"
- $Internet = "1.0.0.1"
- $dns = "$DC", "$Internet"
- $Interfaces = [System.Management.ManagementClass]::new("Win32_NetworkAdapterConfiguration").GetInstances()
- $Interfaces.SetDNSServerSearchOrder($dns) | Out-Null
- }
- If ( $WPFchangedns.text -eq 'Level3' ) {
- Write-Host "Setting DNS to Level3 for all connections..."
- $DC = "4.2.2.2"
- $Internet = "4.2.2.1"
- $dns = "$DC", "$Internet"
- $Interfaces = [System.Management.ManagementClass]::new("Win32_NetworkAdapterConfiguration").GetInstances()
- $Interfaces.SetDNSServerSearchOrder($dns) | Out-Null
- }
- If ( $WPFchangedns.text -eq 'Open DNS' ) {
- Write-Host "Setting DNS to Open DNS for all connections..."
- $DC = "208.67.222.222"
- $Internet = "208.67.220.220"
- $dns = "$DC", "$Internet"
- $Interfaces = [System.Management.ManagementClass]::new("Win32_NetworkAdapterConfiguration").GetInstances()
- $Interfaces.SetDNSServerSearchOrder($dns) | Out-Null
- }
- If ( $WPFEssTweaksOO.IsChecked -eq $true ) {
- If (!(Test-Path .\ooshutup10.cfg)) {
- Write-Host "Running O&O Shutup with Recommended Settings"
- curl.exe -s "https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg" -o ooshutup10.cfg
- curl.exe -s "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -o OOSU10.exe
- }
- ./OOSU10.exe ooshutup10.cfg /quiet
- $WPFEssTweaksOO.IsChecked = $false
- }
- If ( $WPFEssTweaksRP.IsChecked -eq $true ) {
- Write-Host "Creating Restore Point in case something bad happens"
- Enable-ComputerRestore -Drive "$env:SystemDrive"
- Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS"
- $WPFEssTweaksRP.IsChecked = $false
- }
- If ( $WPFEssTweaksServices.IsChecked -eq $true ) {
- # Set Services to Manual
-
- $services = @(
- "ALG" # Application Layer Gateway Service(Provides support for 3rd party protocol plug-ins for Internet Connection Sharing)
- "AJRouter" # Needed for AllJoyn Router Service
- "BcastDVRUserService_48486de" # GameDVR and Broadcast is used for Game Recordings and Live Broadcasts
- #"BDESVC" # Bitlocker Drive Encryption Service
- #"BFE" # Base Filtering Engine (Manages Firewall and Internet Protocol security)
- #"BluetoothUserService_48486de" # Bluetooth user service supports proper functionality of Bluetooth features relevant to each user session.
- #"BrokerInfrastructure" # Windows Infrastructure Service (Controls which background tasks can run on the system)
- "Browser" # Let users browse and locate shared resources in neighboring computers
- "BthAvctpSvc" # AVCTP service (needed for Bluetooth Audio Devices or Wireless Headphones)
- "CaptureService_48486de" # Optional screen capture functionality for applications that call the Windows.Graphics.Capture API.
- "cbdhsvc_48486de" # Clipboard Service
- "diagnosticshub.standardcollector.service" # Microsoft (R) Diagnostics Hub Standard Collector Service
- "DiagTrack" # Diagnostics Tracking Service
- "dmwappushservice" # WAP Push Message Routing Service
- "DPS" # Diagnostic Policy Service (Detects and Troubleshoots Potential Problems)
- "edgeupdate" # Edge Update Service
- "edgeupdatem" # Another Update Service
- #"EntAppSvc" # Enterprise Application Management.
- "Fax" # Fax Service
- "fhsvc" # Fax History
- "FontCache" # Windows font cache
- #"FrameServer" # Windows Camera Frame Server (Allows multiple clients to access video frames from camera devices)
- "gupdate" # Google Update
- "gupdatem" # Another Google Update Service
- #"iphlpsvc" # ipv6(Most websites use ipv4 instead) - Needed for Xbox Live
- "lfsvc" # Geolocation Service
- #"LicenseManager" # Disable LicenseManager (Windows Store may not work properly)
- "lmhosts" # TCP/IP NetBIOS Helper
- "MapsBroker" # Downloaded Maps Manager
- "MicrosoftEdgeElevationService" # Another Edge Update Service
- "MSDTC" # Distributed Transaction Coordinator
- "NahimicService" # Nahimic Service
- #"ndu" # Windows Network Data Usage Monitor (Disabling Breaks Task Manager Per-Process Network Monitoring)
- "NetTcpPortSharing" # Net.Tcp Port Sharing Service
- "PcaSvc" # Program Compatibility Assistant Service
- "PerfHost" # Remote users and 64-bit processes to query performance.
- "PhoneSvc" # Phone Service(Manages the telephony state on the device)
- #"PNRPsvc" # Peer Name Resolution Protocol (Some peer-to-peer and collaborative applications, such as Remote Assistance, may not function, Discord will still work)
- #"p2psvc" # Peer Name Resolution Protocol(Enables multi-party communication using Peer-to-Peer Grouping. If disabled, some applications, such as HomeGroup, may not function. Discord will still work)iscord will still work)
- #"p2pimsvc" # Peer Networking Identity Manager (Peer-to-Peer Grouping services may not function, and some applications, such as HomeGroup and Remote Assistance, may not function correctly. Discord will still work)
- "PrintNotify" # Windows printer notifications and extentions
- "QWAVE" # Quality Windows Audio Video Experience (audio and video might sound worse)
- "RemoteAccess" # Routing and Remote Access
- "RemoteRegistry" # Remote Registry
- "RetailDemo" # Demo Mode for Store Display
- "RtkBtManServ" # Realtek Bluetooth Device Manager Service
- "SCardSvr" # Windows Smart Card Service
- "seclogon" # Secondary Logon (Disables other credentials only password will work)
- "SEMgrSvc" # Payments and NFC/SE Manager (Manages payments and Near Field Communication (NFC) based secure elements)
- "SharedAccess" # Internet Connection Sharing (ICS)
- #"Spooler" # Printing
- "stisvc" # Windows Image Acquisition (WIA)
- #"StorSvc" # StorSvc (usb external hard drive will not be reconized by windows)
- "SysMain" # Analyses System Usage and Improves Performance
- "TrkWks" # Distributed Link Tracking Client
- #"WbioSrvc" # Windows Biometric Service (required for Fingerprint reader / facial detection)
- "WerSvc" # Windows error reporting
- "wisvc" # Windows Insider program(Windows Insider will not work if Disabled)
- #"WlanSvc" # WLAN AutoConfig
- "WMPNetworkSvc" # Windows Media Player Network Sharing Service
- "WpcMonSvc" # Parental Controls
- "WPDBusEnum" # Portable Device Enumerator Service
- "WpnService" # WpnService (Push Notifications may not work)
- #"wscsvc" # Windows Security Center Service
- "WSearch" # Windows Search
- "XblAuthManager" # Xbox Live Auth Manager (Disabling Breaks Xbox Live Games)
- "XblGameSave" # Xbox Live Game Save Service (Disabling Breaks Xbox Live Games)
- "XboxNetApiSvc" # Xbox Live Networking Service (Disabling Breaks Xbox Live Games)
- "XboxGipSvc" # Xbox Accessory Management Service
- # Hp services
- "HPAppHelperCap"
- "HPDiagsCap"
- "HPNetworkCap"
- "HPSysInfoCap"
- "HpTouchpointAnalyticsService"
- # Hyper-V services
- "HvHost"
- "vmicguestinterface"
- "vmicheartbeat"
- "vmickvpexchange"
- "vmicrdv"
- "vmicshutdown"
- "vmictimesync"
- "vmicvmsession"
- # Services that cannot be disabled
- #"WdNisSvc"
- )
-
- foreach ($service in $services) {
- # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
-
- Write-Host "Setting $service StartupType to Manual"
- Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Manual -ErrorAction SilentlyContinue
- }
- $WPFEssTweaksServices.IsChecked = $false
- }
- If ( $WPFEssTweaksStorage.IsChecked -eq $true ) {
- Write-Host "Disabling Storage Sense..."
- Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" -Recurse -ErrorAction SilentlyContinue
- $WPFEssTweaksStorage.IsChecked = $false
- }
- If ( $WPFEssTweaksTele.IsChecked -eq $true ) {
- Write-Host "Disabling Telemetry..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
- Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null
- Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null
- Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null
- Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null
- Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null
- Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null
- Write-Host "Disabling Application suggestions..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1
- Write-Host "Disabling Feedback..."
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 1
- Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null
- Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
- Write-Host "Disabling Tailored Experiences..."
- If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) {
- New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 1
- Write-Host "Disabling Advertising ID..."
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 1
- Write-Host "Disabling Error reporting..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1
- Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null
- Write-Host "Restricting Windows Update P2P only to local network..."
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
- Write-Host "Stopping and disabling Diagnostics Tracking Service..."
- Stop-Service "DiagTrack" -WarningAction SilentlyContinue
- Set-Service "DiagTrack" -StartupType Disabled
- Write-Host "Stopping and disabling WAP Push Service..."
- Stop-Service "dmwappushservice" -WarningAction SilentlyContinue
- Set-Service "dmwappushservice" -StartupType Disabled
- Write-Host "Enabling F8 boot menu options..."
- bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null
- Write-Host "Disabling Remote Assistance..."
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0
- Write-Host "Stopping and disabling Superfetch service..."
- Stop-Service "SysMain" -WarningAction SilentlyContinue
- Set-Service "SysMain" -StartupType Disabled
-
- # Task Manager Details
- If ((get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuild).CurrentBuild -lt 22557) {
- Write-Host "Showing task manager details..."
- $taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru
- Do {
- Start-Sleep -Milliseconds 100
- $preferences = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction SilentlyContinue
- } Until ($preferences)
- Stop-Process $taskmgr
- $preferences.Preferences[28] = 0
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences
- }
- else { Write-Host "Task Manager patch not run in builds 22557+ due to bug" }
-
- Write-Host "Showing file operations details..."
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 1
- Write-Host "Hiding Task View button..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0
- Write-Host "Hiding People icon..."
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 0
-
- Write-Host "Changing default Explorer view to This PC..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
+ <#
- ## Enable Long Paths
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Type DWORD -Value 1
+ .DESCRIPTION
+ Simple function to make it easier to invoke a runspace from inside the script.
- Write-Host "Hiding 3D Objects icon from This PC..."
- Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse -ErrorAction SilentlyContinue
+ .EXAMPLE
+
+ $params = @{
+ ScriptBlock = $sync.ScriptsInstallPrograms
+ ArgumentList = "Installadvancedip,Installbitwarden"
+ Verbose = $true
+ }
+
+ Invoke-WPFRunspace @params
+
+ #>
+
+ [CmdletBinding()]
+ Param (
+ $ScriptBlock,
+ $ArgumentList
+ )
+
+ #Configure max thread count for RunspacePool.
+ $maxthreads = [int]$env:NUMBER_OF_PROCESSORS
+
+ #Create a new session state for parsing variables ie hashtable into our runspace.
+ $hashVars = New-object System.Management.Automation.Runspaces.SessionStateVariableEntry -ArgumentList 'sync',$sync,$Null
+ $InitialSessionState = [System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault()
+
+ #Add the variable to the RunspacePool sessionstate
+ $InitialSessionState.Variables.Add($hashVars)
+
+ #Add functions
+ $functions = Get-ChildItem function:\ | Where-Object {$_.name -like "*winutil*" -or $_.name -like "*WPF*"}
+ foreach ($function in $functions){
+ $functionDefinition = Get-Content function:\$($function.name)
+ $functionEntry = New-Object System.Management.Automation.Runspaces.SessionStateFunctionEntry -ArgumentList $($function.name), $functionDefinition
- ## Performance Tweaks and More Telemetry
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching" -Name "SearchOrderConfig" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "SystemResponsiveness" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "AutoEndTasks" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "ClearPageFileAtShutdown" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseHoverTime" -Type DWord -Value 400
+ # And add it to the iss object
+ $initialSessionState.Commands.Add($functionEntry)
+ }
+
+ #Create our runspace pool. We are entering three parameters here min thread count, max thread count and host machine of where these runspaces should be made.
+ $script:runspace = [runspacefactory]::CreateRunspacePool(1,$maxthreads,$InitialSessionState, $Host)
+
+
+ #Crate a PowerShell instance.
+ $script:powershell = [powershell]::Create()
+
+ #Open a RunspacePool instance.
+ $script:runspace.Open()
+
+ #Add Scriptblock and Arguments to runspace
+ $script:powershell.AddScript($ScriptBlock)
+ $script:powershell.AddArgument($ArgumentList)
+ $script:powershell.RunspacePool = $script:runspace
+
+ #Run our RunspacePool.
+ $script:handle = $script:powershell.BeginInvoke()
+
+ #Cleanup our RunspacePool threads when they are complete ie. GC.
+ if ($script:handle.IsCompleted)
+ {
+ $script:powershell.EndInvoke($script:handle)
+ $script:powershell.Dispose()
+ $script:runspace.Dispose()
+ $script:runspace.Close()
+ [System.GC]::Collect()
+ }
+}
+function Invoke-WPFTab {
+
+ <#
+
+ .DESCRIPTION
+ Sole purpose of this fuction reduce duplicated code for switching between tabs.
+
+ #>
+
+ Param ($ClickedTab)
+ $Tabs = Get-Variable WPFTab?BT
+ $TabNav = Get-Variable WPFTabNav
+ $x = [int]($ClickedTab -replace "WPFTab","" -replace "BT","") - 1
+
+ 0..($Tabs.Count -1 ) | ForEach-Object {
+
+ if ($x -eq $psitem){
+ $TabNav.value.Items[$psitem].IsSelected = $true
+ }
+ else{
+ $TabNav.value.Items[$psitem].IsSelected = $false
+ }
+ }
+}
+function Invoke-WPFtweaksbutton {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+
+ if($sync.ProcessRunning){
+ $msg = "Install process is currently running."
+ [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+}
+
+ $Tweaks = Get-WinUtilCheckBoxes -Group "WPFTweaks"
+
+ Set-WinUtilDNS -DNSProvider $WPFchangedns.text
+
+ Invoke-WPFRunspace -ArgumentList $Tweaks -ScriptBlock {
+ param($Tweaks)
+
+ $sync.ProcessRunning = $true
+
+ Foreach ($tweak in $tweaks){
+ Invoke-WinUtilTweaks $tweak
+ }
+
+ $sync.ProcessRunning = $false
+ Write-Host "================================="
+ Write-Host "-- Tweaks are Finished ---"
+ Write-Host "================================="
+
+ $ButtonType = [System.Windows.MessageBoxButton]::OK
+ $MessageboxTitle = "Tweaks are Finished "
+ $Messageboxbody = ("Done")
+ $MessageIcon = [System.Windows.MessageBoxImage]::Information
+
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+ }
+}
+Function Invoke-WPFUltimatePerformance {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
+ param($State)
+ Try{
+ $guid = "e9a42b02-d5df-448d-aa00-03f14749eb61"
+
+ if($state -eq "Enabled"){
+ Write-Host "Adding Ultimate Performance Profile"
+ [scriptblock]$command = {powercfg -duplicatescheme $guid}
- ## Timeout Tweaks cause flickering on Windows now
- Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "WaitToKillAppTimeout" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "WaitToKillServiceTimeout" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "LowLevelHooksTimeout" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "WaitToKillServiceTimeout" -ErrorAction SilentlyContinue
-
- # Network Tweaks
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "IRPStackSize" -Type DWord -Value 20
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Type DWord -Value 4294967295
-
- # Gaming Tweaks
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "GPU Priority" -Type DWord -Value 8
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "Priority" -Type DWord -Value 6
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Games" -Name "Scheduling Category" -Type String -Value "High"
+ }
+ if($state -eq "Disabled"){
+ Write-Host "Removing Ultimate Performance Profile"
+ [scriptblock]$command = {powercfg -delete $guid}
+ }
- # Group svchost.exe processes
- $ram = (Get-CimInstance -ClassName "Win32_PhysicalMemory" | Measure-Object -Property Capacity -Sum).Sum / 1kb
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "SvcHostSplitThresholdInKB" -Type DWord -Value $ram -Force
+ $output = Invoke-Command -ScriptBlock $command
+ if($output -like "*does not exist*"){
+ throw [GenericException]::new('Failed to modify profile')
+ }
+ }
+ Catch{
+ Write-Warning $psitem.Exception.Message
+ }
+}
+function Invoke-WPFundoall {
+ <#
+
+ .DESCRIPTION
+ PlaceHolder
+
+ #>
- Write-Host "Disable News and Interests"
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name "EnableFeeds" -Type DWord -Value 0
- # Remove "News and Interest" from taskbar
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 2
-
- # remove "Meet Now" button from taskbar
-
- If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {
- New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Force | Out-Null
- }
-
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "HideSCAMeetNow" -Type DWord -Value 1
-
- Write-Host "Removing AutoLogger file and restricting directory..."
- $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
- If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") {
- Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl"
- }
- icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null
-
- Write-Host "Stopping and disabling Diagnostics Tracking Service..."
- Stop-Service "DiagTrack"
- Set-Service "DiagTrack" -StartupType Disabled
-
- Write-Host "Doing Security checks for Administrator Account and Group Policy"
- if (([System.Security.Principal.WindowsIdentity]::GetCurrent().Name).IndexOf('Administrator') -eq -1) {
- net user administrator /active:no
- }
+ if($sync.ProcessRunning){
+ $msg = "Install process is currently running."
+ [System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
+ return
+ }
+
+ $Tweaks = Get-WinUtilCheckBoxes -Group "WPFTweaks"
- $WPFEssTweaksTele.IsChecked = $false
+ Invoke-WPFRunspace -ArgumentList $Tweaks -ScriptBlock {
+ param($Tweaks)
+
+ $sync.ProcessRunning = $true
+
+ Foreach ($tweak in $tweaks){
+ Invoke-WinUtilTweaks $tweak -undo $true
}
- If ( $WPFEssTweaksWifi.IsChecked -eq $true ) {
- Write-Host "Disabling Wi-Fi Sense..."
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
- $WPFEssTweaksWifi.IsChecked = $false
- }
- If ( $WPFMiscTweaksLapPower.IsChecked -eq $true ) {
- If (Test-Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling") {
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling" -Name "PowerThrottlingOff" -Type DWord -Value 00000000
- }
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name "HiberbootEnabled" -Type DWord -Value 0000001
- $WPFMiscTweaksLapPower.IsChecked = $false
- }
- If ( $WPFMiscTweaksLapNum.IsChecked -eq $true ) {
- Write-Host "Disabling NumLock after startup..."
- If (!(Test-Path "HKU:")) {
- New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
- }
- Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0
- $WPFMiscTweaksLapNum.IsChecked = $false
- }
- If ( $WPFMiscTweaksPower.IsChecked -eq $true ) {
- If (Test-Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling") {
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling" -Name "PowerThrottlingOff" -Type DWord -Value 00000001
- }
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name "HiberbootEnabled" -Type DWord -Value 0000000
- $WPFMiscTweaksPower.IsChecked = $false
- }
- If ( $WPFMiscTweaksNum.IsChecked -eq $true ) {
- Write-Host "Enabling NumLock after startup..."
- If (!(Test-Path "HKU:")) {
- New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
- }
- Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2
- $WPFMiscTweaksNum.IsChecked = $false
- }
- If ( $WPFMiscTweaksExt.IsChecked -eq $true ) {
- Write-Host "Showing known file extensions..."
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0
- $WPFMiscTweaksExt.IsChecked = $false
- }
- If ( $WPFMiscTweaksUTC.IsChecked -eq $true ) {
- Write-Host "Setting BIOS time to UTC..."
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 1
- $WPFMiscTweaksUTC.IsChecked = $false
- }
- If ( $WPFMiscTweaksDisplay.IsChecked -eq $true ) {
- Write-Host "Adjusting visual effects for performance..."
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 0
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 200
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](144, 18, 3, 128, 16, 0, 0, 0))
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 0
- Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 0
- Write-Host "Adjusted visual effects for performance"
- $WPFMiscTweaksDisplay.IsChecked = $false
- }
- If ( $WPFMiscTweaksDisableMouseAcceleration.IsChecked -eq $true ) {
- Write-Host "Disabling mouse acceleration..."
- Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSpeed" -Type String -Value 0
- Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseThreshold1" -Type String -Value 0
- Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseThreshold2" -Type String -Value 0
- $WPFMiscTweaksDisableMouseAcceleration.IsChecked = $false
- }
- If ( $WPFMiscTweaksEnableMouseAcceleration.IsChecked -eq $true ) {
- Write-Host "Enabling mouse acceleration..."
- Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseSpeed" -Type String -Value 1
- Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseThreshold1" -Type String -Value 6
- Set-ItemProperty -Path "HKCU:\Control Panel\Mouse" -Name "MouseThreshold2" -Type String -Value 10
- $WPFMiscTweaksEnableMouseAcceleration.IsChecked = $false
- }
- If ( $WPFEssTweaksRemoveCortana.IsChecked -eq $true ) {
- Write-Host "Removing Cortana..."
- Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage
- $WPFEssTweaksRemoveCortana.IsChecked = $false
- }
- If ( $WPFEssTweaksRemoveEdge.IsChecked -eq $true ) {
- Write-Host "Removing Microsoft Edge..."
- Invoke-WebRequest -useb https://raw.githubusercontent.com/ChrisTitusTech/winutil/$BranchToUse/Edge_Removal.bat | Invoke-Expression
- $WPFEssTweaksRemoveEdge.IsChecked = $false
- }
- If ( $WPFEssTweaksDeBloat.IsChecked -eq $true ) {
- $Bloatware = @(
- #Unnecessary Windows 10 AppX Apps
- "3DBuilder"
- "Microsoft3DViewer"
- "AppConnector"
- "BingFinance"
- "BingNews"
- "BingSports"
- "BingTranslator"
- "BingWeather"
- "BingFoodAndDrink"
- "BingHealthAndFitness"
- "BingTravel"
- "MinecraftUWP"
- "GamingServices"
- # "WindowsReadingList"
- "GetHelp"
- "Getstarted"
- "Messaging"
- "Microsoft3DViewer"
- "MicrosoftSolitaireCollection"
- "NetworkSpeedTest"
- "News"
- "Lens"
- "Sway"
- "OneNote"
- "OneConnect"
- "People"
- "Print3D"
- "SkypeApp"
- "Todos"
- "Wallet"
- "Whiteboard"
- "WindowsAlarms"
- "windowscommunicationsapps"
- "WindowsFeedbackHub"
- "WindowsMaps"
- "WindowsPhone"
- "WindowsSoundRecorder"
- "XboxApp"
- "ConnectivityStore"
- "CommsPhone"
- "ScreenSketch"
- "TCUI"
- "XboxGameOverlay"
- "XboxGameCallableUI"
- "XboxSpeechToTextOverlay"
- "MixedReality.Portal"
- "ZuneMusic"
- "ZuneVideo"
- #"YourPhone"
- "Getstarted"
- "MicrosoftOfficeHub"
-
- #Sponsored Windows 10 AppX Apps
- #Add sponsored/featured apps to remove in the "*AppName*" format
- "EclipseManager"
- "ActiproSoftwareLLC"
- "AdobeSystemsIncorporated.AdobePhotoshopExpress"
- "Duolingo-LearnLanguagesforFree"
- "PandoraMediaInc"
- "CandyCrush"
- "BubbleWitch3Saga"
- "Wunderlist"
- "Flipboard"
- "Twitter"
- "Facebook"
- "Royal Revolt"
- "Sway"
- "Speed Test"
- "Dolby"
- "Viber"
- "ACGMediaPlayer"
- "Netflix"
- "OneCalendar"
- "LinkedInforWindows"
- "HiddenCityMysteryofShadows"
- "Hulu"
- "HiddenCity"
- "AdobePhotoshopExpress"
- "HotspotShieldFreeVPN"
-
- #Optional: Typically not removed but you can if you need to
- "Advertising"
- #"MSPaint"
- #"MicrosoftStickyNotes"
- #"Windows.Photos"
- #"WindowsCalculator"
- #"WindowsStore"
-
- # HPBloatware Packages
- "HPJumpStarts"
- "HPPCHardwareDiagnosticsWindows"
- "HPPowerManager"
- "HPPrivacySettings"
- "HPSupportAssistant"
- "HPSureShieldAI"
- "HPSystemInformation"
- "HPQuickDrop"
- "HPWorkWell"
- "myHP"
- "HPDesktopSupportUtilities"
- "HPQuickTouch"
- "HPEasyClean"
- "HPSystemInformation"
- )
-
- ## Teams Removal - Source: https://github.com/asheroto/UninstallTeams
- function getUninstallString($match) {
- return (Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like "*$match*" }).UninstallString
- }
-
- $TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, 'Microsoft', 'Teams')
- $TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, 'Update.exe')
-
- Write-Output "Stopping Teams process..."
- Stop-Process -Name "*teams*" -Force -ErrorAction SilentlyContinue
-
- Write-Output "Uninstalling Teams from AppData\Microsoft\Teams"
- if ([System.IO.File]::Exists($TeamsUpdateExePath)) {
- # Uninstall app
- $proc = Start-Process $TeamsUpdateExePath "-uninstall -s" -PassThru
- $proc.WaitForExit()
- }
-
- Write-Output "Removing Teams AppxPackage..."
- Get-AppxPackage "*Teams*" | Remove-AppxPackage -ErrorAction SilentlyContinue
- Get-AppxPackage "*Teams*" -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
-
- Write-Output "Deleting Teams directory"
- if ([System.IO.Directory]::Exists($TeamsPath)) {
- Remove-Item $TeamsPath -Force -Recurse -ErrorAction SilentlyContinue
- }
-
- Write-Output "Deleting Teams uninstall registry key"
- # Uninstall from Uninstall registry key UninstallString
- $us = getUninstallString("Teams");
- if ($us.Length -gt 0) {
- $us = ($us.Replace("/I", "/uninstall ") + " /quiet").Replace(" ", " ")
- $FilePath = ($us.Substring(0, $us.IndexOf(".exe") + 4).Trim())
- $ProcessArgs = ($us.Substring($us.IndexOf(".exe") + 5).Trim().replace(" ", " "))
- $proc = Start-Process -FilePath $FilePath -Args $ProcessArgs -PassThru
- $proc.WaitForExit()
- }
-
- Write-Output "Restart computer to complete teams uninstall"
-
- Write-Host "Removing Bloatware"
-
- foreach ($Bloat in $Bloatware) {
- Get-AppxPackage "*$Bloat*" | Remove-AppxPackage -ErrorAction SilentlyContinue
- Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*$Bloat*" | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
- Write-Host "Trying to remove $Bloat."
- }
-
- Write-Host "Finished Removing Bloatware Apps"
- Write-Host "Removing Bloatware Programs"
- # Remove installed programs
- $InstalledPrograms = Get-Package | Where-Object { $UninstallPrograms -contains $_.Name }
- $InstalledPrograms | ForEach-Object {
-
- Write-Host -Object "Attempting to uninstall: [$($_.Name)]..."
-
- Try {
- $Null = $_ | Uninstall-Package -AllVersions -Force -ErrorAction SilentlyContinue
- Write-Host -Object "Successfully uninstalled: [$($_.Name)]"
- }
- Catch {
- Write-Warning -Message "Failed to uninstall: [$($_.Name)]"
- }
- }
- Write-Host "Finished Removing Bloatware Programs"
- $WPFEssTweaksDeBloat.IsChecked = $false
- }
-
- Write-Host "================================="
- Write-Host "-- Tweaks are Finished ---"
- Write-Host "================================="
-
+
+ $sync.ProcessRunning = $false
+ Write-Host "=================================="
+ Write-Host "--- Undo Tweaks are Finished ---"
+ Write-Host "=================================="
+
$ButtonType = [System.Windows.MessageBoxButton]::OK
$MessageboxTitle = "Tweaks are Finished "
$Messageboxbody = ("Done")
$MessageIcon = [System.Windows.MessageBoxImage]::Information
-
- [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
- })
-$WPFAddUltPerf.Add_Click({
- Write-Host "Adding Ultimate Performance Profile"
- powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61
- Write-Host "Profile added"
- }
-)
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+ }
-$WPFRemoveUltPerf.Add_Click({
- Write-Host "Removing Ultimate Performance Profile"
- powercfg -delete e9a42b02-d5df-448d-aa00-03f14749eb61
- Write-Host "Profile Removed"
- }
-)
+<#
-function Get-AppsUseLightTheme{
- return (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
+ Write-Host "Creating Restore Point in case something bad happens"
+ Enable-ComputerRestore -Drive "$env:SystemDrive"
+ Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS"
+
+ Write-Host "Enabling Telemetry..."
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1
+ Write-Host "Enabling Wi-Fi Sense"
+ Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
+ Write-Host "Enabling Application suggestions..."
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1
+ If (Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent") {
+ Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 0
+ Write-Host "Enabling Activity History..."
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 1
+ Write-Host "Enable Location Tracking..."
+ If (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location") {
+ Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Allow"
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
+ Write-Host "Enabling automatic Maps updates..."
+ Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 1
+ Write-Host "Enabling Feedback..."
+ If (Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules") {
+ Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 0
+ Write-Host "Enabling Tailored Experiences..."
+ If (Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent") {
+ Remove-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 0
+ Write-Host "Disabling Advertising ID..."
+ If (Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo") {
+ Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 0
+ Write-Host "Allow Error reporting..."
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 0
+ Write-Host "Allowing Diagnostics Tracking Service..."
+ Stop-Service "DiagTrack" -WarningAction SilentlyContinue
+ Set-Service "DiagTrack" -StartupType Manual
+ Write-Host "Allowing WAP Push Service..."
+ Stop-Service "dmwappushservice" -WarningAction SilentlyContinue
+ Set-Service "dmwappushservice" -StartupType Manual
+ Write-Host "Allowing Home Groups services..."
+ Stop-Service "HomeGroupListener" -WarningAction SilentlyContinue
+ Set-Service "HomeGroupListener" -StartupType Manual
+ Stop-Service "HomeGroupProvider" -WarningAction SilentlyContinue
+ Set-Service "HomeGroupProvider" -StartupType Manual
+ Write-Host "Enabling Storage Sense..."
+ New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" | Out-Null
+ Write-Host "Allowing Superfetch service..."
+ Stop-Service "SysMain" -WarningAction SilentlyContinue
+ Set-Service "SysMain" -StartupType Manual
+ Write-Host "Setting BIOS time to Local Time instead of UTC..."
+ Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 0
+ Write-Host "Enabling Hibernation..."
+ Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 1
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -ErrorAction SilentlyContinue
+
+ Write-Host "Hiding file operations details..."
+ If (Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager") {
+ Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Recurse -ErrorAction SilentlyContinue
+ }
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 0
+ Write-Host "Showing Task View button..."
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 1
+
+ Write-Host "Changing default Explorer view to Quick Access..."
+ Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 0
+
+ Write-Host "Unrestricting AutoLogger directory"
+ $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
+ icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null
+
+ Write-Host "Enabling and starting Diagnostics Tracking Service"
+ Set-Service "DiagTrack" -StartupType Automatic
+ Start-Service "DiagTrack"
+
+ Write-Host "Hiding known file extensions"
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1
+
+ Write-Host "Reset Local Group Policies to Stock Defaults"
+ # cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose
+ cmd /c RD /S /Q "%WinDir%\System32\GroupPolicyUsers"
+ cmd /c RD /S /Q "%WinDir%\System32\GroupPolicy"
+ cmd /c gpupdate /force
+ # Considered using Invoke-GPUpdate but requires module most people won't have installed
+
+ Write-Host "Adjusting visual effects for appearance..."
+ Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 1
+ Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 400
+ Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](158, 30, 7, 128, 18, 0, 0, 0))
+ Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 1
+ Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 1
+ Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -ErrorAction SilentlyContinue
+ Write-Host "Restoring Clipboard History..."
+ Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory" -ErrorAction SilentlyContinue
+ Write-Host "Enabling Notifications and Action Center"
+ Remove-Item -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
+ Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled"
+ Write-Host "Restoring Default Right Click Menu Layout"
+ Remove-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Recurse -Confirm:$false -Force
+
+ Write-Host "Reset News and Interests"
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name "EnableFeeds" -Type DWord -Value 1
+ # Remove "News and Interest" from taskbar
+ Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 0
+ Write-Host "Done - Reverted to Stock Settings"
+
+ Write-Host "Essential Undo Completed"
+
+ $ButtonType = [System.Windows.MessageBoxButton]::OK
+ $MessageboxTitle = "Undo All"
+ $Messageboxbody = ("Done")
+ $MessageIcon = [System.Windows.MessageBoxImage]::Information
+
+ [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
+
+ Write-Host "================================="
+ Write-Host "--- Undo All is Finished ---"
+ Write-Host "================================="
+ #>
}
+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
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 0
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 3
+ If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
+ New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
+ }
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
-function Get-SystemUsesLightTheme{
- return (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
+ $services = @(
+ "BITS"
+ "wuauserv"
+ )
+
+ foreach ($service in $services) {
+ # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
+
+ Write-Host "Setting $service StartupType to Automatic"
+ Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic
+ }
+ Write-Host "Enabling driver offering through Windows Update..."
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
+ Write-Host "Enabling Windows Update automatic restart..."
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
+ Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
+ Write-Host "Enabled driver offering through Windows Update"
+ 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 "================================="
}
-
-$WPFToggleDarkMode.IsChecked = $(If ($(Get-AppsUseLightTheme) -eq 0 -And $(Get-SystemUsesLightTheme) -eq 0) {$true} Else {$false})
-
-$WPFToggleDarkMode.Add_Click({
- $EnableDarkMode = $WPFToggleDarkMode.IsChecked
- $DarkMoveValue = $(If ( $EnableDarkMode ) {0} Else {1})
- Write-Host $(If ( $EnableDarkMode ) {"Enabling Dark Mode"} Else {"Disabling Dark Mode"})
- $Theme = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
- If ($DarkMoveValue -ne $(Get-AppsUseLightTheme))
- {
- Set-ItemProperty $Theme AppsUseLightTheme -Value $DarkMoveValue
+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
}
- If ($DarkMoveValue -ne $(Get-SystemUsesLightTheme))
- {
- Set-ItemProperty $Theme SystemUsesLightTheme -Value $DarkMoveValue
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
+ If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
+ New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
}
- Write-Host $(If ( $EnableDarkMode ) {"Enabled"} Else {"Disabled"})
+ Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
+ $services = @(
+ "BITS"
+ "wuauserv"
+ )
+
+ foreach ($service in $services) {
+ # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
+
+ Write-Host "Setting $service StartupType to Disabled"
+ Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
}
-)
-
-#===========================================================================
-# Undo All
-#===========================================================================
-$WPFundoall.Add_Click({
- Write-Host "Creating Restore Point in case something bad happens"
- Enable-ComputerRestore -Drive "$env:SystemDrive"
- Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS"
-
- Write-Host "Enabling Telemetry..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 1
- Write-Host "Enabling Wi-Fi Sense"
- Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
- Write-Host "Enabling Application suggestions..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1
- If (Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent") {
- Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 0
- Write-Host "Enabling Activity History..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "PublishUserActivities" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "UploadUserActivities" -Type DWord -Value 1
- Write-Host "Enable Location Tracking..."
- If (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location") {
- Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Recurse -ErrorAction SilentlyContinue
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Name "Value" -Type String -Value "Allow"
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
- Write-Host "Enabling automatic Maps updates..."
- Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 1
- Write-Host "Enabling Feedback..."
- If (Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules") {
- Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Recurse -ErrorAction SilentlyContinue
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "DoNotShowFeedbackNotifications" -Type DWord -Value 0
- Write-Host "Enabling Tailored Experiences..."
- If (Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent") {
- Remove-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Recurse -ErrorAction SilentlyContinue
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableTailoredExperiencesWithDiagnosticData" -Type DWord -Value 0
- Write-Host "Disabling Advertising ID..."
- If (Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo") {
- Remove-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Recurse -ErrorAction SilentlyContinue
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" -Name "DisabledByGroupPolicy" -Type DWord -Value 0
- Write-Host "Allow Error reporting..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 0
- Write-Host "Allowing Diagnostics Tracking Service..."
- Stop-Service "DiagTrack" -WarningAction SilentlyContinue
- Set-Service "DiagTrack" -StartupType Manual
- Write-Host "Allowing WAP Push Service..."
- Stop-Service "dmwappushservice" -WarningAction SilentlyContinue
- Set-Service "dmwappushservice" -StartupType Manual
- Write-Host "Allowing Home Groups services..."
- Stop-Service "HomeGroupListener" -WarningAction SilentlyContinue
- Set-Service "HomeGroupListener" -StartupType Manual
- Stop-Service "HomeGroupProvider" -WarningAction SilentlyContinue
- Set-Service "HomeGroupProvider" -StartupType Manual
- Write-Host "Enabling Storage Sense..."
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy" | Out-Null
- Write-Host "Allowing Superfetch service..."
- Stop-Service "SysMain" -WarningAction SilentlyContinue
- Set-Service "SysMain" -StartupType Manual
- Write-Host "Setting BIOS time to Local Time instead of UTC..."
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" -Name "RealTimeIsUniversal" -Type DWord -Value 0
- Write-Host "Enabling Hibernation..."
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Session Manager\Power" -Name "HibernteEnabled" -Type Dword -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" -Name "ShowHibernateOption" -Type Dword -Value 1
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -ErrorAction SilentlyContinue
-
- Write-Host "Hiding file operations details..."
- If (Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager") {
- Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Recurse -ErrorAction SilentlyContinue
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 0
- Write-Host "Showing Task View button..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name "PeopleBand" -Type DWord -Value 1
-
- Write-Host "Changing default Explorer view to Quick Access..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
-
- Write-Host "Unrestricting AutoLogger directory"
- $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
- icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null
-
- Write-Host "Enabling and starting Diagnostics Tracking Service"
- Set-Service "DiagTrack" -StartupType Automatic
- Start-Service "DiagTrack"
-
- Write-Host "Hiding known file extensions"
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1
-
- Write-Host "Reset Local Group Policies to Stock Defaults"
- # cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose
- cmd /c RD /S /Q "%WinDir%\System32\GroupPolicyUsers"
- cmd /c RD /S /Q "%WinDir%\System32\GroupPolicy"
- cmd /c gpupdate /force
- # Considered using Invoke-GPUpdate but requires module most people won't have installed
-
- Write-Output "Adjusting visual effects for appearance..."
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "DragFullWindows" -Type String -Value 1
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "MenuShowDelay" -Type String -Value 400
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "UserPreferencesMask" -Type Binary -Value ([byte[]](158, 30, 7, 128, 18, 0, 0, 0))
- Set-ItemProperty -Path "HKCU:\Control Panel\Desktop\WindowMetrics" -Name "MinAnimate" -Type String -Value 1
- Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name "KeyboardDelay" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewAlphaSelect" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ListviewShadow" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAnimations" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Type DWord -Value 3
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\DWM" -Name "EnableAeroPeek" -Type DWord -Value 1
- Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -ErrorAction SilentlyContinue
- Write-Host "Restoring Clipboard History..."
- Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name "EnableClipboardHistory" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "AllowClipboardHistory" -ErrorAction SilentlyContinue
- Write-Host "Enabling Notifications and Action Center"
- Remove-Item -Path HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
- Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled"
- Write-Host "Restoring Default Right Click Menu Layout"
- Remove-Item -Path "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" -Recurse -Confirm:$false -Force
-
- Write-Host "Reset News and Interests"
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name "EnableFeeds" -Type DWord -Value 1
- # Remove "News and Interest" from taskbar
- Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds" -Name "ShellFeedsTaskbarViewMode" -Type DWord -Value 0
- Write-Host "Done - Reverted to Stock Settings"
-
- Write-Host "Essential Undo Completed"
-
- $ButtonType = [System.Windows.MessageBoxButton]::OK
- $MessageboxTitle = "Undo All"
- $Messageboxbody = ("Done")
- $MessageIcon = [System.Windows.MessageBoxImage]::Information
-
- [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
-
- Write-Host "================================="
- Write-Host "--- Undo All is Finished ---"
- Write-Host "================================="
- })
-#===========================================================================
-# Tab 3 - Config Buttons
-#===========================================================================
-$WPFFeatureInstall.Add_Click({
-
- If ( $WPFFeaturesdotnet.IsChecked -eq $true ) {
- Enable-WindowsOptionalFeature -Online -FeatureName "NetFx4-AdvSrvs" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -All -NoRestart
- }
- If ( $WPFFeatureshyperv.IsChecked -eq $true ) {
- Enable-WindowsOptionalFeature -Online -FeatureName "HypervisorPlatform" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-All" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Tools-All" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Management-PowerShell" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Hypervisor" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Services" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-Management-Clients" -All -NoRestart
- cmd /c bcdedit /set hypervisorschedulertype classic
- Write-Host "HyperV is now installed and configured. Please Reboot before using."
- }
- If ( $WPFFeatureslegacymedia.IsChecked -eq $true ) {
- Enable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "MediaPlayback" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "DirectPlay" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "LegacyComponents" -All -NoRestart
- }
- If ( $WPFFeaturewsl.IsChecked -eq $true ) {
- Enable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -All -NoRestart
- Write-Host "WSL is now installed and configured. Please Reboot before using."
- }
- If ( $WPFFeaturenfs.IsChecked -eq $true ) {
- Enable-WindowsOptionalFeature -Online -FeatureName "ServicesForNFS-ClientOnly" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "ClientForNFS-Infrastructure" -All -NoRestart
- Enable-WindowsOptionalFeature -Online -FeatureName "NFS-Administration" -All -NoRestart
- nfsadmin client stop
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default" -Name "AnonymousUID" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default" -Name "AnonymousGID" -Type DWord -Value 0
- nfsadmin client start
- nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i
- Write-Host "NFS is now setup for user based NFS mounts"
- }
- $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)
-
- Write-Host "================================="
- Write-Host "--- Features are Installed ---"
- Write-Host "================================="
- })
-
-$WPFPanelDISM.Add_Click({
- 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;
- Write-Host '`n(3/4) DISM' -ForegroundColor Green; DISM /Online /Cleanup-Image /Restorehealth;
- Write-Host '`n(4/4) SFC - 2nd scan' -ForegroundColor Green; sfc /scannow;
- Read-Host '`nPress Enter to Continue'" -verb runas
- })
-$WPFPanelAutologin.Add_Click({
- curl.exe -ss "https://live.sysinternals.com/Autologon.exe" -o autologin.exe # Official Microsoft recommendation https://learn.microsoft.com/en-us/sysinternals/downloads/autologon
- cmd /c autologin.exe
- })
-$WPFPanelcontrol.Add_Click({
- cmd /c control
- })
-$WPFPanelnetwork.Add_Click({
- cmd /c ncpa.cpl
- })
-$WPFPanelpower.Add_Click({
- cmd /c powercfg.cpl
- })
-$WPFPanelsound.Add_Click({
- cmd /c mmsys.cpl
- })
-$WPFPanelsystem.Add_Click({
- cmd /c sysdm.cpl
- })
-$WPFPaneluser.Add_Click({
- cmd /c "control userpasswords2"
- })
-#===========================================================================
-# Tab 4 - Updates Buttons
-#===========================================================================
-
-$WPFUpdatesdefault.Add_Click({
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 3
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
-
- $services = @(
- "BITS"
- "wuauserv"
- )
-
- foreach ($service in $services) {
- # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
-
- Write-Host "Setting $service StartupType to Automatic"
- Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic
- }
- Write-Host "Enabling driver offering through Windows Update..."
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontPromptForWindowsUpdate" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DontSearchWindowsUpdate" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" -Name "DriverUpdateWizardWuSearchEnabled" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "ExcludeWUDriversInQualityUpdate" -ErrorAction SilentlyContinue
- Write-Host "Enabling Windows Update automatic restart..."
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
- Write-Host "Enabled driver offering through Windows Update"
- 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 "================================="
- })
-
-$WPFFixesUpdate.Add_Click({
- ### Reset Windows Update Script - reregister dlls, services, and remove registry entires.
- Write-Host "1. Stopping Windows Update Services..."
- Stop-Service -Name BITS
- Stop-Service -Name wuauserv
- Stop-Service -Name appidsvc
- Stop-Service -Name cryptsvc
+ Write-Host "================================="
+ Write-Host "--- Updates ARE DISABLED ---"
+ Write-Host "================================="
+}
+function Invoke-WPFUpdatessecurity {
+ <#
- Write-Host "2. Remove QMGR Data file..."
- Remove-Item "$env:allusersprofile\Application Data\Microsoft\Network\Downloader\qmgr*.dat" -ErrorAction SilentlyContinue
+ .DESCRIPTION
+ PlaceHolder
- Write-Host "3. Renaming the Software Distribution and CatRoot Folder..."
- Rename-Item $env:systemroot\SoftwareDistribution SoftwareDistribution.bak -ErrorAction SilentlyContinue
- Rename-Item $env:systemroot\System32\Catroot2 catroot2.bak -ErrorAction SilentlyContinue
-
- Write-Host "4. Removing old Windows Update log..."
- Remove-Item $env:systemroot\WindowsUpdate.log -ErrorAction SilentlyContinue
-
- Write-Host "5. Resetting the Windows Update Services to defualt settings..."
- "sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
- "sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"
- Set-Location $env:systemroot\system32
-
- Write-Host "6. Registering some DLLs..."
- regsvr32.exe /s atl.dll
- regsvr32.exe /s urlmon.dll
- regsvr32.exe /s mshtml.dll
- regsvr32.exe /s shdocvw.dll
- regsvr32.exe /s browseui.dll
- regsvr32.exe /s jscript.dll
- regsvr32.exe /s vbscript.dll
- regsvr32.exe /s scrrun.dll
- regsvr32.exe /s msxml.dll
- regsvr32.exe /s msxml3.dll
- regsvr32.exe /s msxml6.dll
- regsvr32.exe /s actxprxy.dll
- regsvr32.exe /s softpub.dll
- regsvr32.exe /s wintrust.dll
- regsvr32.exe /s dssenh.dll
- regsvr32.exe /s rsaenh.dll
- regsvr32.exe /s gpkcsp.dll
- regsvr32.exe /s sccbase.dll
- regsvr32.exe /s slbcsp.dll
- regsvr32.exe /s cryptdlg.dll
- regsvr32.exe /s oleaut32.dll
- regsvr32.exe /s ole32.dll
- regsvr32.exe /s shell32.dll
- regsvr32.exe /s initpki.dll
- regsvr32.exe /s wuapi.dll
- regsvr32.exe /s wuaueng.dll
- regsvr32.exe /s wuaueng1.dll
- regsvr32.exe /s wucltui.dll
- regsvr32.exe /s wups.dll
- regsvr32.exe /s wups2.dll
- regsvr32.exe /s wuweb.dll
- regsvr32.exe /s qmgr.dll
- regsvr32.exe /s qmgrprxy.dll
- regsvr32.exe /s wucltux.dll
- regsvr32.exe /s muweb.dll
- regsvr32.exe /s wuwebv.dll
-
- Write-Host "7) Removing WSUS client settings..."
- REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f
- REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f
- REG DELETE "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f
-
- Write-Host "8) Resetting the WinSock..."
- netsh winsock reset
- netsh winhttp reset proxy
- netsh int ip reset
-
- Write-Host "9) Delete all BITS jobs..."
- Get-BitsTransfer | Remove-BitsTransfer
-
- Write-Host "10) Attempting to install the Windows Update Agent..."
- If ([System.Environment]::Is64BitOperatingSystem) {
- wusa Windows8-RT-KB2937636-x64 /quiet
- }
- else {
- wusa Windows8-RT-KB2937636-x86 /quiet
- }
-
- Write-Host "11) Starting Windows Update Services..."
- Start-Service -Name BITS
- Start-Service -Name wuauserv
- Start-Service -Name appidsvc
- Start-Service -Name cryptsvc
-
- Write-Host "12) Forcing discovery..."
- wuauclt /resetauthorization /detectnow
-
- Write-Host "Process complete. Please reboot your computer."
-
- $ButtonType = [System.Windows.MessageBoxButton]::OK
- $MessageboxTitle = "Reset Windows Update "
- $Messageboxbody = ("Stock settings loaded.`n Please reboot your computer")
- $MessageIcon = [System.Windows.MessageBoxImage]::Information
-
- [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
- Write-Host "================================="
- Write-Host "-- Reset ALL Updates to Factory -"
- Write-Host "================================="
- })
-
-$WPFUpdatesdisable.Add_Click({
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Type DWord -Value 1
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -Type DWord -Value 1
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
-
- $services = @(
- "BITS"
- "wuauserv"
- )
-
- foreach ($service in $services) {
- # -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
-
- Write-Host "Setting $service StartupType to Disabled"
- Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
- }
- Write-Host "================================="
- Write-Host "--- Updates ARE DISABLED ---"
- Write-Host "================================="
- })
-$WPFUpdatessecurity.Add_Click({
- Write-Host "Disabling driver offering through Windows Update..."
+ #>
+ Write-Host "Disabling driver offering through Windows Update..."
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" -Force | Out-Null
}
@@ -1490,7 +1497,7 @@ $WPFUpdatessecurity.Add_Click({
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "BranchReadinessLevel" -Type DWord -Value 20
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferFeatureUpdatesPeriodInDays" -Type DWord -Value 365
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "DeferQualityUpdatesPeriodInDays " -Type DWord -Value 4
-
+
$ButtonType = [System.Windows.MessageBoxButton]::OK
$MessageboxTitle = "Set Security Updates"
$Messageboxbody = ("Recommended Update settings loaded")
@@ -1500,11 +1507,2413 @@ $WPFUpdatessecurity.Add_Click({
Write-Host "================================="
Write-Host "-- Updates Set to Recommended ---"
Write-Host "================================="
+}
+$inputXML = '
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
+ Recommended selections are for normal users and if you are unsure do NOT check anything else!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This is the default settings that come with Windows. No modifications are made and will remove any custom windows update settings.Note: If you still encounter update errors, reset all updates in the config tab. That will restore ALL Microsoft Update Services from their servers and reinstall them to default settings.
+
+
+
+ This is my recommended setting I use on all computers. It will delay feature updates by 2 years and will install security updates 4 days after release.Feature Updates: Adds features and often bugs to systems when they are released. You want to delay these as long as possible.Security Updates: Typically these are pressing security flaws that need to be patched quickly. You only want to delay these a couple of days just to see if they are safe and don''t break other systems. You don''t want to go without these for ANY extended periods of time.
+
+
+
+ This completely disables ALL Windows Updates and is NOT RECOMMENDED. However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. Note: Your system will be easier to hack and infect without security updates.
+
+
+
+
+
+
+
+
+
+
+'
+$sync.configs.applications = '{
+ "WPFInstalladobe": {
+ "winget": "Adobe.Acrobat.Reader.64-bit",
+ "choco": "adobereader"
+ },
+ "WPFInstalladvancedip": {
+ "winget": "Famatech.AdvancedIPScanner",
+ "choco": "advanced-ip-scanner"
+ },
+ "WPFInstallanydesk": {
+ "winget": "AnyDeskSoftwareGmbH.AnyDesk",
+ "choco": "anydesk"
+ },
+ "WPFInstallatom": {
+ "winget": "GitHub.Atom",
+ "choco": "atom"
+ },
+ "WPFInstallaudacity": {
+ "winget": "Audacity.Audacity",
+ "choco": "audacity"
+ },
+ "WPFInstallautohotkey": {
+ "winget": "Lexikos.AutoHotkey",
+ "choco": "autohotkey"
+ },
+ "WPFInstallbitwarden": {
+ "winget": "Bitwarden.Bitwarden",
+ "choco": "bitwarden"
+ },
+ "WPFInstallblender": {
+ "winget": "BlenderFoundation.Blender",
+ "choco": "blender"
+ },
+ "WPFInstallbrave": {
+ "winget": "Brave.Brave",
+ "choco": "brave"
+ },
+ "WPFInstallchrome": {
+ "winget": "Google.Chrome",
+ "choco": "googlechrome"
+ },
+ "WPFInstallchromium": {
+ "winget": "eloston.ungoogled-chromium",
+ "choco": "chromium"
+ },
+ "WPFInstallcpuz": {
+ "winget": "CPUID.CPU-Z",
+ "choco": "cpu-z"
+ },
+ "WPFInstalldeluge": {
+ "winget": "DelugeTeam.Deluge",
+ "choco": "deluge"
+ },
+ "WPFInstalldiscord": {
+ "winget": "Discord.Discord",
+ "choco": "discord"
+ },
+ "WPFInstalleartrumpet": {
+ "winget": "File-New-Project.EarTrumpet",
+ "choco": "eartrumpet"
+ },
+ "WPFInstallepicgames": {
+ "winget": "EpicGames.EpicGamesLauncher",
+ "choco": "epicgameslauncher"
+ },
+ "WPFInstallesearch": {
+ "winget": "voidtools.Everything",
+ "choco": "everything"
+ },
+ "WPFInstalletcher": {
+ "winget": "Balena.Etcher",
+ "choco": "etcher"
+ },
+ "WPFInstallfirefox": {
+ "winget": "Mozilla.Firefox",
+ "choco": "firefox"
+ },
+ "WPFInstallflameshot": {
+ "winget": "Flameshot.Flameshot",
+ "choco": "na"
+ },
+ "WPFInstallfoobar": {
+ "winget": "PeterPawlowski.foobar2000",
+ "choco": "foobar2000"
+ },
+ "WPFInstallgimp": {
+ "winget": "GIMP.GIMP",
+ "choco": "gimp"
+ },
+ "WPFInstallgithubdesktop": {
+ "winget": "Git.Git;GitHub.GitHubDesktop",
+ "choco": "git;github-desktop"
+ },
+ "WPFInstallgog": {
+ "winget": "GOG.Galaxy",
+ "choco": "goggalaxy"
+ },
+ "WPFInstallgpuz": {
+ "winget": "TechPowerUp.GPU-Z",
+ "choco": "gpu-z"
+ },
+ "WPFInstallgreenshot": {
+ "winget": "Greenshot.Greenshot",
+ "choco": "greenshot"
+ },
+ "WPFInstallhandbrake": {
+ "winget": "HandBrake.HandBrake",
+ "choco": "handbrake"
+ },
+ "WPFInstallhexchat": {
+ "winget": "HexChat.HexChat",
+ "choco": "hexchat"
+ },
+ "WPFInstallhwinfo": {
+ "winget": "REALiX.HWiNFO",
+ "choco": "hwinfo"
+ },
+ "WPFInstallimageglass": {
+ "winget": "DuongDieuPhap.ImageGlass",
+ "choco": "imageglass"
+ },
+ "WPFInstallinkscape": {
+ "winget": "Inkscape.Inkscape",
+ "choco": "inkscape"
+ },
+ "WPFInstalljava16": {
+ "winget": "AdoptOpenJDK.OpenJDK.16",
+ "choco": "temurin16jre"
+ },
+ "WPFInstalljava18": {
+ "winget": "EclipseAdoptium.Temurin.18.JRE",
+ "choco": "temurin18jre"
+ },
+ "WPFInstalljava8": {
+ "winget": "EclipseAdoptium.Temurin.8.JRE",
+ "choco": "temurin8jre"
+ },
+ "WPFInstalljava19": {
+ "winget": "EclipseAdoptium.Temurin.19.JRE",
+ "choco": "temurin19jre"
+ },
+ "WPFInstalljava17": {
+ "winget": "EclipseAdoptium.Temurin.17.JRE",
+ "choco": "temurin17jre"
+ },
+ "WPFInstalljava11": {
+ "winget": "EclipseAdoptium.Temurin.11.JRE",
+ "choco": "javaruntime"
+ },
+ "WPFInstalljetbrains": {
+ "winget": "JetBrains.Toolbox",
+ "choco": "jetbrainstoolbox"
+ },
+ "WPFInstallkeepass": {
+ "winget": "KeePassXCTeam.KeePassXC",
+ "choco": "keepassxc"
+ },
+ "WPFInstalllibrewolf": {
+ "winget": "LibreWolf.LibreWolf",
+ "choco": "librewolf"
+ },
+ "WPFInstallmalwarebytes": {
+ "winget": "Malwarebytes.Malwarebytes",
+ "choco": "malwarebytes"
+ },
+ "WPFInstallmatrix": {
+ "winget": "Element.Element",
+ "choco": "element-desktop"
+ },
+ "WPFInstallmpc": {
+ "winget": "clsid2.mpc-hc",
+ "choco": "mpc-hc"
+ },
+ "WPFInstallmremoteng": {
+ "winget": "mRemoteNG.mRemoteNG",
+ "choco": "mremoteng"
+ },
+ "WPFInstallnodejs": {
+ "winget": "OpenJS.NodeJS",
+ "choco": "nodejs"
+ },
+ "WPFInstallnodejslts": {
+ "winget": "OpenJS.NodeJS.LTS",
+ "choco": "nodejs-lts"
+ },
+ "WPFInstallnotepadplus": {
+ "winget": "Notepad++.Notepad++",
+ "choco": "notepadplusplus"
+ },
+ "WPFInstallnvclean": {
+ "winget": "TechPowerUp.NVCleanstall",
+ "choco": "na"
+ },
+ "WPFInstallobs": {
+ "winget": "OBSProject.OBSStudio",
+ "choco": "obs-studio"
+ },
+ "WPFInstallobsidian": {
+ "winget": "Obsidian.Obsidian",
+ "choco": "obsidian"
+ },
+ "WPFInstallpowertoys": {
+ "winget": "Microsoft.PowerToys",
+ "choco": "powertoys"
+ },
+ "WPFInstallputty": {
+ "winget": "PuTTY.PuTTY",
+ "choco": "putty"
+ },
+ "WPFInstallpython3": {
+ "winget": "Python.Python.3.11",
+ "choco": "python"
+ },
+ "WPFInstallrevo": {
+ "winget": "RevoUnInstaller.RevoUnInstaller",
+ "choco": "revo-uninstaller"
+ },
+ "WPFInstallrufus": {
+ "winget": "Rufus.Rufus",
+ "choco": "rufus"
+ },
+ "WPFInstallsevenzip": {
+ "winget": "7zip.7zip",
+ "choco": "7zip"
+ },
+ "WPFInstallsharex": {
+ "winget": "ShareX.ShareX",
+ "choco": "sharex"
+ },
+ "WPFInstallsignal": {
+ "winget": "OpenWhisperSystems.Signal",
+ "choco": "signal"
+ },
+ "WPFInstallskype": {
+ "winget": "Microsoft.Skype",
+ "choco": "skype"
+ },
+ "WPFInstallslack": {
+ "winget": "SlackTechnologies.Slack",
+ "choco": "slack"
+ },
+ "WPFInstallsteam": {
+ "winget": "Valve.Steam",
+ "choco": "steam-client"
+ },
+ "WPFInstallsublime": {
+ "winget": "SublimeHQ.SublimeText.4",
+ "choco": "sublimetext4"
+ },
+ "WPFInstallsumatra": {
+ "winget": "SumatraPDF.SumatraPDF",
+ "choco": "sumatrapdf"
+ },
+ "WPFInstallteams": {
+ "winget": "Microsoft.Teams",
+ "choco": "microsoft-teams"
+ },
+ "WPFInstallteamviewer": {
+ "winget": "TeamViewer.TeamViewer",
+ "choco": "teamviewer9"
+ },
+ "WPFInstallterminal": {
+ "winget": "Microsoft.WindowsTerminal",
+ "choco": "microsoft-windows-terminal"
+ },
+ "WPFInstalltreesize": {
+ "winget": "JAMSoftware.TreeSize.Free",
+ "choco": "treesizefree"
+ },
+ "WPFInstallttaskbar": {
+ "winget": "TranslucentTB.TranslucentTB",
+ "choco": "translucenttb"
+ },
+ "WPFInstallvisualstudio": {
+ "winget": "Microsoft.VisualStudio.2022.Community",
+ "choco": "visualstudio2022community"
+ },
+ "WPFInstallvivaldi": {
+ "winget": "VivaldiTechnologies.Vivaldi",
+ "choco": "vivaldi"
+ },
+ "WPFInstallvlc": {
+ "winget": "VideoLAN.VLC",
+ "choco": "vlc"
+ },
+ "WPFInstallvoicemeeter": {
+ "winget": "VB-Audio.Voicemeeter",
+ "choco": "voicemeeter"
+ },
+ "WPFInstallvscode": {
+ "winget": "Git.Git;Microsoft.VisualStudioCode",
+ "choco": "vscode"
+ },
+ "WPFInstallvscodium": {
+ "winget": "Git.Git;VSCodium.VSCodium",
+ "choco": "vscodium"
+ },
+ "WPFInstallwindirstat": {
+ "winget": "WinDirStat.WinDirStat",
+ "choco": "windirstat"
+ },
+ "WPFInstallscp": {
+ "winget": "WinSCP.WinSCP",
+ "choco": "winscp"
+ },
+ "WPFInstallwireshark": {
+ "winget": "WiresharkFoundation.Wireshark",
+ "choco": "wireshark"
+ },
+ "WPFInstallzoom": {
+ "winget": "Zoom.Zoom",
+ "choco": "zoom"
+ },
+ "WPFInstalllibreoffice": {
+ "winget": "TheDocumentFoundation.LibreOffice",
+ "choco": "libreoffice-fresh"
+ },
+ "WPFInstallshell": {
+ "winget": "Nilesoft.Shell",
+ "choco": "na"
+ },
+ "WPFInstallklite": {
+ "winget": "CodecGuide.K-LiteCodecPack.Standard",
+ "choco": "k-litecodecpack-standard"
+ },
+ "WPFInstallsandboxie": {
+ "winget": "Sandboxie.Plus",
+ "choco": "sandboxie"
+ },
+ "WPFInstallprocesslasso": {
+ "winget": "BitSum.ProcessLasso",
+ "choco": "plasso"
+ },
+ "WPFInstallwinmerge": {
+ "winget": "WinMerge.WinMerge",
+ "choco": "winmerge"
+ },
+ "WPFInstalldotnet3": {
+ "winget": "Microsoft.DotNet.DesktopRuntime.3_1",
+ "choco": "dotnetcore3-desktop-runtime"
+ },
+ "WPFInstalldotnet5": {
+ "winget": "Microsoft.DotNet.DesktopRuntime.5",
+ "choco": "dotnet-5.0-runtime"
+ },
+ "WPFInstalldotnet6": {
+ "winget": "Microsoft.DotNet.DesktopRuntime.6",
+ "choco": "dotnet-6.0-runtime"
+ },
+ "WPFInstallvc2015_64": {
+ "winget": "Microsoft.VC++2015-2022Redist-x64",
+ "choco": "na"
+ },
+ "WPFInstallvc2015_32": {
+ "winget": "Microsoft.VC++2015-2022Redist-x86",
+ "choco": "na"
+ },
+ "WPFInstallfoxpdf": {
+ "winget": "Foxit.PhantomPDF",
+ "choco": "na"
+ },
+ "WPFInstallonlyoffice": {
+ "winget": "ONLYOFFICE.DesktopEditors",
+ "choco": "onlyoffice"
+ },
+ "WPFInstallflux": {
+ "winget": "flux.flux",
+ "choco": "flux"
+ },
+ "WPFInstallitunes": {
+ "winget": "Apple.iTunes",
+ "choco": "itunes"
+ },
+ "WPFInstallcider": {
+ "winget": "CiderCollective.Cider",
+ "choco": "cider"
+ },
+ "WPFInstalljoplin": {
+ "winget": "Joplin.Joplin",
+ "choco": "joplin"
+ },
+ "WPFInstallopenoffice": {
+ "winget": "Apache.OpenOffice",
+ "choco": "openoffice"
+ },
+ "WPFInstallrustdesk": {
+ "winget": "RustDesk.RustDesk",
+ "choco": "rustdesk.portable"
+ },
+ "WPFInstalljami": {
+ "winget": "SFLinux.Jami",
+ "choco": "jami"
+ },
+ "WPFInstalljdownloader": {
+ "winget": "AppWork.JDownloader",
+ "choco": "jdownloader"
+ },
+ "WPFInstallsimplewall": {
+ "Winget": "Henry++.simplewall",
+ "choco": "simplewall"
+ },
+ "WPFInstallrustlang": {
+ "Winget": "Rustlang.Rust.MSVC",
+ "choco": "rust"
+ },
+ "WPFInstallgolang": {
+ "Winget": "GoLang.Go.1.19",
+ "choco": "golang"
+ },
+ "WPFInstallalacritty": {
+ "Winget": "Alacritty.Alacritty",
+ "choco": "alacritty"
+ },
+ "WPFInstallkdenlive": {
+ "Winget": "KDE.Kdenlive",
+ "choco": "kdenlive"
+ },
+ "WPFInstallglaryutilities": {
+ "Winget": "Glarysoft.GlaryUtilities",
+ "choco": "glaryutilities-free"
+ },
+ "WPFInstalltwinkletray": {
+ "Winget": "xanderfrangos.twinkletray",
+ "choco": "na"
+ },
+ "WPFInstallidm": {
+ "Winget": "Tonec.InternetDownloadManager",
+ "choco": "internet-download-manager"
+ },
+ "WPFInstallviber": {
+ "Winget": "Viber.Viber",
+ "choco": "viber"
+ },
+ "WPFInstallgit": {
+ "Winget": "Git.Git",
+ "choco": "git"
+ },
+ "WPFInstallwiztree": {
+ "Winget": "AntibodySoftware.WizTree",
+ "choco": "wiztree\\"
+ },
+ "WPFInstalltor": {
+ "Winget": "TorProject.TorBrowser",
+ "choco": "tor-browser"
+ },
+ "WPFInstallkrita": {
+ "winget": "KDE.Krita",
+ "choco": "krita"
+ },
+ "WPFInstallnglide": {
+ "winget": "ZeusSoftware.nGlide",
+ "choco": "na"
+ },
+ "WPFInstallkodi": {
+ "winget": "XBMCFoundation.Kodi",
+ "choco": "kodi"
+ },
+ "WPFInstalltelegram": {
+ "winget": "Telegram.TelegramDesktop",
+ "choco": "telegram"
+ },
+ "WPFInstallunity": {
+ "winget": "UnityTechnologies.UnityHub",
+ "choco": "unityhub"
+ },
+ "WPFInstallqbittorrent": {
+ "winget": "qBittorrent.qBittorrent",
+ "choco": "qbittorrent"
+ },
+ "WPFInstallorigin": {
+ "winget": "ElectronicArts.EADesktop",
+ "choco": "origin"
+ },
+ "WPFInstallopenshell": {
+ "winget": "Open-Shell.Open-Shell-Menu",
+ "choco": "open-shell"
+ },
+ "WPFInstallbluestacks": {
+ "winget": "BlueStack.BlueStacks",
+ "choco": "na"
+ },
+ "WPFInstallstrawberry": {
+ "winget": "StrawberryMusicPlayer.Strawberry",
+ "choco": "strawberrymusicplayer"
+ },
+ "WPFInstallsqlstudio": {
+ "winget": "Microsoft.SQLServerManagementStudio",
+ "choco": "sql-server-management-studio"
+ },
+ "WPFInstallwaterfox": {
+ "winget": "Waterfox.Waterfox",
+ "choco": "waterfox"
+ },
+ "WPFInstallpowershell": {
+ "winget": "Microsoft.PowerShell",
+ "choco": "powershell-core"
+ },
+ "WPFInstallprocessmonitor": {
+ "winget": "Microsoft.Sysinternals.ProcessMonitor",
+ "choco": "procexp"
+ },
+ "WPFInstallonedrive": {
+ "winget": "Microsoft.OneDrive",
+ "choco": "onedrive"
+ },
+ "WPFInstalledge": {
+ "winget": "Microsoft.Edge",
+ "choco": "microsoft-edge"
+ },
+ "WPFInstallnuget": {
+ "winget": "Microsoft.NuGet",
+ "choco": "nuget.commandline"
+ }
+}' | convertfrom-json
+$sync.configs.dns = '{
+ "Google":{
+ "Primary": "8.8.8.8",
+ "Secondary": "8.8.4.4"
+ },
+ "Cloudflare":{
+ "Primary": "1.1.1.1",
+ "Secondary": "1.0.0.1"
+ },
+ "Cloudflare_Malware":{
+ "Primary": "1.1.1.2",
+ "Secondary": "1.0.0.2"
+ },
+ "Cloudflare_Malware_Adult":{
+ "Primary": "1.1.1.3",
+ "Secondary": "1.0.0.3"
+ },
+ "Level3":{
+ "Primary": "4.2.2.2",
+ "Secondary": "4.2.2.1"
+ },
+ "Open_DNS":{
+ "Primary": "208.67.222.222",
+ "Secondary": "208.67.220.220"
+ },
+ "Quad9":{
+ "Primary": "9.9.9.9",
+ "Secondary": "149.112.112.112"
+ }
+}' | convertfrom-json
+$sync.configs.feature = '{
+ "Featuresdotnet": [
+ "NetFx4-AdvSrvs",
+ "NetFx3"
+ ],
+ "Featureshyperv": [
+ "HypervisorPlatform",
+ "Microsoft-Hyper-V-All",
+ "Microsoft-Hyper-V",
+ "Microsoft-Hyper-V-Tools-All",
+ "Microsoft-Hyper-V-Management-PowerShell",
+ "Microsoft-Hyper-V-Hypervisor",
+ "Microsoft-Hyper-V-Services",
+ "Microsoft-Hyper-V-Management-Clients"
+ ],
+ "Featureslegacymedia": [
+ "WindowsMediaPlayer",
+ "MediaPlayback",
+ "DirectPlay",
+ "LegacyComponents"
+ ],
+ "Featurewsl": [
+ "VirtualMachinePlatform",
+ "Microsoft-Windows-Subsystem-Linux"
+ ],
+ "Featurenfs": [
+ "ServicesForNFS-ClientOnly",
+ "ClientForNFS-Infrastructure",
+ "NFS-Administration"
+ ]
+}' | convertfrom-json
+$sync.configs.preset = '{
+ "desktop": [
+ "WPFEssTweaksAH",
+ "WPFEssTweaksDVR",
+ "WPFEssTweaksHiber",
+ "WPFEssTweaksHome",
+ "WPFEssTweaksLoc",
+ "WPFEssTweaksOO",
+ "WPFEssTweaksRP",
+ "WPFEssTweaksServices",
+ "WPFEssTweaksStorage",
+ "WPFEssTweaksTele",
+ "WPFEssTweaksWifi",
+ "WPFMiscTweaksPower",
+ "WPFMiscTweaksNum"
+ ],
+ "laptop": [
+ "WPFEssTweaksAH",
+ "WPFEssTweaksDVR",
+ "WPFEssTweaksHome",
+ "WPFEssTweaksLoc",
+ "WPFEssTweaksOO",
+ "WPFEssTweaksRP",
+ "WPFEssTweaksServices",
+ "WPFEssTweaksStorage",
+ "WPFEssTweaksTele",
+ "WPFEssTweaksWifi",
+ "WPFMiscTweaksLapPower",
+ "WPFMiscTweaksLapNum"
+ ],
+ "minimal": [
+ "WPFEssTweaksHome",
+ "WPFEssTweaksOO",
+ "WPFEssTweaksRP",
+ "WPFEssTweaksServices",
+ "WPFEssTweaksTele"
+ ]
+}' | convertfrom-json
+$sync.configs.tweaks = '{
+ "WPFEssTweaksAH": {
+ "registry": [
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
+ "Name": "EnableActivityFeed",
+ "Type": "DWord",
+ "Value": "0",
+ "OriginalValue": "1"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
+ "Name": "PublishUserActivities",
+ "Type": "DWord",
+ "Value": "0",
+ "OriginalValue": "1"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System",
+ "Name": "UploadUserActivities",
+ "Type": "DWord",
+ "Value": "0",
+ "OriginalValue": "1"
+ }
+ ]
+ },
+ "WPFEssTweaksHiber": {
+ "registry": [
+ {
+ "Path": "HKLM:\\System\\CurrentControlSet\\Control\\Session Manager\\Power",
+ "Name": "HibernateEnabled",
+ "Type": "Dword",
+ "Value": "0",
+ "OriginalValue": "1"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings",
+ "Name": "ShowHibernateOption",
+ "Type": "Dword",
+ "Value": "0",
+ "OriginalValue": "1"
+ }
+ ]
+ },
+ "WPFEssTweaksHome": {
+ "service": [
+ {
+ "Name": "HomeGroupListener",
+ "StartupType": "Manual",
+ "OriginalType": "Automatic"
+ },
+ {
+ "Name": "HomeGroupProvider",
+ "StartupType": "Manual",
+ "OriginalType": "Automatic"
+ }
+ ]
+ },
+ "WPFEssTweaksLoc": {
+ "registry": [
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\location",
+ "Name": "Value",
+ "Type": "String",
+ "Value": "Deny",
+ "OriginalValue": "Allow"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Sensor\\Overrides\\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}",
+ "Name": "SensorPermissionState",
+ "Type": "Dword",
+ "Value": "0",
+ "OriginalValue": "1"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\lfsvc\\Service\\Configuration",
+ "Name": "Status",
+ "Type": "Dword",
+ "Value": "0",
+ "OriginalValue": "1"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\Maps",
+ "Name": "AutoUpdateEnabled",
+ "Type": "Dword",
+ "Value": "0",
+ "OriginalValue": "1"
+ }
+ ]
+ },
+ "WPFEssTweaksServices": {
+ "service": [
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "diagnosticshub.standardcollector.service"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "DiagTrack"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "DPS"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "dmwappushservice"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "lfsvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "MapsBroker"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "NetTcpPortSharing"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "RemoteAccess"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "RemoteRegistry"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "SharedAccess"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "TrkWks"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "WMPNetworkSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "WSearch"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "XblAuthManager"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "XblGameSave"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "XboxNetApiSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "XboxGipSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "ndu"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "WerSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "Fax"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "fhsvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "gupdate"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "gupdatem"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "stisvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "AJRouter"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "MSDTC"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "WpcMonSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "PhoneSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "PrintNotify"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "PcaSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "WPDBusEnum"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "seclogon"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "SysMain"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "lmhosts"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "wisvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "FontCache"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "RetailDemo"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "ALG"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "SCardSvr"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "EntAppSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "BthAvctpSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "Browser"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "BthAvctpSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "iphlpsvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "edgeupdate"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "MicrosoftEdgeElevationService"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "edgeupdatem"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "SEMgrSvc"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "PerfHost"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "BcastDVRUserService_48486de"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "CaptureService_48486de"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "cbdhsvc_48486de"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "WpnService"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "RtkBtManServ"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "QWAVE"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "HPAppHelperCap"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "HPDiagsCap"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "HPNetworkCap"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "HPSysInfoCap"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "HpTouchpointAnalyticsService"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "HvHost"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "vmickvpexchange"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "vmicguestinterface"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "vmicshutdown"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "vmicheartbeat"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "vmicvmsession"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "vmicrdv"
+ },
+ {
+ "StartupType": "Manual",
+ "OriginalType": "Automatic",
+ "Name": "vmictimesync"
+ }
+ ]
+ },
+ "WPFEssTweaksTele": {
+ "ScheduledTask": [
+ {
+ "Name": "Microsoft\\Windows\\Application Experience\\Microsoft Compatibility Appraiser",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ },
+ {
+ "Name": "Microsoft\\Windows\\Application Experience\\ProgramDataUpdater",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ },
+ {
+ "Name": "Microsoft\\Windows\\Autochk\\Proxy",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ },
+ {
+ "Name": "Microsoft\\Windows\\Customer Experience Improvement Program\\Consolidator",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ },
+ {
+ "Name": "Microsoft\\Windows\\Customer Experience Improvement Program\\UsbCeip",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ },
+ {
+ "Name": "Microsoft\\Windows\\DiskDiagnostic\\Microsoft-Windows-DiskDiagnosticDataCollector",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ },
+ {
+ "Name": "Microsoft\\Windows\\Feedback\\Siuf\\DmClient",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ },
+ {
+ "Name": "Microsoft\\Windows\\Feedback\\Siuf\\DmClientOnScenarioDownload",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ },
+ {
+ "Name": "Microsoft\\Windows\\Windows Error Reporting\\QueueReporting",
+ "State": "Disabled",
+ "OriginalState": "Enabled"
+ }
+ ],
+ "registry": [
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection",
+ "type": "Dword",
+ "value": 0,
+ "name": "AllowTelemetry",
+ "OriginalValue": "1"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
+ "OriginalValue": "1",
+ "name": "AllowTelemetry",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "ContentDeliveryAllowed",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "OemPreInstalledAppsEnabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "PreInstalledAppsEnabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "PreInstalledAppsEverEnabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "SilentInstalledAppsEnabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "SubscribedContent-338387Enabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "SubscribedContent-338388Enabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "SubscribedContent-338389Enabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "SubscribedContent-353698Enabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager",
+ "OriginalValue": "1",
+ "name": "SystemPaneSuggestionsEnabled",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent",
+ "OriginalValue": "0",
+ "name": "DisableWindowsConsumerFeatures",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Siuf\\Rules",
+ "OriginalValue": "0",
+ "name": "NumberOfSIUFInPeriod",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection",
+ "OriginalValue": "0",
+ "name": "DoNotShowFeedbackNotifications",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent",
+ "OriginalValue": "0",
+ "name": "DisableTailoredExperiencesWithDiagnosticData",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\AdvertisingInfo",
+ "OriginalValue": "0",
+ "name": "DisabledByGroupPolicy",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting",
+ "OriginalValue": "0",
+ "name": "Disabled",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DeliveryOptimization\\Config",
+ "OriginalValue": "1",
+ "name": "DODownloadMode",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Remote Assistance",
+ "OriginalValue": "1",
+ "name": "fAllowToGetHelp",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\OperationStatusManager",
+ "OriginalValue": "0",
+ "name": "EnthusiastMode",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ "OriginalValue": "1",
+ "name": "ShowTaskViewButton",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People",
+ "OriginalValue": "1",
+ "name": "PeopleBand",
+ "value": 0,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ "OriginalValue": "1",
+ "name": "LaunchTo",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FileSystem",
+ "OriginalValue": "0",
+ "name": "LongPathsEnabled",
+ "value": 1,
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DriverSearching",
+ "OriginalValue": "1",
+ "name": "SearchOrderConfig",
+ "value": "0",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile",
+ "OriginalValue": "1",
+ "name": "SystemResponsiveness",
+ "value": "0",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile",
+ "OriginalValue": "1",
+ "name": "NetworkThrottlingIndex",
+ "value": "4294967295",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\Control Panel\\Desktop",
+ "OriginalValue": "1",
+ "name": "MenuShowDelay",
+ "value": "1",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\Control Panel\\Desktop",
+ "OriginalValue": "1",
+ "name": "AutoEndTasks",
+ "value": "1",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management",
+ "OriginalValue": "0",
+ "name": "ClearPageFileAtShutdown",
+ "value": "0",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\ControlSet001\\Services\\Ndu",
+ "OriginalValue": "1",
+ "name": "Start",
+ "value": "00000004",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "1",
+ "name": "MouseHoverTime",
+ "value": "400",
+ "type": "String"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters",
+ "OriginalValue": "1",
+ "name": "IRPStackSize",
+ "value": "20",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Feeds",
+ "OriginalValue": "1",
+ "name": "EnableFeeds",
+ "value": "0",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Feeds",
+ "OriginalValue": "1",
+ "name": "ShellFeedsTaskbarViewMode",
+ "value": "2",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
+ "OriginalValue": "1",
+ "name": "HideSCAMeetNow",
+ "value": "1",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile\\Tasks\\Games",
+ "OriginalValue": "1",
+ "name": "GPU Priority",
+ "value": "8",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile\\Tasks\\Games",
+ "OriginalValue": "1",
+ "name": "Priority",
+ "value": "6",
+ "type": "Dword"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Multimedia\\SystemProfile\\Tasks\\Games",
+ "OriginalValue": "High",
+ "name": "Scheduling Category",
+ "value": "High",
+ "type": "String"
+ }
+ ],
+ "service": [
+ {
+ "Name": "DiagTrack",
+ "StartupType": "Disabled",
+ "OriginalType": "Automatic"
+ },
+ {
+ "Name": "dmwappushservice",
+ "StartupType": "Disabled",
+ "OriginalType": "Manual"
+ },
+ {
+ "Name": "SysMain",
+ "StartupType": "Disabled",
+ "OriginalType": "Manual"
+ }
+ ],
+ "InvokeScript": [
+ "bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null
+ If ((get-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\" -Name CurrentBuild).CurrentBuild -lt 22557) {
+ $taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru
+ Do {
+ Start-Sleep -Milliseconds 100
+ $preferences = Get-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\TaskManager\" -Name \"Preferences\" -ErrorAction SilentlyContinue
+ } Until ($preferences)
+ Stop-Process $taskmgr
+ $preferences.Preferences[28] = 0
+ Set-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\TaskManager\" -Name \"Preferences\" -Type Binary -Value $preferences.Preferences
+ }
+ Remove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\" -Recurse -ErrorAction SilentlyContinue
+
+ # Group svchost.exe processes
+ $ram = (Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum).Sum / 1kb
+ Set-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\" -Name \"SvcHostSplitThresholdInKB\" -Type DWord -Value $ram -Force
+
+ $autoLoggerDir = \"$env:PROGRAMDATA\\Microsoft\\Diagnosis\\ETLLogs\\AutoLogger\"
+ If (Test-Path \"$autoLoggerDir\\AutoLogger-Diagtrack-Listener.etl\") {
+ Remove-Item \"$autoLoggerDir\\AutoLogger-Diagtrack-Listener.etl\"
+ }
+ icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null
+
+ #Timeout Tweaks cause flickering on Windows now
+ #Remove-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"WaitToKillAppTimeout\" -ErrorAction SilentlyContinue
+ #Remove-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"HungAppTimeout\" -ErrorAction SilentlyContinue
+ #Remove-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\" -Name \"WaitToKillServiceTimeout\" -ErrorAction SilentlyContinue
+ #Remove-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"LowLevelHooksTimeout\" -ErrorAction SilentlyContinue
+ #Remove-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"WaitToKillServiceTimeout\" -ErrorAction SilentlyContinue
+
+ $ram = (Get-CimInstance -ClassName \"Win32_PhysicalMemory\" | Measure-Object -Property Capacity -Sum).Sum / 1kb
+ Set-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\" -Name \"SvcHostSplitThresholdInKB\" -Type DWord -Value $ram -Force
+ "
+ ]
+ },
+ "WPFEssTweaksWifi": {
+ "registry": [
+ {
+ "Path": "HKLM:\\Software\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting",
+ "Name": "Value",
+ "Type": "DWord",
+ "Value": "0",
+ "OriginalValue": "1"
+ },
+ {
+ "Path": "HKLM:\\Software\\Microsoft\\PolicyManager\\default\\WiFi\\AllowAutoConnectToWiFiSenseHotspots",
+ "Name": "Value",
+ "Type": "DWord",
+ "Value": "0",
+ "OriginalValue": "1"
+ }
+ ]
+ },
+ "WPFMiscTweaksLapPower": {
+ "registry": [
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerThrottling",
+ "Name": "PowerThrottlingOff",
+ "Type": "DWord",
+ "Value": "00000000",
+ "OriginalValue": "00000001"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power",
+ "Name": "HiberbootEnabled",
+ "Type": "DWord",
+ "Value": "0000001",
+ "OriginalValue": "0000000"
+ }
+ ]
+ },
+ "WPFMiscTweaksPower": {
+ "registry": [
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Power\\PowerThrottling",
+ "Name": "PowerThrottlingOff",
+ "Type": "DWord",
+ "Value": "00000001",
+ "OriginalValue": "00000000"
+ },
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power",
+ "Name": "HiberbootEnabled",
+ "Type": "DWord",
+ "Value": "0000000",
+ "OriginalValue": "00000001"
+ }
+ ]
+ },
+ "WPFMiscTweaksExt": {
+ "registry": [
+ {
+ "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ "Name": "HideFileExt",
+ "Type": "DWord",
+ "Value": "0",
+ "OriginalValue": "1"
+ }
+ ]
+ },
+ "WPFMiscTweaksUTC": {
+ "registry": [
+ {
+ "Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
+ "Name": "RealTimeIsUniversal",
+ "Type": "DWord",
+ "Value": "1",
+ "OriginalValue": "0"
+ }
+ ]
+ },
+ "WPFMiscTweaksDisplay": {
+ "registry": [
+ {
+ "path": "HKCU:\\Control Panel\\Desktop",
+ "OriginalValue": "1",
+ "name": "DragFullWindows",
+ "value": "0",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Desktop",
+ "OriginalValue": "1",
+ "name": "MenuShowDelay",
+ "value": "200",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Desktop\\WindowMetrics",
+ "OriginalValue": "1",
+ "name": "MinAnimate",
+ "value": "0",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Keyboard",
+ "OriginalValue": "1",
+ "name": "KeyboardDelay",
+ "value": "0",
+ "type": "DWord"
+ },
+ {
+ "path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ "OriginalValue": "1",
+ "name": "ListviewAlphaSelect",
+ "value": "0",
+ "type": "DWord"
+ },
+ {
+ "path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ "OriginalValue": "1",
+ "name": "ListviewShadow",
+ "value": "0",
+ "type": "DWord"
+ },
+ {
+ "path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ "OriginalValue": "1",
+ "name": "TaskbarAnimations",
+ "value": "0",
+ "type": "DWord"
+ },
+ {
+ "path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VisualEffects",
+ "OriginalValue": "1",
+ "name": "VisualFXSetting",
+ "value": "3",
+ "type": "DWord"
+ },
+ {
+ "path": "HKCU:\\Software\\Microsoft\\Windows\\DWM",
+ "OriginalValue": "1",
+ "name": "EnableAeroPeek",
+ "value": "0",
+ "type": "DWord"
+ }
+ ],
+ "InvokeScript": [
+ "Set-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"UserPreferencesMask\" -Type Binary -Value ([byte[]](144,18,3,128,16,0,0,0))"
+ ]
+ },
+ "WPFEssTweaksDeBloat": {
+ "appx": [
+ "Microsoft.Microsoft3DViewer",
+ "Microsoft.AppConnector",
+ "Microsoft.BingFinance",
+ "Microsoft.BingNews",
+ "Microsoft.BingSports",
+ "Microsoft.BingTranslator",
+ "Microsoft.BingWeather",
+ "Microsoft.BingFoodAndDrink",
+ "Microsoft.BingHealthAndFitness",
+ "Microsoft.BingTravel",
+ "Microsoft.MinecraftUWP",
+ "Microsoft.GamingServices",
+ "Microsoft.GetHelp",
+ "Microsoft.Getstarted",
+ "Microsoft.Messaging",
+ "Microsoft.Microsoft3DViewer",
+ "Microsoft.MicrosoftSolitaireCollection",
+ "Microsoft.NetworkSpeedTest",
+ "Microsoft.News",
+ "Microsoft.Office.Lens",
+ "Microsoft.Office.Sway",
+ "Microsoft.Office.OneNote",
+ "Microsoft.OneConnect",
+ "Microsoft.People",
+ "Microsoft.Print3D",
+ "Microsoft.SkypeApp",
+ "Microsoft.Wallet",
+ "Microsoft.Whiteboard",
+ "Microsoft.WindowsAlarms",
+ "microsoft.windowscommunicationsapps",
+ "Microsoft.WindowsFeedbackHub",
+ "Microsoft.WindowsMaps",
+ "Microsoft.WindowsPhone",
+ "Microsoft.WindowsSoundRecorder",
+ "Microsoft.XboxApp",
+ "Microsoft.ConnectivityStore",
+ "Microsoft.CommsPhone",
+ "Microsoft.ScreenSketch",
+ "Microsoft.Xbox.TCUI",
+ "Microsoft.XboxGameOverlay",
+ "Microsoft.XboxGameCallableUI",
+ "Microsoft.XboxSpeechToTextOverlay",
+ "Microsoft.MixedReality.Portal",
+ "Microsoft.XboxIdentityProvider",
+ "Microsoft.ZuneMusic",
+ "Microsoft.ZuneVideo",
+ "Microsoft.Getstarted",
+ "Microsoft.MicrosoftOfficeHub",
+ "*EclipseManager*",
+ "*ActiproSoftwareLLC*",
+ "*AdobeSystemsIncorporated.AdobePhotoshopExpress*",
+ "*Duolingo-LearnLanguagesforFree*",
+ "*PandoraMediaInc*",
+ "*CandyCrush*",
+ "*BubbleWitch3Saga*",
+ "*Wunderlist*",
+ "*Flipboard*",
+ "*Twitter*",
+ "*Facebook*",
+ "*Royal Revolt*",
+ "*Sway*",
+ "*Speed Test*",
+ "*Dolby*",
+ "*Viber*",
+ "*ACGMediaPlayer*",
+ "*Netflix*",
+ "*OneCalendar*",
+ "*LinkedInforWindows*",
+ "*HiddenCityMysteryofShadows*",
+ "*Hulu*",
+ "*HiddenCity*",
+ "*AdobePhotoshopExpress*",
+ "*HotspotShieldFreeVPN*",
+ "*Microsoft.Advertising.Xaml*"
+ ],
+ "InvokeScript": [
+ "
+ $TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, ''Microsoft'', ''Teams'')
+ $TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, ''Update.exe'')
+
+ Write-Host \"Stopping Teams process...\"
+ Stop-Process -Name \"*teams*\" -Force -ErrorAction SilentlyContinue
+
+ Write-Host \"Uninstalling Teams from AppData\\Microsoft\\Teams\"
+ if ([System.IO.File]::Exists($TeamsUpdateExePath)) {
+ # Uninstall app
+ $proc = Start-Process $TeamsUpdateExePath \"-uninstall -s\" -PassThru
+ $proc.WaitForExit()
+ }
+
+ Write-Host \"Removing Teams AppxPackage...\"
+ Get-AppxPackage \"*Teams*\" | Remove-AppxPackage -ErrorAction SilentlyContinue
+ Get-AppxPackage \"*Teams*\" -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
+
+ Write-Host \"Deleting Teams directory\"
+ if ([System.IO.Directory]::Exists($TeamsPath)) {
+ Remove-Item $TeamsPath -Force -Recurse -ErrorAction SilentlyContinue
+ }
+
+ Write-Host \"Deleting Teams uninstall registry key\"
+ # Uninstall from Uninstall registry key UninstallString
+ $us = (Get-ChildItem -Path HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall, HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like ''*Teams*''}).UninstallString
+ if ($us.Length -gt 0) {
+ $us = ($us.Replace(''/I'', ''/uninstall '') + '' /quiet'').Replace('' '', '' '')
+ $FilePath = ($us.Substring(0, $us.IndexOf(''.exe'') + 4).Trim())
+ $ProcessArgs = ($us.Substring($us.IndexOf(''.exe'') + 5).Trim().replace('' '', '' ''))
+ $proc = Start-Process -FilePath $FilePath -Args $ProcessArgs -PassThru
+ $proc.WaitForExit()
+ }
+ "
+ ]
+ },
+ "WPFEssTweaksOO": {
+ "InvokeScript": [
+ "curl.exe -s \"https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/ooshutup10.cfg\" -o $ENV:temp\\ooshutup10.cfg
+ curl.exe -s \"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe\" -o $ENV:temp\\OOSU10.exe
+ Start-Process $ENV:temp\\OOSU10.exe -ArgumentList \"$ENV:temp\\ooshutup10.cfg /quiet\"
+ "
+ ]
+ },
+ "WPFEssTweaksRP": {
+ "InvokeScript": [
+ "Enable-ComputerRestore -Drive \"$env:SystemDrive\"
+ Checkpoint-Computer -Description \"RestorePoint1\" -RestorePointType \"MODIFY_SETTINGS\""
+ ]
+ },
+ "WPFEssTweaksStorage": {
+ "InvokeScript": [
+ "Remove-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Recurse -ErrorAction SilentlyContinue"
+ ]
+ },
+ "WPFMiscTweaksLapNum": {
+ "Registry": [
+ {
+ "path": "HKU:\\.DEFAULT\\Control Panel\\Keyboard",
+ "OriginalValue": "1",
+ "name": "InitialKeyboardIndicators",
+ "value": "0",
+ "type": "DWord"
+ }
+ ]
+ },
+ "WPFMiscTweaksNum": {
+ "Registry": [
+ {
+ "path": "HKU:\\.DEFAULT\\Control Panel\\Keyboard",
+ "OriginalValue": "1",
+ "name": "InitialKeyboardIndicators",
+ "value": "80000002",
+ "type": "DWord"
+ }
+ ]
+ },
+ "WPFEssTweaksRemoveEdge": {
+ "InvokeScript": [
+ "Invoke-WebRequest -useb https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/Edge_Removal.bat | Invoke-Expression"
+ ]
+ },
+ "WPFMiscTweaksDisableNotifications": {
+ "registry": [
+ {
+ "Path": "HKCU:\\Software\\Policies\\Microsoft\\Windows\\Explorer",
+ "Name": "DisableNotificationCenter",
+ "Type": "DWord",
+ "Value": "1",
+ "OriginalValue": "0"
+ },
+ {
+ "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\PushNotifications",
+ "Name": "ToastEnabled",
+ "Type": "DWord",
+ "Value": "0",
+ "OriginalValue": "1"
+ }
+ ]
+ },
+ "WPFMiscTweaksRightClickMenu": {
+ "InvokeScript": [
+ "New-Item -Path \"HKCU:\\Software\\Classes\\CLSID\\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\" -Name \"InprocServer32\" -force -value \"\" "
+ ]
+ },
+ "WPFEssTweaksDiskCleanup": {
+ "InvokeScript": [
+ "cleanmgr.exe /d C: /VERYLOWDISK"
+ ]
+ },
+ "WPFMiscTweaksDisableTPMCheck": {
+ "registry": [
+ {
+ "Path": "HKLM:\\SYSTEM\\Setup\\MoSetup",
+ "Name": "AllowUpgradesWithUnsupportedTPM",
+ "Type": "DWord",
+ "Value": "1",
+ "OriginalValue": "0"
+ }
+ ]
+ },
+ "WPFMiscTweaksDisableUAC": {
+ "registry": [
+ {
+ "path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",
+ "OriginalValue": "5",
+ "name": "ConsentPromptBehaviorAdmin",
+ "value": "0",
+ "type": "DWord"
+ }
+ ]
+ },
+ "WPFMiscTweaksDisableMouseAcceleration": {
+ "registry": [
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "1",
+ "name": "MouseSpeed",
+ "value": "0",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "6",
+ "name": "MouseThreshold1",
+ "value": "0",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "10",
+ "name": "MouseThreshold2",
+ "value": "0",
+ "type": "String"
+ }
+ ]
+ },
+ "WPFMiscTweaksEnableMouseAcceleration": {
+ "registry": [
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "1",
+ "name": "MouseSpeed",
+ "value": "1",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "6",
+ "name": "MouseThreshold1",
+ "value": "6",
+ "type": "String"
+ },
+ {
+ "path": "HKCU:\\Control Panel\\Mouse",
+ "OriginalValue": "10",
+ "name": "MouseThreshold2",
+ "value": "10",
+ "type": "String"
+ }
+ ]
+ },
+ "WPFEssTweaksDeleteTempFiles": {
+ "InvokeScript": [
+ "Get-ChildItem -Path \"C:\\Windows\\Temp\" *.* -Recurse | Remove-Item -Force -Recurse
+ Get-ChildItem -Path $env:TEMP *.* -Recurse | Remove-Item -Force -Recurse"
+ ]
+ },
+ "WPFEssTweaksRemoveCortana": {
+ "InvokeScript": [
+ "Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage"
+ ]
+ },
+ "WPFEssTweaksDVR": {
+ "registry": [
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_FSEBehavior",
+ "Value": "2",
+ "OriginalValue": "1",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_Enabled",
+ "Value": "0",
+ "OriginalValue": "1",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_DXGIHonorFSEWindowsCompatible",
+ "Value": "1",
+ "OriginalValue": "0",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_HonorUserFSEBehaviorMode",
+ "Value": "1",
+ "OriginalValue": "0",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKCU:\\System\\GameConfigStore",
+ "Name": "GameDVR_EFSEFeatureFlags",
+ "Value": "0",
+ "OriginalValue": "1",
+ "Type": "DWord"
+ },
+ {
+ "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR",
+ "Name": "AllowGameDVR",
+ "Value": "0",
+ "OriginalValue": "1",
+ "Type": "DWord"
+ }
+ ]
+ },
+ "WPFBingSearch": {
+ "registry": [
+ {
+ "OriginalValue": "1",
+ "Name": "BingSearchEnabled",
+ "Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Search",
+ "Type": "DWORD",
+ "Value": "0"
+ }
+ ]
+ }
+}' | convertfrom-json
+#region exception classes
+
+ class WingetFailedInstall : Exception {
+ [string] $additionalData
+
+ WingetFailedInstall($Message) : base($Message) {}
+ }
+
+ class ChocoFailedInstall : Exception {
+ [string] $additionalData
+
+ ChocoFailedInstall($Message) : base($Message) {}
+ }
+
+ class GenericException : Exception {
+ [string] $additionalData
+
+ GenericException($Message) : base($Message) {}
+ }
+
+#endregion exception classes
+
+$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^
+ Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed."
+}
+
+#===========================================================================
+# Store Form Objects In PowerShell
+#===========================================================================
+
+$xaml.SelectNodes("//*[@Name]") | ForEach-Object { Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name) }
+
+$buttons = get-variable | Where-Object {$psitem.name -like "WPF*" -and $psitem.value -ne $null -and $psitem.value.GetType().name -eq "Button"}
+foreach ($button in $buttons){
+ $button.value.Add_Click({
+ [System.Object]$Sender = $args[0]
+ Invoke-WPFButton "WPF$($Sender.name)"
})
+}
+
+$WPFToggleDarkMode.IsChecked = Get-WinUtilDarkMode
+
+#===========================================================================
+# Setup background config
+#===========================================================================
+
+#Load information in the background
+Invoke-WPFRunspace -ScriptBlock {
+ $sync.ConfigLoaded = $False
+
+ $sync.ComputerInfo = Get-ComputerInfo
+
+ $sync.ConfigLoaded = $True
+} | Out-Null
#===========================================================================
# Shows the form
#===========================================================================
-Get-FormVariables
+
+Invoke-WPFFormVariables
+
+try{
+ Install-WinUtilChoco
+}
+Catch [ChocoFailedInstall]{
+ Write-Host "==========================================="
+ Write-Host "-- Chocolatey failed to install ---"
+ Write-Host "==========================================="
+}
+$form.title = $form.title + " " + $sync.version
$Form.ShowDialog() | out-null
Stop-Transcript
diff --git a/MainWindow.xaml b/xaml/inputXML.xaml
similarity index 95%
rename from MainWindow.xaml
rename to xaml/inputXML.xaml
index 931799dd..407302aa 100644
--- a/MainWindow.xaml
+++ b/xaml/inputXML.xaml
@@ -1,4 +1,4 @@
-
+
@@ -273,22 +274,28 @@
+
-
-
+
-
-
-
+
+
+
+
-
+
+
+
+
+
+
Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
Recommended selections are for normal users and if you are unsure do NOT check anything else!
-
+
@@ -314,7 +321,7 @@
-
+
@@ -330,13 +337,19 @@
+
+
+
-
+
+
+
-
+
+