# Install winget
Function InstallFTTProgs {
	# Check if winget is installed
	if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe){
		Write-Output "Winget Already Installed."
	}  
	else{
		# Installing winget from the Microsoft Store
		Write-Output "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-Output "Winget Installed"    
	}	
}

#region Third

# Install Brave
Function InstallBrave  {
	Write-Output "Installing Brave"
	winget install -e --id Brave.Brave
}

# Uninstall Brave
Function UninstallBrave  {
	Write-Output "Uninstalling Brave"
	winget uninstall -e --id Brave.Brave
}

# Install Chrome
Function InstallChrome  {
	Write-Output "Installing Chrome"
	winget install -e --id Google.Chrome
}

# Uninstall Chrome
Function UninstallChrome  {
	Write-Output "Uninstalling Chrome"
	winget uninstall -e --id Google.Chrome
}

# Install Chromium
Function InstallChromium  {
	Write-Output "Installing Chromium"
	winget install -e --id Hibbiki.Chromium
}

# Uninstall Chromium
Function UninstallChromium  {
	Write-Output "Uninstalling Chromium"
	winget uninstall -e --id Hibbiki.Chromium
}

# Install Arc
Function InstallArc  {
	Write-Output "Installing Arc"
	winget install -e --id TheBrowserCompany.Arc
}

# Uninstall Arc
Function UninstallArc  {
	Write-Output "Uninstalling Arc"
	winget uninstall -e --id TheBrowserCompany.Arc
}

# Install Edge
Function InstallEdge  {
	Write-Output "Installing Edge"
	winget install -e --id Microsoft.Edge
}

# Uninstall Edge
Function UninstallEdge  {
	Write-Output "Uninstalling Edge"
	winget uninstall -e --id Microsoft.Edge
}

# Install Falkon
Function InstallFalkon  {
	Write-Output "Installing Falkon"
	winget install -e --id KDE.Falkon
}

# Uninstall Falkon
Function UninstallFalkon  {
	Write-Output "Uninstalling Falkon"
	winget uninstall -e --id KDE.Falkon
}

# Install Firefox
Function InstallFirefox  {
	Write-Output "Installing Firefox"
	winget install -e --id Mozilla.Firefox
}

# Uninstall Firefox
Function UninstallFirefox  {
	Write-Output "Uninstalling Firefox"
	winget uninstall -e --id Mozilla.Firefox
}

# Install Firefox ESR
Function InstallFirefoxesr  {
	Write-Output "Installing Firefox ESR"
	winget install -e --id Mozilla.Firefox.ESR
}

# Uninstall Firefox ESR
Function UninstallFirefoxesr  {
	Write-Output "Uninstalling Firefox ESR"
	winget uninstall -e --id Mozilla.Firefox.ESR
}

# Install Floorp
Function InstallFloorp  {
	Write-Output "Installing Floorp"
	winget install -e --id Ablaze.Floorp
}

# Uninstall Floorp
Function UninstallFloorp  {
	Write-Output "Uninstalling Floorp"
	winget uninstall -e --id Ablaze.Floorp
}

# Install LibreWolf
Function InstallLibrewolf  {
	Write-Output "Installing LibreWolf"
	winget install -e --id LibreWolf.LibreWolf
}

# Uninstall LibreWolf
Function UninstallLibrewolf  {
	Write-Output "Uninstalling LibreWolf"
	winget uninstall -e --id LibreWolf.LibreWolf
}

# Install Mullvad Browser
Function InstallMullvadbrowser  {
	Write-Output "Installing Mullvad Browser"
	winget install -e --id MullvadVPN.MullvadBrowser
}

# Uninstall Mullvad Browser
Function UninstallMullvadbrowser  {
	Write-Output "Uninstalling Mullvad Browser"
	winget uninstall -e --id MullvadVPN.MullvadBrowser
}

# Install Thorium Browser AVX2
Function InstallThorium  {
	Write-Output "Installing Thorium Browser AVX2"
	winget install -e --id Alex313031.Thorium.AVX2
}

# Uninstall Thorium Browser AVX2
Function UninstallThorium  {
	Write-Output "Uninstalling Thorium Browser AVX2"
	winget uninstall -e --id Alex313031.Thorium.AVX2
}

# Install Tor Browser
Function InstallTor  {
	Write-Output "Installing Tor Browser"
	winget install -e --id TorProject.TorBrowser
}

# Uninstall Tor Browser
Function UninstallTor  {
	Write-Output "Uninstalling Tor Browser"
	winget uninstall -e --id TorProject.TorBrowser
}

# Install Ungoogled
Function InstallUngoogled  {
	Write-Output "Installing Ungoogled"
	winget install -e --id eloston.ungoogled-chromium
}

# Uninstall Ungoogled
Function UninstallUngoogled  {
	Write-Output "Uninstalling Ungoogled"
	winget uninstall -e --id eloston.ungoogled-chromium
}

# Install Vivaldi
Function InstallVivaldi  {
	Write-Output "Installing Vivaldi"
	winget install -e --id Vivaldi.Vivaldi
}

# Uninstall Vivaldi
Function UninstallVivaldi  {
	Write-Output "Uninstalling Vivaldi"
	winget uninstall -e --id Vivaldi.Vivaldi
}

# Install Waterfox
Function InstallWaterfox  {
	Write-Output "Installing Waterfox"
	winget install -e --id Waterfox.Waterfox
}

# Uninstall Waterfox
Function UninstallWaterfox  {
	Write-Output "Uninstalling Waterfox"
	winget uninstall -e --id Waterfox.Waterfox
}

# Install PaleMoon
Function InstallPaleMoon  {
	Write-Output "Installing PaleMoon"
	winget install -e --id MoonchildProductions.PaleMoon
}

# Uninstall PaleMoon
Function UninstallPaleMoon  {
	Write-Output "Uninstalling PaleMoon"
	winget uninstall -e --id MoonchildProductions.PaleMoon
}

# Install Chatterino
Function InstallChatterino  {
	Write-Output "Installing Chatterino"
	winget install -e --id ChatterinoTeam.Chatterino
}

# Uninstall Chatterino
Function UninstallChatterino  {
	Write-Output "Uninstalling Chatterino"
	winget uninstall -e --id ChatterinoTeam.Chatterino
}

# Install Discord
Function InstallDiscord  {
	Write-Output "Installing Discord"
	winget install -e --id Discord.Discord
}

# Uninstall Discord
Function UninstallDiscord  {
	Write-Output "Uninstalling Discord"
	winget uninstall -e --id Discord.Discord
}

# Install Ferdium
Function InstallFerdium  {
	Write-Output "Installing Ferdium"
	winget install -e --id Ferdium.Ferdium
}

# Uninstall Ferdium
Function UninstallFerdium  {
	Write-Output "Uninstalling Ferdium"
	winget uninstall -e --id Ferdium.Ferdium
}

# Install Guilded
Function InstallGuilded  {
	Write-Output "Installing Guilded"
	winget install -e --id Guilded.Guilded
}

# Uninstall Guilded
Function UninstallGuilded  {
	Write-Output "Uninstalling Guilded"
	winget uninstall -e --id Guilded.Guilded
}

# Install Hexchat
Function InstallHexchat  {
	Write-Output "Installing Hexchat"
	winget install -e --id HexChat.HexChat
}

# Uninstall Hexchat
Function UninstallHexchat  {
	Write-Output "Uninstalling Hexchat"
	winget uninstall -e --id HexChat.HexChat
}

# Install Jami
Function InstallJami  {
	Write-Output "Installing Jami"
	winget install -e --id SFLinux.Jami
}

# Uninstall Jami
Function UninstallJami  {
	Write-Output "Uninstalling Jami"
	winget uninstall -e --id SFLinux.Jami
}

# Install Linphone
Function InstallLinphone  {
	Write-Output "Installing Linphone"
	winget install -e --id BelledonneCommunications.Linphone
}

# Uninstall Linphone
Function UninstallLinphone  {
	Write-Output "Uninstalling Linphone"
	winget uninstall -e --id BelledonneCommunications.Linphone
}

# Install Element
Function InstallMatrix  {
	Write-Output "Installing Element"
	winget install -e --id Element.Element
}

# Uninstall Element
Function UninstallMatrix  {
	Write-Output "Uninstalling Element"
	winget uninstall -e --id Element.Element
}

# Install QTox
Function InstallQtox  {
	Write-Output "Installing QTox"
	winget install -e --id Tox.qTox
}

# Uninstall QTox
Function UninstallQtox  {
	Write-Output "Uninstalling QTox"
	winget uninstall -e --id Tox.qTox
}

# Install Revolt
Function InstallRevolt  {
	Write-Output "Installing Revolt"
	winget install -e --id Revolt.RevoltDesktop
}

# Uninstall Revolt
Function UninstallRevolt  {
	Write-Output "Uninstalling Revolt"
	winget uninstall -e --id Revolt.RevoltDesktop
}

# Install Session
Function InstallSession  {
	Write-Output "Installing Session"
	winget install -e --id Oxen.Session
}

# Uninstall Session
Function UninstallSession  {
	Write-Output "Uninstalling Session"
	winget uninstall -e --id Oxen.Session
}

# Install Signal
Function InstallSignal  {
	Write-Output "Installing Signal"
	winget install -e --id OpenWhisperSystems.Signal
}

# Uninstall Signal
Function UninstallSignal  {
	Write-Output "Uninstalling Signal"
	winget uninstall -e --id OpenWhisperSystems.Signal
}

# Install Skype
Function InstallSkype  {
	Write-Output "Installing Skype"
	winget install -e --id Microsoft.Skype
}

# Uninstall Skype
Function UninstallSkype  {
	Write-Output "Uninstalling Skype"
	winget uninstall -e --id Microsoft.Skype
}

# Install Slack
Function InstallSlack  {
	Write-Output "Installing Slack"
	winget install -e --id SlackTechnologies.Slack
}

# Uninstall Slack
Function UninstallSlack  {
	Write-Output "Uninstalling Slack"
	winget uninstall -e --id SlackTechnologies.Slack
}

# Install Teams
Function InstallTeams  {
	Write-Output "Installing Teams"
	winget install -e --id Microsoft.Teams
}

# Uninstall Teams
Function UninstallTeams  {
	Write-Output "Uninstalling Teams"
	winget uninstall -e --id Microsoft.Teams
}

# Install Telegram
Function InstallTelegram  {
	Write-Output "Installing Telegram"
	winget install -e --id Telegram.TelegramDesktop
}

# Uninstall Telegram
Function UninstallTelegram  {
	Write-Output "Uninstalling Telegram"
	winget uninstall -e --id Telegram.TelegramDesktop
}

# Install Unigram
Function InstallUnigram  {
	Write-Output "Installing Unigram"
	winget install -e --id Telegram.Unigram
}

# Uninstall Unigram
Function UninstallUnigram  {
	Write-Output "Uninstalling Unigram"
	winget uninstall -e --id Telegram.Unigram
}

# Install Thunderbird
Function InstallThunderbird  {
	Write-Output "Installing Thunderbird"
	winget install -e --id Mozilla.Thunderbird
}

# Uninstall Thunderbird
Function UninstallThunderbird  {
	Write-Output "Uninstalling Thunderbird"
	winget uninstall -e --id Mozilla.Thunderbird
}

# Install Betterbird
Function InstallBetterbird  {
	Write-Output "Installing Betterbird"
	winget install -e --id Betterbird.Betterbird
}

# Uninstall Betterbird
Function UninstallBetterbird  {
	Write-Output "Uninstalling Betterbird"
	winget uninstall -e --id Betterbird.Betterbird
}

# Install Vesktop
Function InstallVesktop  {
	Write-Output "Installing Vesktop"
	winget install -e --id Vencord.Vesktop
}

# Uninstall Vesktop
Function UninstallVesktop  {
	Write-Output "Uninstalling Vesktop"
	winget uninstall -e --id Vencord.Vesktop
}

# Install Viber
Function InstallViber  {
	Write-Output "Installing Viber"
	winget install -e --id Viber.Viber
}

# Uninstall Viber
Function UninstallViber  {
	Write-Output "Uninstalling Viber"
	winget uninstall -e --id Viber.Viber
}

# Install Zoom
Function InstallZoom  {
	Write-Output "Installing Zoom"
	winget install -e --id Zoom.Zoom
}

# Uninstall Zoom
Function UninstallZoom  {
	Write-Output "Uninstalling Zoom"
	winget uninstall -e --id Zoom.Zoom
}

# Install Zulip
Function InstallZulip  {
	Write-Output "Installing Zulip"
	winget install -e --id Zulip.Zulip
}

# Uninstall Zulip
Function UninstallZulip  {
	Write-Output "Uninstalling Zulip"
	winget uninstall -e --id Zulip.Zulip
}

# Install Anaconda
Function InstallAnaconda3  {
	Write-Output "Installing Anaconda"
	winget install -e --id Anaconda.Anaconda3
}

# Uninstall Anaconda
Function UninstallAnaconda3  {
	Write-Output "Uninstalling Anaconda"
	winget uninstall -e --id Anaconda.Anaconda3
}

# Install Clink
Function InstallClink  {
	Write-Output "Installing Clink"
	winget install -e --id chrisant996.Clink
}

# Uninstall Clink
Function UninstallClink  {
	Write-Output "Uninstalling Clink"
	winget uninstall -e --id chrisant996.Clink
}

# Install CMake
Function InstallCmake  {
	Write-Output "Installing CMake"
	winget install -e --id Kitware.CMake
}

# Uninstall CMake
Function UninstallCmake  {
	Write-Output "Uninstalling CMake"
	winget uninstall -e --id Kitware.CMake
}

# Install DaxStudio
Function InstallDaxStudio  {
	Write-Output "Installing DaxStudio"
	winget install -e --id DaxStudio.DaxStudio
}

# Uninstall DaxStudio
Function UninstallDaxStudio  {
	Write-Output "Uninstalling DaxStudio"
	winget uninstall -e --id DaxStudio.DaxStudio
}

# Install Docker Desktop
Function InstallDockerdesktop  {
	Write-Output "Installing Docker Desktop"
	winget install -e --id Docker.DockerDesktop
}

# Uninstall Docker Desktop
Function UninstallDockerdesktop  {
	Write-Output "Uninstalling Docker Desktop"
	winget uninstall -e --id Docker.DockerDesktop
}

# Install Git
Function InstallGit  {
	Write-Output "Installing Git"
	winget install -e --id Git.Git
}

# Uninstall Git
Function UninstallGit  {
	Write-Output "Uninstalling Git"
	winget uninstall -e --id Git.Git
}

# Install Git Butler
Function InstallGitbutler  {
	Write-Output "Installing Git Butler"
	winget install -e --id GitButler.GitButler
}

# Uninstall Git Butler
Function UninstallGitbutler  {
	Write-Output "Uninstalling Git Butler"
	winget uninstall -e --id GitButler.GitButler
}

# Install Git Extensions
Function InstallGitextensions  {
	Write-Output "Installing Git Extensions"
	winget install -e --id GitExtensionsTeam.GitExtensions
}

# Uninstall Git Extensions
Function UninstallGitextensions  {
	Write-Output "Uninstalling Git Extensions"
	winget uninstall -e --id GitExtensionsTeam.GitExtensions
}

# Install GitHub CLI
Function InstallGithubcli  {
	Write-Output "Installing GitHub CLI"
	winget install -e --id GitHub.cli
}

# Uninstall GitHub CLI
Function UninstallGithubcli  {
	Write-Output "Uninstalling GitHub CLI"
	winget uninstall -e --id GitHub.cli
}

# Install GitHub Desktop
Function InstallGithubdesktop  {
	Write-Output "Installing GitHub Desktop"
	winget install -e --id GitHub.GitHubDesktop
}

# Uninstall GitHub Desktop
Function UninstallGithubdesktop  {
	Write-Output "Uninstalling GitHub Desktop"
	winget uninstall -e --id GitHub.GitHubDesktop
}

# Install GitKraken Client
Function InstallGitkrakenclient  {
	Write-Output "Installing GitKraken Client"
	winget install -e --id Axosoft.GitKraken
}

# Uninstall GitKraken Client
Function UninstallGitkrakenclient  {
	Write-Output "Uninstalling GitKraken Client"
	winget uninstall -e --id Axosoft.GitKraken
}

# Install Godot Engine
Function InstallGodotengine  {
	Write-Output "Installing Godot Engine"
	winget install -e --id GodotEngine.GodotEngine
}

# Uninstall Godot Engine
Function UninstallGodotengine  {
	Write-Output "Uninstalling Godot Engine"
	winget uninstall -e --id GodotEngine.GodotEngine
}

# Install Gitify
Function InstallGitify  {
	Write-Output "Installing Gitify"
	winget install -e --id Gitify.Gitify
}

# Uninstall Gitify
Function UninstallGitify  {
	Write-Output "Uninstalling Gitify"
	winget uninstall -e --id Gitify.Gitify
}

# Install Go
Function InstallGolang  {
	Write-Output "Installing Go"
	winget install -e --id GoLang.Go
}

# Uninstall Go
Function UninstallGolang  {
	Write-Output "Uninstalling Go"
	winget uninstall -e --id GoLang.Go
}

# Install Helix
Function InstallHelix  {
	Write-Output "Installing Helix"
	winget install -e --id Helix.Helix
}

# Uninstall Helix
Function UninstallHelix  {
	Write-Output "Uninstalling Helix"
	winget uninstall -e --id Helix.Helix
}

# Install Amazon Corretto 8 (LTS)
Function InstallJava8  {
	Write-Output "Installing Amazon Corretto 8 (LTS)"
	winget install -e --id Amazon.Corretto.8.JDK
}

# Uninstall Amazon Corretto 8 (LTS)
Function UninstallJava8  {
	Write-Output "Uninstalling Amazon Corretto 8 (LTS)"
	winget uninstall -e --id Amazon.Corretto.8.JDK
}

# Install Amazon Corretto 11 (LTS)
Function InstallJava11  {
	Write-Output "Installing Amazon Corretto 11 (LTS)"
	winget install -e --id Amazon.Corretto.11.JDK
}

# Uninstall Amazon Corretto 11 (LTS)
Function UninstallJava11  {
	Write-Output "Uninstalling Amazon Corretto 11 (LTS)"
	winget uninstall -e --id Amazon.Corretto.11.JDK
}

# Install Amazon Corretto 17 (LTS)
Function InstallJava17  {
	Write-Output "Installing Amazon Corretto 17 (LTS)"
	winget install -e --id Amazon.Corretto.17.JDK
}

# Uninstall Amazon Corretto 17 (LTS)
Function UninstallJava17  {
	Write-Output "Uninstalling Amazon Corretto 17 (LTS)"
	winget uninstall -e --id Amazon.Corretto.17.JDK
}

# Install Amazon Corretto 21 (LTS)
Function InstallJava21  {
	Write-Output "Installing Amazon Corretto 21 (LTS)"
	winget install -e --id Amazon.Corretto.21.JDK
}

# Uninstall Amazon Corretto 21 (LTS)
Function UninstallJava21  {
	Write-Output "Uninstalling Amazon Corretto 21 (LTS)"
	winget uninstall -e --id Amazon.Corretto.21.JDK
}

# Install Jetbrains Toolbox
Function InstallJetbrains  {
	Write-Output "Installing Jetbrains Toolbox"
	winget install -e --id JetBrains.Toolbox
}

# Uninstall Jetbrains Toolbox
Function UninstallJetbrains  {
	Write-Output "Uninstalling Jetbrains Toolbox"
	winget uninstall -e --id JetBrains.Toolbox
}

# Install Lazygit
Function InstallLazygit  {
	Write-Output "Installing Lazygit"
	winget install -e --id JesseDuffield.lazygit
}

# Uninstall Lazygit
Function UninstallLazygit  {
	Write-Output "Uninstalling Lazygit"
	winget uninstall -e --id JesseDuffield.lazygit
}

# Install Neovim
Function InstallNeovim  {
	Write-Output "Installing Neovim"
	winget install -e --id Neovim.Neovim
}

# Uninstall Neovim
Function UninstallNeovim  {
	Write-Output "Uninstalling Neovim"
	winget uninstall -e --id Neovim.Neovim
}

# Install NodeJS
Function InstallNodejs  {
	Write-Output "Installing NodeJS"
	winget install -e --id OpenJS.NodeJS
}

# Uninstall NodeJS
Function UninstallNodejs  {
	Write-Output "Uninstalling NodeJS"
	winget uninstall -e --id OpenJS.NodeJS
}

# Install NodeJS LTS
Function InstallNodejslts  {
	Write-Output "Installing NodeJS LTS"
	winget install -e --id OpenJS.NodeJS.LTS
}

# Uninstall NodeJS LTS
Function UninstallNodejslts  {
	Write-Output "Uninstalling NodeJS LTS"
	winget uninstall -e --id OpenJS.NodeJS.LTS
}

# Install Node Version Manager
Function InstallNvm  {
	Write-Output "Installing Node Version Manager"
	winget install -e --id CoreyButler.NVMforWindows
}

# Uninstall Node Version Manager
Function UninstallNvm  {
	Write-Output "Uninstalling Node Version Manager"
	winget uninstall -e --id CoreyButler.NVMforWindows
}

# Install Oh My Posh (Prompt)
Function InstallPosh  {
	Write-Output "Installing Oh My Posh (Prompt)"
	winget install -e --id JanDeDobbeleer.OhMyPosh
}

# Uninstall Oh My Posh (Prompt)
Function UninstallPosh  {
	Write-Output "Uninstalling Oh My Posh (Prompt)"
	winget uninstall -e --id JanDeDobbeleer.OhMyPosh
}

# Install Postman
Function InstallPostman  {
	Write-Output "Installing Postman"
	winget install -e --id Postman.Postman
}

# Uninstall Postman
Function UninstallPostman  {
	Write-Output "Uninstalling Postman"
	winget uninstall -e --id Postman.Postman
}

# Install Python3
Function InstallPython3  {
	Write-Output "Installing Python3"
	winget install -e --id Python.Python.3.12
}

# Uninstall Python3
Function UninstallPython3  {
	Write-Output "Uninstalling Python3"
	winget uninstall -e --id Python.Python.3.12
}

# Install Rust
Function InstallRustlang  {
	Write-Output "Installing Rust"
	winget install -e --id Rustlang.Rust.MSVC
}

# Uninstall Rust
Function UninstallRustlang  {
	Write-Output "Uninstalling Rust"
	winget uninstall -e --id Rustlang.Rust.MSVC
}

# Install Starship (Shell Prompt)
Function InstallStarship  {
	Write-Output "Installing Starship (Shell Prompt)"
	winget install -e --id starship
}

# Uninstall Starship (Shell Prompt)
Function UninstallStarship  {
	Write-Output "Uninstalling Starship (Shell Prompt)"
	winget uninstall -e --id starship
}

# Install Sublime Merge
Function InstallSublimemerge  {
	Write-Output "Installing Sublime Merge"
	winget install -e --id SublimeHQ.SublimeMerge
}

# Uninstall Sublime Merge
Function UninstallSublimemerge  {
	Write-Output "Uninstalling Sublime Merge"
	winget uninstall -e --id SublimeHQ.SublimeMerge
}

# Install Sublime Text
Function InstallSublimetext  {
	Write-Output "Installing Sublime Text"
	winget install -e --id SublimeHQ.SublimeText.4
}

# Uninstall Sublime Text
Function UninstallSublimetext  {
	Write-Output "Uninstalling Sublime Text"
	winget uninstall -e --id SublimeHQ.SublimeText.4
}

# Install Swift toolchain
Function InstallSwift  {
	Write-Output "Installing Swift toolchain"
	winget install -e --id Swift.Toolchain
}

# Uninstall Swift toolchain
Function UninstallSwift  {
	Write-Output "Uninstalling Swift toolchain"
	winget uninstall -e --id Swift.Toolchain
}

# Install Thonny Python IDE
Function InstallThonny  {
	Write-Output "Installing Thonny Python IDE"
	winget install -e --id AivarAnnamaa.Thonny
}

# Uninstall Thonny Python IDE
Function UninstallThonny  {
	Write-Output "Uninstalling Thonny Python IDE"
	winget uninstall -e --id AivarAnnamaa.Thonny
}

# Install Code With Mu (Mu Editor)
Function InstallMuEditor  {
	Write-Output "Installing Code With Mu (Mu Editor)"
	winget install -e --id Mu.Mu
}

# Uninstall Code With Mu (Mu Editor)
Function UninstallMuEditor  {
	Write-Output "Uninstalling Code With Mu (Mu Editor)"
	winget uninstall -e --id Mu.Mu
}

# Install Unity Game Engine
Function InstallUnity  {
	Write-Output "Installing Unity Game Engine"
	winget install -e --id Unity.UnityHub
}

# Uninstall Unity Game Engine
Function UninstallUnity  {
	Write-Output "Uninstalling Unity Game Engine"
	winget uninstall -e --id Unity.UnityHub
}

# Install Vagrant
Function InstallVagrant  {
	Write-Output "Installing Vagrant"
	winget install -e --id Hashicorp.Vagrant
}

# Uninstall Vagrant
Function UninstallVagrant  {
	Write-Output "Uninstalling Vagrant"
	winget uninstall -e --id Hashicorp.Vagrant
}

# Install Visual Studio 2022
Function InstallVisualstudio  {
	Write-Output "Installing Visual Studio 2022"
	winget install -e --id Microsoft.VisualStudio.2022.Community
}

# Uninstall Visual Studio 2022
Function UninstallVisualstudio  {
	Write-Output "Uninstalling Visual Studio 2022"
	winget uninstall -e --id Microsoft.VisualStudio.2022.Community
}

# Install VS Code
Function InstallVscode  {
	Write-Output "Installing VS Code"
	winget install -e --id Microsoft.VisualStudioCode
}

# Uninstall VS Code
Function UninstallVscode  {
	Write-Output "Uninstalling VS Code"
	winget uninstall -e --id Microsoft.VisualStudioCode
}

# Install VS Codium
Function InstallVscodium  {
	Write-Output "Installing VS Codium"
	winget install -e --id VSCodium.VSCodium
}

# Uninstall VS Codium
Function UninstallVscodium  {
	Write-Output "Uninstalling VS Codium"
	winget uninstall -e --id VSCodium.VSCodium
}

# Install Wezterm
Function InstallWezterm  {
	Write-Output "Installing Wezterm"
	winget install -e --id wez.wezterm
}

# Uninstall Wezterm
Function UninstallWezterm  {
	Write-Output "Uninstalling Wezterm"
	winget uninstall -e --id wez.wezterm
}

# Install Yarn
Function InstallYarn  {
	Write-Output "Installing Yarn"
	winget install -e --id Yarn.Yarn
}

# Uninstall Yarn
Function UninstallYarn  {
	Write-Output "Uninstalling Yarn"
	winget uninstall -e --id Yarn.Yarn
}

# Install Miniconda
Function InstallMiniconda  {
	Write-Output "Installing Miniconda"
	winget install -e --id Anaconda.Miniconda3
}

# Uninstall Miniconda
Function UninstallMiniconda  {
	Write-Output "Uninstalling Miniconda"
	winget uninstall -e --id Anaconda.Miniconda3
}

# Install Pixi
Function InstallPixi  {
	Write-Output "Installing Pixi"
	winget install -e --id prefix-dev.pixi
}

# Uninstall Pixi
Function UninstallPixi  {
	Write-Output "Uninstalling Pixi"
	winget uninstall -e --id prefix-dev.pixi
}

# Install Eclipse Temurin
Function InstallTemurin  {
	Write-Output "Installing Eclipse Temurin"
	winget install -e --id EclipseAdoptium.Temurin.21.JDK
}

# Uninstall Eclipse Temurin
Function UninstallTemurin  {
	Write-Output "Uninstalling Eclipse Temurin"
	winget uninstall -e --id EclipseAdoptium.Temurin.21.JDK
}

# Install Python Version Manager (pyenv-win)
Function InstallPyenvwin  {
	Write-Output "Installing Python Version Manager (pyenv-win)"
	winget install -e --id na
}

# Uninstall Python Version Manager (pyenv-win)
Function UninstallPyenvwin  {
	Write-Output "Uninstalling Python Version Manager (pyenv-win)"
	winget uninstall -e --id na
}

# Install Fast Node Manager
Function InstallFnm  {
	Write-Output "Installing Fast Node Manager"
	winget install -e --id Schniz.fnm
}

# Uninstall Fast Node Manager
Function UninstallFnm  {
	Write-Output "Uninstalling Fast Node Manager"
	winget uninstall -e --id Schniz.fnm
}

# Install Pulsar
Function InstallPulsarEdit  {
	Write-Output "Installing Pulsar"
	winget install -e --id Pulsar-Edit.Pulsar
}

# Uninstall Pulsar
Function UninstallPulsarEdit  {
	Write-Output "Uninstalling Pulsar"
	winget uninstall -e --id Pulsar-Edit.Pulsar
}

# Install Aegisub
Function InstallAegisub  {
	Write-Output "Installing Aegisub"
	winget install -e --id Aegisub.Aegisub
}

# Uninstall Aegisub
Function UninstallAegisub  {
	Write-Output "Uninstalling Aegisub"
	winget uninstall -e --id Aegisub.Aegisub
}

# Install Fork
Function InstallFork  {
	Write-Output "Installing Fork"
	winget install -e --id Fork.Fork
}

# Uninstall Fork
Function UninstallFork  {
	Write-Output "Uninstalling Fork"
	winget uninstall -e --id Fork.Fork
}

# Install Adobe Acrobat Reader
Function InstallAdobe  {
	Write-Output "Installing Adobe Acrobat Reader"
	winget install -e --id Adobe.Acrobat.Reader.64-bit
}

# Uninstall Adobe Acrobat Reader
Function UninstallAdobe  {
	Write-Output "Uninstalling Adobe Acrobat Reader"
	winget uninstall -e --id Adobe.Acrobat.Reader.64-bit
}

# Install AFFiNE
Function InstallAffine  {
	Write-Output "Installing AFFiNE"
	winget install -e --id ToEverything.AFFiNE
}

# Uninstall AFFiNE
Function UninstallAffine  {
	Write-Output "Uninstalling AFFiNE"
	winget uninstall -e --id ToEverything.AFFiNE
}

# Install Anki
Function InstallAnki  {
	Write-Output "Installing Anki"
	winget install -e --id Anki.Anki
}

# Uninstall Anki
Function UninstallAnki  {
	Write-Output "Uninstalling Anki"
	winget uninstall -e --id Anki.Anki
}

# Install Calibre
Function InstallCalibre  {
	Write-Output "Installing Calibre"
	winget install -e --id calibre.calibre
}

# Uninstall Calibre
Function UninstallCalibre  {
	Write-Output "Uninstalling Calibre"
	winget uninstall -e --id calibre.calibre
}

# Install Foxit PDF Editor
Function InstallFoxpdfeditor  {
	Write-Output "Installing Foxit PDF Editor"
	winget install -e --id Foxit.PhantomPDF
}

# Uninstall Foxit PDF Editor
Function UninstallFoxpdfeditor  {
	Write-Output "Uninstalling Foxit PDF Editor"
	winget uninstall -e --id Foxit.PhantomPDF
}

# Install Foxit PDF Reader
Function InstallFoxpdfreader  {
	Write-Output "Installing Foxit PDF Reader"
	winget install -e --id Foxit.FoxitReader
}

# Uninstall Foxit PDF Reader
Function UninstallFoxpdfreader  {
	Write-Output "Uninstalling Foxit PDF Reader"
	winget uninstall -e --id Foxit.FoxitReader
}

# Install Joplin (FOSS Notes)
Function InstallJoplin  {
	Write-Output "Installing Joplin (FOSS Notes)"
	winget install -e --id Joplin.Joplin
}

# Uninstall Joplin (FOSS Notes)
Function UninstallJoplin  {
	Write-Output "Uninstalling Joplin (FOSS Notes)"
	winget uninstall -e --id Joplin.Joplin
}

# Install LibreOffice
Function InstallLibreoffice  {
	Write-Output "Installing LibreOffice"
	winget install -e --id TheDocumentFoundation.LibreOffice
}

# Uninstall LibreOffice
Function UninstallLibreoffice  {
	Write-Output "Uninstalling LibreOffice"
	winget uninstall -e --id TheDocumentFoundation.LibreOffice
}

# Install Logseq
Function InstallLogseq  {
	Write-Output "Installing Logseq"
	winget install -e --id Logseq.Logseq
}

# Uninstall Logseq
Function UninstallLogseq  {
	Write-Output "Uninstalling Logseq"
	winget uninstall -e --id Logseq.Logseq
}

# Install massCode (Snippet Manager)
Function InstallMasscode  {
	Write-Output "Installing massCode (Snippet Manager)"
	winget install -e --id antonreshetov.massCode
}

# Uninstall massCode (Snippet Manager)
Function UninstallMasscode  {
	Write-Output "Uninstalling massCode (Snippet Manager)"
	winget uninstall -e --id antonreshetov.massCode
}

# Install NAPS2 (Document Scanner)
Function InstallNaps2  {
	Write-Output "Installing NAPS2 (Document Scanner)"
	winget install -e --id Cyanfish.NAPS2
}

# Uninstall NAPS2 (Document Scanner)
Function UninstallNaps2  {
	Write-Output "Uninstalling NAPS2 (Document Scanner)"
	winget uninstall -e --id Cyanfish.NAPS2
}

# Install Notepad++
Function InstallNotepadplus  {
	Write-Output "Installing Notepad++"
	winget install -e --id Notepad++.Notepad++
}

# Uninstall Notepad++
Function UninstallNotepadplus  {
	Write-Output "Uninstalling Notepad++"
	winget uninstall -e --id Notepad++.Notepad++
}

# Install Obsidian
Function InstallObsidian  {
	Write-Output "Installing Obsidian"
	winget install -e --id Obsidian.Obsidian
}

# Uninstall Obsidian
Function UninstallObsidian  {
	Write-Output "Uninstalling Obsidian"
	winget uninstall -e --id Obsidian.Obsidian
}

# Install Okular
Function InstallOkular  {
	Write-Output "Installing Okular"
	winget install -e --id KDE.Okular
}

# Uninstall Okular
Function UninstallOkular  {
	Write-Output "Uninstalling Okular"
	winget uninstall -e --id KDE.Okular
}

# Install ONLYOffice Desktop
Function InstallOnlyoffice  {
	Write-Output "Installing ONLYOffice Desktop"
	winget install -e --id ONLYOFFICE.DesktopEditors
}

# Uninstall ONLYOffice Desktop
Function UninstallOnlyoffice  {
	Write-Output "Uninstalling ONLYOffice Desktop"
	winget uninstall -e --id ONLYOFFICE.DesktopEditors
}

# Install Apache OpenOffice
Function InstallOpenoffice  {
	Write-Output "Installing Apache OpenOffice"
	winget install -e --id Apache.OpenOffice
}

# Uninstall Apache OpenOffice
Function UninstallOpenoffice  {
	Write-Output "Uninstalling Apache OpenOffice"
	winget uninstall -e --id Apache.OpenOffice
}

# Install PDF24 creator
Function InstallPdf24creator  {
	Write-Output "Installing PDF24 creator"
	winget install -e --id geeksoftwareGmbH.PDF24Creator
}

# Uninstall PDF24 creator
Function UninstallPdf24creator  {
	Write-Output "Uninstalling PDF24 creator"
	winget uninstall -e --id geeksoftwareGmbH.PDF24Creator
}

# Install PDFsam Basic
Function InstallPdfsam  {
	Write-Output "Installing PDFsam Basic"
	winget install -e --id PDFsam.PDFsam
}

# Uninstall PDFsam Basic
Function UninstallPdfsam  {
	Write-Output "Uninstalling PDFsam Basic"
	winget uninstall -e --id PDFsam.PDFsam
}

# Install simplenote
Function InstallSimplenote  {
	Write-Output "Installing simplenote"
	winget install -e --id Automattic.Simplenote
}

# Uninstall simplenote
Function UninstallSimplenote  {
	Write-Output "Uninstalling simplenote"
	winget uninstall -e --id Automattic.Simplenote
}

# Install Sumatra PDF
Function InstallSumatra  {
	Write-Output "Installing Sumatra PDF"
	winget install -e --id SumatraPDF.SumatraPDF
}

# Uninstall Sumatra PDF
Function UninstallSumatra  {
	Write-Output "Uninstalling Sumatra PDF"
	winget uninstall -e --id SumatraPDF.SumatraPDF
}

# Install PDFgear
Function InstallPdfgear  {
	Write-Output "Installing PDFgear"
	winget install -e --id PDFgear.PDFgear
}

# Uninstall PDFgear
Function UninstallPdfgear  {
	Write-Output "Uninstalling PDFgear"
	winget uninstall -e --id PDFgear.PDFgear
}

# Install WinMerge
Function InstallWinmerge  {
	Write-Output "Installing WinMerge"
	winget install -e --id WinMerge.WinMerge
}

# Uninstall WinMerge
Function UninstallWinmerge  {
	Write-Output "Uninstalling WinMerge"
	winget uninstall -e --id WinMerge.WinMerge
}

# Install Xournal++
Function InstallXournal  {
	Write-Output "Installing Xournal++"
	winget install -e --id Xournal++.Xournal++
}

# Uninstall Xournal++
Function UninstallXournal  {
	Write-Output "Uninstalling Xournal++"
	winget uninstall -e --id Xournal++.Xournal++
}

# Install Zim Desktop Wiki
Function InstallZim  {
	Write-Output "Installing Zim Desktop Wiki"
	winget install -e --id Zimwiki.Zim
}

# Uninstall Zim Desktop Wiki
Function UninstallZim  {
	Write-Output "Uninstalling Zim Desktop Wiki"
	winget uninstall -e --id Zimwiki.Zim
}

# Install Znote
Function InstallZnote  {
	Write-Output "Installing Znote"
	winget install -e --id alagrede.znote
}

# Uninstall Znote
Function UninstallZnote  {
	Write-Output "Uninstalling Znote"
	winget uninstall -e --id alagrede.znote
}

# Install Zotero
Function InstallZotero  {
	Write-Output "Installing Zotero"
	winget install -e --id DigitalScholar.Zotero
}

# Uninstall Zotero
Function UninstallZotero  {
	Write-Output "Uninstalling Zotero"
	winget uninstall -e --id DigitalScholar.Zotero
}

# Install Cemu
Function InstallCemu  {
	Write-Output "Installing Cemu"
	winget install -e --id Cemu.Cemu
}

# Uninstall Cemu
Function UninstallCemu  {
	Write-Output "Uninstalling Cemu"
	winget uninstall -e --id Cemu.Cemu
}

# Install Clone Hero
Function InstallClonehero  {
	Write-Output "Installing Clone Hero"
	winget install -e --id CloneHeroTeam.CloneHero
}

# Uninstall Clone Hero
Function UninstallClonehero  {
	Write-Output "Uninstalling Clone Hero"
	winget uninstall -e --id CloneHeroTeam.CloneHero
}

# Install EA App
Function InstallEaapp  {
	Write-Output "Installing EA App"
	winget install -e --id ElectronicArts.EADesktop
}

# Uninstall EA App
Function UninstallEaapp  {
	Write-Output "Uninstalling EA App"
	winget uninstall -e --id ElectronicArts.EADesktop
}

# Install Emulation Station
Function InstallEmulationstation  {
	Write-Output "Installing Emulation Station"
	winget install -e --id Emulationstation.Emulationstation
}

# Uninstall Emulation Station
Function UninstallEmulationstation  {
	Write-Output "Uninstalling Emulation Station"
	winget uninstall -e --id Emulationstation.Emulationstation
}

# Install Epic Games Launcher
Function InstallEpicgames  {
	Write-Output "Installing Epic Games Launcher"
	winget install -e --id EpicGames.EpicGamesLauncher
}

# Uninstall Epic Games Launcher
Function UninstallEpicgames  {
	Write-Output "Uninstalling Epic Games Launcher"
	winget uninstall -e --id EpicGames.EpicGamesLauncher
}

# Install GeForce NOW
Function InstallGeforcenow  {
	Write-Output "Installing GeForce NOW"
	winget install -e --id Nvidia.GeForceNow
}

# Uninstall GeForce NOW
Function UninstallGeforcenow  {
	Write-Output "Uninstalling GeForce NOW"
	winget uninstall -e --id Nvidia.GeForceNow
}

# Install GOG Galaxy
Function InstallGog  {
	Write-Output "Installing GOG Galaxy"
	winget install -e --id GOG.Galaxy
}

# Uninstall GOG Galaxy
Function UninstallGog  {
	Write-Output "Uninstalling GOG Galaxy"
	winget uninstall -e --id GOG.Galaxy
}

# Install Heroic Games Launcher
Function InstallHeroiclauncher  {
	Write-Output "Installing Heroic Games Launcher"
	winget install -e --id HeroicGamesLauncher.HeroicGamesLauncher
}

# Uninstall Heroic Games Launcher
Function UninstallHeroiclauncher  {
	Write-Output "Uninstalling Heroic Games Launcher"
	winget uninstall -e --id HeroicGamesLauncher.HeroicGamesLauncher
}

# Install Itch.io
Function InstallItch  {
	Write-Output "Installing Itch.io"
	winget install -e --id ItchIo.Itch
}

# Uninstall Itch.io
Function UninstallItch  {
	Write-Output "Uninstalling Itch.io"
	winget uninstall -e --id ItchIo.Itch
}

# Install Moonlight/GameStream Client
Function InstallMoonlight  {
	Write-Output "Installing Moonlight/GameStream Client"
	winget install -e --id MoonlightGameStreamingProject.Moonlight
}

# Uninstall Moonlight/GameStream Client
Function UninstallMoonlight  {
	Write-Output "Uninstalling Moonlight/GameStream Client"
	winget uninstall -e --id MoonlightGameStreamingProject.Moonlight
}

# Install Playnite
Function InstallPlaynite  {
	Write-Output "Installing Playnite"
	winget install -e --id Playnite.Playnite
}

# Uninstall Playnite
Function UninstallPlaynite  {
	Write-Output "Uninstalling Playnite"
	winget uninstall -e --id Playnite.Playnite
}

# Install Prism Launcher
Function InstallPrismlauncher  {
	Write-Output "Installing Prism Launcher"
	winget install -e --id PrismLauncher.PrismLauncher
}

# Uninstall Prism Launcher
Function UninstallPrismlauncher  {
	Write-Output "Uninstalling Prism Launcher"
	winget uninstall -e --id PrismLauncher.PrismLauncher
}

# Install PS Remote Play
Function InstallPsremoteplay  {
	Write-Output "Installing PS Remote Play"
	winget install -e --id PlayStation.PSRemotePlay
}

# Uninstall PS Remote Play
Function UninstallPsremoteplay  {
	Write-Output "Uninstalling PS Remote Play"
	winget uninstall -e --id PlayStation.PSRemotePlay
}

# Install SideQuestVR
Function InstallSidequest  {
	Write-Output "Installing SideQuestVR"
	winget install -e --id SideQuestVR.SideQuest
}

# Uninstall SideQuestVR
Function UninstallSidequest  {
	Write-Output "Uninstalling SideQuestVR"
	winget uninstall -e --id SideQuestVR.SideQuest
}

# Install Steam
Function InstallSteam  {
	Write-Output "Installing Steam"
	winget install -e --id Valve.Steam
}

# Uninstall Steam
Function UninstallSteam  {
	Write-Output "Uninstalling Steam"
	winget uninstall -e --id Valve.Steam
}

# Install Sunshine/GameStream Server
Function InstallSunshine  {
	Write-Output "Installing Sunshine/GameStream Server"
	winget install -e --id LizardByte.Sunshine
}

# Uninstall Sunshine/GameStream Server
Function UninstallSunshine  {
	Write-Output "Uninstalling Sunshine/GameStream Server"
	winget uninstall -e --id LizardByte.Sunshine
}

# Install TCNO Account Switcher
Function InstallTcNoAccSwitcher  {
	Write-Output "Installing TCNO Account Switcher"
	winget install -e --id TechNobo.TcNoAccountSwitcher
}

# Uninstall TCNO Account Switcher
Function UninstallTcNoAccSwitcher  {
	Write-Output "Uninstalling TCNO Account Switcher"
	winget uninstall -e --id TechNobo.TcNoAccountSwitcher
}

# Install Ubisoft Connect
Function InstallUbisoft  {
	Write-Output "Installing Ubisoft Connect"
	winget install -e --id Ubisoft.Connect
}

# Uninstall Ubisoft Connect
Function UninstallUbisoft  {
	Write-Output "Uninstalling Ubisoft Connect"
	winget uninstall -e --id Ubisoft.Connect
}

# Install Virtual Desktop Streamer
Function InstallVrdesktopstreamer  {
	Write-Output "Installing Virtual Desktop Streamer"
	winget install -e --id VirtualDesktop.Streamer
}

# Uninstall Virtual Desktop Streamer
Function UninstallVrdesktopstreamer  {
	Write-Output "Uninstalling Virtual Desktop Streamer"
	winget uninstall -e --id VirtualDesktop.Streamer
}

# Install XEMU
Function InstallXemu  {
	Write-Output "Installing XEMU"
	winget install -e --id xemu-project.xemu
}

# Uninstall XEMU
Function UninstallXemu  {
	Write-Output "Uninstalling XEMU"
	winget uninstall -e --id xemu-project.xemu
}

# Install Autoruns
Function InstallAutoruns  {
	Write-Output "Installing Autoruns"
	winget install -e --id Microsoft.Sysinternals.Autoruns
}

# Uninstall Autoruns
Function UninstallAutoruns  {
	Write-Output "Uninstalling Autoruns"
	winget uninstall -e --id Microsoft.Sysinternals.Autoruns
}

# Install RDCMan
Function InstallRdcman  {
	Write-Output "Installing RDCMan"
	winget install -e --id Microsoft.Sysinternals.RDCMan
}

# Uninstall RDCMan
Function UninstallRdcman  {
	Write-Output "Uninstalling RDCMan"
	winget uninstall -e --id Microsoft.Sysinternals.RDCMan
}

# Install Microsoft Azure Data Studio
Function InstallAzuredatastudio  {
	Write-Output "Installing Microsoft Azure Data Studio"
	winget install -e --id Microsoft.AzureDataStudio
}

# Uninstall Microsoft Azure Data Studio
Function UninstallAzuredatastudio  {
	Write-Output "Uninstalling Microsoft Azure Data Studio"
	winget uninstall -e --id Microsoft.AzureDataStudio
}

# Install .NET Desktop Runtime 3.1
Function InstallDotnet3  {
	Write-Output "Installing .NET Desktop Runtime 3.1"
	winget install -e --id Microsoft.DotNet.DesktopRuntime.3_1
}

# Uninstall .NET Desktop Runtime 3.1
Function UninstallDotnet3  {
	Write-Output "Uninstalling .NET Desktop Runtime 3.1"
	winget uninstall -e --id Microsoft.DotNet.DesktopRuntime.3_1
}

# Install .NET Desktop Runtime 5
Function InstallDotnet5  {
	Write-Output "Installing .NET Desktop Runtime 5"
	winget install -e --id Microsoft.DotNet.DesktopRuntime.5
}

# Uninstall .NET Desktop Runtime 5
Function UninstallDotnet5  {
	Write-Output "Uninstalling .NET Desktop Runtime 5"
	winget uninstall -e --id Microsoft.DotNet.DesktopRuntime.5
}

# Install .NET Desktop Runtime 6
Function InstallDotnet6  {
	Write-Output "Installing .NET Desktop Runtime 6"
	winget install -e --id Microsoft.DotNet.DesktopRuntime.6
}

# Uninstall .NET Desktop Runtime 6
Function UninstallDotnet6  {
	Write-Output "Uninstalling .NET Desktop Runtime 6"
	winget uninstall -e --id Microsoft.DotNet.DesktopRuntime.6
}

# Install .NET Desktop Runtime 7
Function InstallDotnet7  {
	Write-Output "Installing .NET Desktop Runtime 7"
	winget install -e --id Microsoft.DotNet.DesktopRuntime.7
}

# Uninstall .NET Desktop Runtime 7
Function UninstallDotnet7  {
	Write-Output "Uninstalling .NET Desktop Runtime 7"
	winget uninstall -e --id Microsoft.DotNet.DesktopRuntime.7
}

# Install .NET Desktop Runtime 8
Function InstallDotnet8  {
	Write-Output "Installing .NET Desktop Runtime 8"
	winget install -e --id Microsoft.DotNet.DesktopRuntime.8
}

# Uninstall .NET Desktop Runtime 8
Function UninstallDotnet8  {
	Write-Output "Uninstalling .NET Desktop Runtime 8"
	winget uninstall -e --id Microsoft.DotNet.DesktopRuntime.8
}

# Install NuGet
Function InstallNuget  {
	Write-Output "Installing NuGet"
	winget install -e --id Microsoft.NuGet
}

# Uninstall NuGet
Function UninstallNuget  {
	Write-Output "Uninstalling NuGet"
	winget uninstall -e --id Microsoft.NuGet
}

# Install OneDrive
Function InstallOnedrive  {
	Write-Output "Installing OneDrive"
	winget install -e --id Microsoft.OneDrive
}

# Uninstall OneDrive
Function UninstallOnedrive  {
	Write-Output "Uninstalling OneDrive"
	winget uninstall -e --id Microsoft.OneDrive
}

# Install Power Automate
Function InstallPowerautomate  {
	Write-Output "Installing Power Automate"
	winget install -e --id Microsoft.PowerAutomateDesktop
}

# Uninstall Power Automate
Function UninstallPowerautomate  {
	Write-Output "Uninstalling Power Automate"
	winget uninstall -e --id Microsoft.PowerAutomateDesktop
}

# Install Power BI
Function InstallPowerbi  {
	Write-Output "Installing Power BI"
	winget install -e --id Microsoft.PowerBI
}

# Uninstall Power BI
Function UninstallPowerbi  {
	Write-Output "Uninstalling Power BI"
	winget uninstall -e --id Microsoft.PowerBI
}

# Install PowerShell
Function InstallPowershell  {
	Write-Output "Installing PowerShell"
	winget install -e --id Microsoft.PowerShell
}

# Uninstall PowerShell
Function UninstallPowershell  {
	Write-Output "Uninstalling PowerShell"
	winget uninstall -e --id Microsoft.PowerShell
}

# Install PowerToys
Function InstallPowertoys  {
	Write-Output "Installing PowerToys"
	winget install -e --id Microsoft.PowerToys
}

# Uninstall PowerToys
Function UninstallPowertoys  {
	Write-Output "Uninstalling PowerToys"
	winget uninstall -e --id Microsoft.PowerToys
}

# Install SysInternals Process Monitor
Function InstallProcessmonitor  {
	Write-Output "Installing SysInternals Process Monitor"
	winget install -e --id Microsoft.Sysinternals.ProcessMonitor
}

# Uninstall SysInternals Process Monitor
Function UninstallProcessmonitor  {
	Write-Output "Uninstalling SysInternals Process Monitor"
	winget uninstall -e --id Microsoft.Sysinternals.ProcessMonitor
}

# Install Microsoft SQL Server Management Studio
Function InstallSqlmanagementstudio  {
	Write-Output "Installing Microsoft SQL Server Management Studio"
	winget install -e --id Microsoft.SQLServerManagementStudio
}

# Uninstall Microsoft SQL Server Management Studio
Function UninstallSqlmanagementstudio  {
	Write-Output "Uninstalling Microsoft SQL Server Management Studio"
	winget uninstall -e --id Microsoft.SQLServerManagementStudio
}

# Install SysInternals TCPView
Function InstallTcpview  {
	Write-Output "Installing SysInternals TCPView"
	winget install -e --id Microsoft.Sysinternals.TCPView
}

# Uninstall SysInternals TCPView
Function UninstallTcpview  {
	Write-Output "Uninstalling SysInternals TCPView"
	winget uninstall -e --id Microsoft.Sysinternals.TCPView
}

# Install Windows Terminal
Function InstallTerminal  {
	Write-Output "Installing Windows Terminal"
	winget install -e --id Microsoft.WindowsTerminal
}

# Uninstall Windows Terminal
Function UninstallTerminal  {
	Write-Output "Uninstalling Windows Terminal"
	winget uninstall -e --id Microsoft.WindowsTerminal
}

# Install Visual C++ 2015-2022 32-bit
Function InstallVc2015_32  {
	Write-Output "Installing Visual C++ 2015-2022 32-bit"
	winget install -e --id Microsoft.VCRedist.2015+.x86
}

# Uninstall Visual C++ 2015-2022 32-bit
Function UninstallVc2015_32  {
	Write-Output "Uninstalling Visual C++ 2015-2022 32-bit"
	winget uninstall -e --id Microsoft.VCRedist.2015+.x86
}

# Install Visual C++ 2015-2022 64-bit
Function InstallVc2015_64  {
	Write-Output "Installing Visual C++ 2015-2022 64-bit"
	winget install -e --id Microsoft.VCRedist.2015+.x64
}

# Uninstall Visual C++ 2015-2022 64-bit
Function UninstallVc2015_64  {
	Write-Output "Uninstalling Visual C++ 2015-2022 64-bit"
	winget uninstall -e --id Microsoft.VCRedist.2015+.x64
}

# Install Advanced IP Scanner
Function InstallAdvancedip  {
	Write-Output "Installing Advanced IP Scanner"
	winget install -e --id Famatech.AdvancedIPScanner
}

# Uninstall Advanced IP Scanner
Function UninstallAdvancedip  {
	Write-Output "Uninstalling Advanced IP Scanner"
	winget uninstall -e --id Famatech.AdvancedIPScanner
}

# Install Angry IP Scanner
Function InstallAngryipscanner  {
	Write-Output "Installing Angry IP Scanner"
	winget install -e --id angryziber.AngryIPScanner
}

# Uninstall Angry IP Scanner
Function UninstallAngryipscanner  {
	Write-Output "Uninstalling Angry IP Scanner"
	winget uninstall -e --id angryziber.AngryIPScanner
}

# Install EFI Boot Editor
Function InstallEfibooteditor  {
	Write-Output "Installing EFI Boot Editor"
	winget install -e --id EFIBootEditor.EFIBootEditor
}

# Uninstall EFI Boot Editor
Function UninstallEfibooteditor  {
	Write-Output "Uninstalling EFI Boot Editor"
	winget uninstall -e --id EFIBootEditor.EFIBootEditor
}

# Install HeidiSQL
Function InstallHeidisql  {
	Write-Output "Installing HeidiSQL"
	winget install -e --id HeidiSQL.HeidiSQL
}

# Uninstall HeidiSQL
Function UninstallHeidisql  {
	Write-Output "Uninstalling HeidiSQL"
	winget uninstall -e --id HeidiSQL.HeidiSQL
}

# Install mRemoteNG
Function InstallMremoteng  {
	Write-Output "Installing mRemoteNG"
	winget install -e --id mRemoteNG.mRemoteNG
}

# Uninstall mRemoteNG
Function UninstallMremoteng  {
	Write-Output "Uninstalling mRemoteNG"
	winget uninstall -e --id mRemoteNG.mRemoteNG
}

# Install Mullvad VPN
Function InstallMullvadvpn  {
	Write-Output "Installing Mullvad VPN"
	winget install -e --id MullvadVPN.MullvadVPN
}

# Uninstall Mullvad VPN
Function UninstallMullvadvpn  {
	Write-Output "Uninstalling Mullvad VPN"
	winget uninstall -e --id MullvadVPN.MullvadVPN
}

# Install NetBird
Function InstallNetbird  {
	Write-Output "Installing NetBird"
	winget install -e --id netbird
}

# Uninstall NetBird
Function UninstallNetbird  {
	Write-Output "Uninstalling NetBird"
	winget uninstall -e --id netbird
}

# Install Nmap
Function InstallNmap  {
	Write-Output "Installing Nmap"
	winget install -e --id Insecure.Nmap
}

# Uninstall Nmap
Function UninstallNmap  {
	Write-Output "Uninstalling Nmap"
	winget uninstall -e --id Insecure.Nmap
}

# Install OpenVPN Connect
Function InstallOpenVPN  {
	Write-Output "Installing OpenVPN Connect"
	winget install -e --id OpenVPNTechnologies.OpenVPNConnect
}

# Uninstall OpenVPN Connect
Function UninstallOpenVPN  {
	Write-Output "Uninstalling OpenVPN Connect"
	winget uninstall -e --id OpenVPNTechnologies.OpenVPNConnect
}

# Install Portmaster
Function InstallPortmaster  {
	Write-Output "Installing Portmaster"
	winget install -e --id Safing.Portmaster
}

# Uninstall Portmaster
Function UninstallPortmaster  {
	Write-Output "Uninstalling Portmaster"
	winget uninstall -e --id Safing.Portmaster
}

# Install PuTTY
Function InstallPutty  {
	Write-Output "Installing PuTTY"
	winget install -e --id PuTTY.PuTTY
}

# Uninstall PuTTY
Function UninstallPutty  {
	Write-Output "Uninstalling PuTTY"
	winget uninstall -e --id PuTTY.PuTTY
}

# Install RustDesk
Function InstallRustdesk  {
	Write-Output "Installing RustDesk"
	winget install -e --id RustDesk.RustDesk
}

# Uninstall RustDesk
Function UninstallRustdesk  {
	Write-Output "Uninstalling RustDesk"
	winget uninstall -e --id RustDesk.RustDesk
}

# Install Simplewall
Function InstallSimplewall  {
	Write-Output "Installing Simplewall"
	winget install -e --id Henry++.simplewall
}

# Uninstall Simplewall
Function UninstallSimplewall  {
	Write-Output "Uninstalling Simplewall"
	winget uninstall -e --id Henry++.simplewall
}

# Install Ventoy
Function InstallVentoy  {
	Write-Output "Installing Ventoy"
	winget install -e --id Ventoy.Ventoy
}

# Uninstall Ventoy
Function UninstallVentoy  {
	Write-Output "Uninstalling Ventoy"
	winget uninstall -e --id Ventoy.Ventoy
}

# Install WinSCP
Function InstallWinscp  {
	Write-Output "Installing WinSCP"
	winget install -e --id WinSCP.WinSCP
}

# Uninstall WinSCP
Function UninstallWinscp  {
	Write-Output "Uninstalling WinSCP"
	winget uninstall -e --id WinSCP.WinSCP
}

# Install WireGuard
Function InstallWireguard  {
	Write-Output "Installing WireGuard"
	winget install -e --id WireGuard.WireGuard
}

# Uninstall WireGuard
Function UninstallWireguard  {
	Write-Output "Uninstalling WireGuard"
	winget uninstall -e --id WireGuard.WireGuard
}

# Install Wireshark
Function InstallWireshark  {
	Write-Output "Installing Wireshark"
	winget install -e --id WiresharkFoundation.Wireshark
}

# Uninstall Wireshark
Function UninstallWireshark  {
	Write-Output "Uninstalling Wireshark"
	winget uninstall -e --id WiresharkFoundation.Wireshark
}

# Install XPipe
Function InstallXpipe  {
	Write-Output "Installing XPipe"
	winget install -e --id xpipe-io.xpipe
}

# Uninstall XPipe
Function UninstallXpipe  {
	Write-Output "Uninstalling XPipe"
	winget uninstall -e --id xpipe-io.xpipe
}

# Install 1Password
Function Install1password  {
	Write-Output "Installing 1Password"
	winget install -e --id AgileBits.1Password
}

# Uninstall 1Password
Function Uninstall1password  {
	Write-Output "Uninstalling 1Password"
	winget uninstall -e --id AgileBits.1Password
}

# Install 7-Zip
Function Install7zip  {
	Write-Output "Installing 7-Zip"
	winget install -e --id 7zip.7zip
}

# Uninstall 7-Zip
Function Uninstall7zip  {
	Write-Output "Uninstalling 7-Zip"
	winget uninstall -e --id 7zip.7zip
}

# Install Alacritty Terminal
Function InstallAlacritty  {
	Write-Output "Installing Alacritty Terminal"
	winget install -e --id Alacritty.Alacritty
}

# Uninstall Alacritty Terminal
Function UninstallAlacritty  {
	Write-Output "Uninstalling Alacritty Terminal"
	winget uninstall -e --id Alacritty.Alacritty
}

# Install AnyDesk
Function InstallAnydesk  {
	Write-Output "Installing AnyDesk"
	winget install -e --id AnyDeskSoftwareGmbH.AnyDesk
}

# Uninstall AnyDesk
Function UninstallAnydesk  {
	Write-Output "Uninstalling AnyDesk"
	winget uninstall -e --id AnyDeskSoftwareGmbH.AnyDesk
}

# Install AutoHotkey
Function InstallAutohotkey  {
	Write-Output "Installing AutoHotkey"
	winget install -e --id AutoHotkey.AutoHotkey
}

# Uninstall AutoHotkey
Function UninstallAutohotkey  {
	Write-Output "Uninstalling AutoHotkey"
	winget uninstall -e --id AutoHotkey.AutoHotkey
}

# Install Barrier
Function InstallBarrier  {
	Write-Output "Installing Barrier"
	winget install -e --id DebaucheeOpenSourceGroup.Barrier
}

# Uninstall Barrier
Function UninstallBarrier  {
	Write-Output "Uninstalling Barrier"
	winget uninstall -e --id DebaucheeOpenSourceGroup.Barrier
}

# Install Bat (Cat)
Function InstallBat  {
	Write-Output "Installing Bat (Cat)"
	winget install -e --id sharkdp.bat
}

# Uninstall Bat (Cat)
Function UninstallBat  {
	Write-Output "Uninstalling Bat (Cat)"
	winget uninstall -e --id sharkdp.bat
}

# Install Bitwarden
Function InstallBitwarden  {
	Write-Output "Installing Bitwarden"
	winget install -e --id Bitwarden.Bitwarden
}

# Uninstall Bitwarden
Function UninstallBitwarden  {
	Write-Output "Uninstalling Bitwarden"
	winget uninstall -e --id Bitwarden.Bitwarden
}

# Install BleachBit
Function InstallBleachbit  {
	Write-Output "Installing BleachBit"
	winget install -e --id BleachBit.BleachBit
}

# Uninstall BleachBit
Function UninstallBleachbit  {
	Write-Output "Uninstalling BleachBit"
	winget uninstall -e --id BleachBit.BleachBit
}

# Install Bulk Crap Uninstaller
Function InstallBulkcrapuninstaller  {
	Write-Output "Installing Bulk Crap Uninstaller"
	winget install -e --id Klocman.BulkCrapUninstaller
}

# Uninstall Bulk Crap Uninstaller
Function UninstallBulkcrapuninstaller  {
	Write-Output "Uninstalling Bulk Crap Uninstaller"
	winget uninstall -e --id Klocman.BulkCrapUninstaller
}

# Install Bulk Rename Utility
Function InstallBulkrenameutility  {
	Write-Output "Installing Bulk Rename Utility"
	winget install -e --id TGRMNSoftware.BulkRenameUtility
}

# Uninstall Bulk Rename Utility
Function UninstallBulkrenameutility  {
	Write-Output "Uninstalling Bulk Rename Utility"
	winget uninstall -e --id TGRMNSoftware.BulkRenameUtility
}

# Install Advanced Renamer
Function InstallAdvancedRenamer  {
	Write-Output "Installing Advanced Renamer"
	winget install -e --id HulubuluSoftware.AdvancedRenamer
}

# Uninstall Advanced Renamer
Function UninstallAdvancedRenamer  {
	Write-Output "Uninstalling Advanced Renamer"
	winget uninstall -e --id HulubuluSoftware.AdvancedRenamer
}

# Install Carnac
Function InstallCarnac  {
	Write-Output "Installing Carnac"
	winget install -e --id code52.Carnac
}

# Uninstall Carnac
Function UninstallCarnac  {
	Write-Output "Uninstalling Carnac"
	winget uninstall -e --id code52.Carnac
}

# Install CopyQ (Clipboard Manager)
Function InstallCopyq  {
	Write-Output "Installing CopyQ (Clipboard Manager)"
	winget install -e --id hluk.CopyQ
}

# Uninstall CopyQ (Clipboard Manager)
Function UninstallCopyq  {
	Write-Output "Uninstalling CopyQ (Clipboard Manager)"
	winget uninstall -e --id hluk.CopyQ
}

# Install CPU-Z
Function InstallCpuz  {
	Write-Output "Installing CPU-Z"
	winget install -e --id CPUID.CPU-Z
}

# Uninstall CPU-Z
Function UninstallCpuz  {
	Write-Output "Uninstalling CPU-Z"
	winget uninstall -e --id CPUID.CPU-Z
}

# Install Crystal Disk Info
Function InstallCrystaldiskinfo  {
	Write-Output "Installing Crystal Disk Info"
	winget install -e --id CrystalDewWorld.CrystalDiskInfo
}

# Uninstall Crystal Disk Info
Function UninstallCrystaldiskinfo  {
	Write-Output "Uninstalling Crystal Disk Info"
	winget uninstall -e --id CrystalDewWorld.CrystalDiskInfo
}

# Install CapFrameX
Function InstallCapframex  {
	Write-Output "Installing CapFrameX"
	winget install -e --id CXWorld.CapFrameX
}

# Uninstall CapFrameX
Function UninstallCapframex  {
	Write-Output "Uninstalling CapFrameX"
	winget uninstall -e --id CXWorld.CapFrameX
}

# Install Crystal Disk Mark
Function InstallCrystaldiskmark  {
	Write-Output "Installing Crystal Disk Mark"
	winget install -e --id CrystalDewWorld.CrystalDiskMark
}

# Uninstall Crystal Disk Mark
Function UninstallCrystaldiskmark  {
	Write-Output "Uninstalling Crystal Disk Mark"
	winget uninstall -e --id CrystalDewWorld.CrystalDiskMark
}

# Install Display Driver Uninstaller
Function InstallDdu  {
	Write-Output "Installing Display Driver Uninstaller"
	winget install -e --id ddu
}

# Uninstall Display Driver Uninstaller
Function UninstallDdu  {
	Write-Output "Uninstalling Display Driver Uninstaller"
	winget uninstall -e --id ddu
}

# Install Deluge
Function InstallDeluge  {
	Write-Output "Installing Deluge"
	winget install -e --id DelugeTeam.Deluge
}

# Uninstall Deluge
Function UninstallDeluge  {
	Write-Output "Uninstalling Deluge"
	winget uninstall -e --id DelugeTeam.Deluge
}

# Install DevToys
Function InstallDevtoys  {
	Write-Output "Installing DevToys"
	winget install -e --id DevToys-app.DevToys
}

# Uninstall DevToys
Function UninstallDevtoys  {
	Write-Output "Uninstalling DevToys"
	winget uninstall -e --id DevToys-app.DevToys
}

# Install Ditto
Function InstallDitto  {
	Write-Output "Installing Ditto"
	winget install -e --id Ditto.Ditto
}

# Uninstall Ditto
Function UninstallDitto  {
	Write-Output "Uninstalling Ditto"
	winget uninstall -e --id Ditto.Ditto
}

# Install Dual Monitor Tools
Function InstallDmt  {
	Write-Output "Installing Dual Monitor Tools"
	winget install -e --id GNE.DualMonitorTools
}

# Uninstall Dual Monitor Tools
Function UninstallDmt  {
	Write-Output "Uninstalling Dual Monitor Tools"
	winget uninstall -e --id GNE.DualMonitorTools
}

# Install Duplicati
Function InstallDuplicati  {
	Write-Output "Installing Duplicati"
	winget install -e --id Duplicati.Duplicati
}

# Uninstall Duplicati
Function UninstallDuplicati  {
	Write-Output "Uninstalling Duplicati"
	winget uninstall -e --id Duplicati.Duplicati
}

# Install Everything Search
Function InstallEsearch  {
	Write-Output "Installing Everything Search"
	winget install -e --id voidtools.Everything
}

# Uninstall Everything Search
Function UninstallEsearch  {
	Write-Output "Uninstalling Everything Search"
	winget uninstall -e --id voidtools.Everything
}

# Install Espanso
Function InstallEspanso  {
	Write-Output "Installing Espanso"
	winget install -e --id Espanso.Espanso
}

# Uninstall Espanso
Function UninstallEspanso  {
	Write-Output "Uninstalling Espanso"
	winget uninstall -e --id Espanso.Espanso
}

# Install Etcher USB Creator
Function InstallEtcher  {
	Write-Output "Installing Etcher USB Creator"
	winget install -e --id Balena.Etcher
}

# Uninstall Etcher USB Creator
Function UninstallEtcher  {
	Write-Output "Uninstalling Etcher USB Creator"
	winget uninstall -e --id Balena.Etcher
}

# Install Fastfetch
Function InstallFastfetch  {
	Write-Output "Installing Fastfetch"
	winget install -e --id Fastfetch-cli.Fastfetch
}

# Uninstall Fastfetch
Function UninstallFastfetch  {
	Write-Output "Uninstalling Fastfetch"
	winget uninstall -e --id Fastfetch-cli.Fastfetch
}

# Install File-Converter
Function InstallFileconverter  {
	Write-Output "Installing File-Converter"
	winget install -e --id AdrienAllard.FileConverter
}

# Uninstall File-Converter
Function UninstallFileconverter  {
	Write-Output "Uninstalling File-Converter"
	winget uninstall -e --id AdrienAllard.FileConverter
}

# Install Files
Function InstallFiles  {
	Write-Output "Installing Files"
	winget install -e --id na
}

# Uninstall Files
Function UninstallFiles  {
	Write-Output "Uninstalling Files"
	winget uninstall -e --id na
}

# Install Flow launcher
Function InstallFlow  {
	Write-Output "Installing Flow launcher"
	winget install -e --id Flow-Launcher.Flow-Launcher
}

# Uninstall Flow launcher
Function UninstallFlow  {
	Write-Output "Uninstalling Flow launcher"
	winget uninstall -e --id Flow-Launcher.Flow-Launcher
}

# Install F.lux
Function InstallFlux  {
	Write-Output "Installing F.lux"
	winget install -e --id flux.flux
}

# Uninstall F.lux
Function UninstallFlux  {
	Write-Output "Uninstalling F.lux"
	winget uninstall -e --id flux.flux
}

# Install Fzf
Function InstallFzf  {
	Write-Output "Installing Fzf"
	winget install -e --id junegunn.fzf
}

# Uninstall Fzf
Function UninstallFzf  {
	Write-Output "Uninstalling Fzf"
	winget uninstall -e --id junegunn.fzf
}

# Install Glary Utilities
Function InstallGlaryutilities  {
	Write-Output "Installing Glary Utilities"
	winget install -e --id Glarysoft.GlaryUtilities
}

# Uninstall Glary Utilities
Function UninstallGlaryutilities  {
	Write-Output "Uninstalling Glary Utilities"
	winget uninstall -e --id Glarysoft.GlaryUtilities
}

# Install Google Drive
Function InstallGoogledrive  {
	Write-Output "Installing Google Drive"
	winget install -e --id Google.GoogleDrive
}

# Uninstall Google Drive
Function UninstallGoogledrive  {
	Write-Output "Uninstalling Google Drive"
	winget uninstall -e --id Google.GoogleDrive
}

# Install GPU-Z
Function InstallGpuz  {
	Write-Output "Installing GPU-Z"
	winget install -e --id TechPowerUp.GPU-Z
}

# Uninstall GPU-Z
Function UninstallGpuz  {
	Write-Output "Uninstalling GPU-Z"
	winget uninstall -e --id TechPowerUp.GPU-Z
}

# Install Gsudo
Function InstallGsudo  {
	Write-Output "Installing Gsudo"
	winget install -e --id gerardog.gsudo
}

# Uninstall Gsudo
Function UninstallGsudo  {
	Write-Output "Uninstalling Gsudo"
	winget uninstall -e --id gerardog.gsudo
}

# Install HWiNFO
Function InstallHwinfo  {
	Write-Output "Installing HWiNFO"
	winget install -e --id REALiX.HWiNFO
}

# Uninstall HWiNFO
Function UninstallHwinfo  {
	Write-Output "Uninstalling HWiNFO"
	winget uninstall -e --id REALiX.HWiNFO
}

# Install HWMonitor
Function InstallHwmonitor  {
	Write-Output "Installing HWMonitor"
	winget install -e --id CPUID.HWMonitor
}

# Uninstall HWMonitor
Function UninstallHwmonitor  {
	Write-Output "Uninstalling HWMonitor"
	winget uninstall -e --id CPUID.HWMonitor
}

# Install JDownloader
Function InstallJdownloader  {
	Write-Output "Installing JDownloader"
	winget install -e --id AppWork.JDownloader
}

# Uninstall JDownloader
Function UninstallJdownloader  {
	Write-Output "Uninstalling JDownloader"
	winget uninstall -e --id AppWork.JDownloader
}

# Install JPEG View
Function InstallJpegview  {
	Write-Output "Installing JPEG View"
	winget install -e --id sylikc.JPEGView
}

# Uninstall JPEG View
Function UninstallJpegview  {
	Write-Output "Uninstalling JPEG View"
	winget uninstall -e --id sylikc.JPEGView
}

# Install KDE Connect
Function InstallKdeconnect  {
	Write-Output "Installing KDE Connect"
	winget install -e --id KDE.KDEConnect
}

# Uninstall KDE Connect
Function UninstallKdeconnect  {
	Write-Output "Uninstalling KDE Connect"
	winget uninstall -e --id KDE.KDEConnect
}

# Install KeePassXC
Function InstallKeepass  {
	Write-Output "Installing KeePassXC"
	winget install -e --id KeePassXCTeam.KeePassXC
}

# Uninstall KeePassXC
Function UninstallKeepass  {
	Write-Output "Uninstalling KeePassXC"
	winget uninstall -e --id KeePassXCTeam.KeePassXC
}

# Install Link Shell extension
Function InstallLinkshellextension  {
	Write-Output "Installing Link Shell extension"
	winget install -e --id HermannSchinagl.LinkShellExtension
}

# Uninstall Link Shell extension
Function UninstallLinkshellextension  {
	Write-Output "Uninstalling Link Shell extension"
	winget uninstall -e --id HermannSchinagl.LinkShellExtension
}

# Install Lively Wallpaper
Function InstallLivelywallpaper  {
	Write-Output "Installing Lively Wallpaper"
	winget install -e --id rocksdanister.LivelyWallpaper
}

# Uninstall Lively Wallpaper
Function UninstallLivelywallpaper  {
	Write-Output "Uninstalling Lively Wallpaper"
	winget uninstall -e --id rocksdanister.LivelyWallpaper
}

# Install LocalSend
Function InstallLocalsend  {
	Write-Output "Installing LocalSend"
	winget install -e --id LocalSend.LocalSend
}

# Uninstall LocalSend
Function UninstallLocalsend  {
	Write-Output "Uninstalling LocalSend"
	winget uninstall -e --id LocalSend.LocalSend
}

# Install LockHunter
Function InstallLockhunter  {
	Write-Output "Installing LockHunter"
	winget install -e --id CrystalRich.LockHunter
}

# Uninstall LockHunter
Function UninstallLockhunter  {
	Write-Output "Uninstalling LockHunter"
	winget uninstall -e --id CrystalRich.LockHunter
}

# Install Malwarebytes
Function InstallMalwarebytes  {
	Write-Output "Installing Malwarebytes"
	winget install -e --id Malwarebytes.Malwarebytes
}

# Uninstall Malwarebytes
Function UninstallMalwarebytes  {
	Write-Output "Uninstalling Malwarebytes"
	winget uninstall -e --id Malwarebytes.Malwarebytes
}

# Install Meld
Function InstallMeld  {
	Write-Output "Installing Meld"
	winget install -e --id Meld.Meld
}

# Uninstall Meld
Function UninstallMeld  {
	Write-Output "Uninstalling Meld"
	winget uninstall -e --id Meld.Meld
}

# Install Monitorian
Function InstallMonitorian  {
	Write-Output "Installing Monitorian"
	winget install -e --id emoacht.Monitorian
}

# Uninstall Monitorian
Function UninstallMonitorian  {
	Write-Output "Uninstalling Monitorian"
	winget uninstall -e --id emoacht.Monitorian
}

# Install Motrix Download Manager
Function InstallMotrix  {
	Write-Output "Installing Motrix Download Manager"
	winget install -e --id agalwood.Motrix
}

# Uninstall Motrix Download Manager
Function UninstallMotrix  {
	Write-Output "Uninstalling Motrix Download Manager"
	winget uninstall -e --id agalwood.Motrix
}

# Install MSEdgeRedirect
Function InstallMsedgeredirect  {
	Write-Output "Installing MSEdgeRedirect"
	winget install -e --id rcmaehl.MSEdgeRedirect
}

# Uninstall MSEdgeRedirect
Function UninstallMsedgeredirect  {
	Write-Output "Uninstalling MSEdgeRedirect"
	winget uninstall -e --id rcmaehl.MSEdgeRedirect
}

# Install MSI Afterburner
Function InstallMsiafterburner  {
	Write-Output "Installing MSI Afterburner"
	winget install -e --id Guru3D.Afterburner
}

# Uninstall MSI Afterburner
Function UninstallMsiafterburner  {
	Write-Output "Uninstalling MSI Afterburner"
	winget uninstall -e --id Guru3D.Afterburner
}

# Install Borderless Gaming
Function InstallBorderlessGaming  {
	Write-Output "Installing Borderless Gaming"
	winget install -e --id Codeusa.BorderlessGaming
}

# Uninstall Borderless Gaming
Function UninstallBorderlessGaming  {
	Write-Output "Uninstalling Borderless Gaming"
	winget uninstall -e --id Codeusa.BorderlessGaming
}

# Install Compact GUI
Function InstallCompactGUI  {
	Write-Output "Installing Compact GUI"
	winget install -e --id IridiumIO.CompactGUI
}

# Uninstall Compact GUI
Function UninstallCompactGUI  {
	Write-Output "Uninstalling Compact GUI"
	winget uninstall -e --id IridiumIO.CompactGUI
}

# Install ExifCleaner
Function InstallExifCleaner  {
	Write-Output "Installing ExifCleaner"
	winget install -e --id szTheory.exifcleaner
}

# Uninstall ExifCleaner
Function UninstallExifCleaner  {
	Write-Output "Uninstalling ExifCleaner"
	winget uninstall -e --id szTheory.exifcleaner
}

# Install NanaZip
Function InstallNanazip  {
	Write-Output "Installing NanaZip"
	winget install -e --id M2Team.NanaZip
}

# Uninstall NanaZip
Function UninstallNanazip  {
	Write-Output "Uninstalling NanaZip"
	winget uninstall -e --id M2Team.NanaZip
}

# Install Neofetch
Function InstallNeofetchwin  {
	Write-Output "Installing Neofetch"
	winget install -e --id nepnep.neofetch-win
}

# Uninstall Neofetch
Function UninstallNeofetchwin  {
	Write-Output "Uninstalling Neofetch"
	winget uninstall -e --id nepnep.neofetch-win
}

# Install Nextcloud Desktop
Function InstallNextclouddesktop  {
	Write-Output "Installing Nextcloud Desktop"
	winget install -e --id Nextcloud.NextcloudDesktop
}

# Uninstall Nextcloud Desktop
Function UninstallNextclouddesktop  {
	Write-Output "Uninstalling Nextcloud Desktop"
	winget uninstall -e --id Nextcloud.NextcloudDesktop
}

# Install Nushell
Function InstallNushell  {
	Write-Output "Installing Nushell"
	winget install -e --id Nushell.Nushell
}

# Uninstall Nushell
Function UninstallNushell  {
	Write-Output "Uninstalling Nushell"
	winget uninstall -e --id Nushell.Nushell
}

# Install NVCleanstall
Function InstallNvclean  {
	Write-Output "Installing NVCleanstall"
	winget install -e --id TechPowerUp.NVCleanstall
}

# Uninstall NVCleanstall
Function UninstallNvclean  {
	Write-Output "Uninstalling NVCleanstall"
	winget uninstall -e --id TechPowerUp.NVCleanstall
}

# Install OPAutoClicker
Function InstallOPAutoClicker  {
	Write-Output "Installing OPAutoClicker"
	winget install -e --id OPAutoClicker.OPAutoClicker
}

# Uninstall OPAutoClicker
Function UninstallOPAutoClicker  {
	Write-Output "Uninstalling OPAutoClicker"
	winget uninstall -e --id OPAutoClicker.OPAutoClicker
}

# Install OpenHashTab
Function InstallOpenhashtab  {
	Write-Output "Installing OpenHashTab"
	winget install -e --id namazso.OpenHashTab
}

# Uninstall OpenHashTab
Function UninstallOpenhashtab  {
	Write-Output "Uninstalling OpenHashTab"
	winget uninstall -e --id namazso.OpenHashTab
}

# Install OpenRGB
Function InstallOpenrgb  {
	Write-Output "Installing OpenRGB"
	winget install -e --id CalcProgrammer1.OpenRGB
}

# Uninstall OpenRGB
Function UninstallOpenrgb  {
	Write-Output "Uninstalling OpenRGB"
	winget uninstall -e --id CalcProgrammer1.OpenRGB
}

# Install Open Shell (Start Menu)
Function InstallOpenshell  {
	Write-Output "Installing Open Shell (Start Menu)"
	winget install -e --id Open-Shell.Open-Shell-Menu
}

# Uninstall Open Shell (Start Menu)
Function UninstallOpenshell  {
	Write-Output "Uninstalling Open Shell (Start Menu)"
	winget uninstall -e --id Open-Shell.Open-Shell-Menu
}

# Install Oracle VirtualBox
Function InstallOVirtualBox  {
	Write-Output "Installing Oracle VirtualBox"
	winget install -e --id Oracle.VirtualBox
}

# Uninstall Oracle VirtualBox
Function UninstallOVirtualBox  {
	Write-Output "Uninstalling Oracle VirtualBox"
	winget uninstall -e --id Oracle.VirtualBox
}

# Install ownCloud Desktop
Function InstallOwnclouddesktop  {
	Write-Output "Installing ownCloud Desktop"
	winget install -e --id ownCloud.ownCloudDesktop
}

# Uninstall ownCloud Desktop
Function UninstallOwnclouddesktop  {
	Write-Output "Uninstalling ownCloud Desktop"
	winget uninstall -e --id ownCloud.ownCloudDesktop
}

# Install Parsec
Function InstallParsec  {
	Write-Output "Installing Parsec"
	winget install -e --id Parsec.Parsec
}

# Uninstall Parsec
Function UninstallParsec  {
	Write-Output "Uninstalling Parsec"
	winget uninstall -e --id Parsec.Parsec
}

# Install PeaZip
Function InstallPeazip  {
	Write-Output "Installing PeaZip"
	winget install -e --id Giorgiotani.Peazip
}

# Uninstall PeaZip
Function UninstallPeazip  {
	Write-Output "Uninstalling PeaZip"
	winget uninstall -e --id Giorgiotani.Peazip
}

# Install Raspberry Pi Imager
Function InstallPiimager  {
	Write-Output "Installing Raspberry Pi Imager"
	winget install -e --id RaspberryPiFoundation.RaspberryPiImager
}

# Uninstall Raspberry Pi Imager
Function UninstallPiimager  {
	Write-Output "Uninstalling Raspberry Pi Imager"
	winget uninstall -e --id RaspberryPiFoundation.RaspberryPiImager
}

# Install Process Lasso
Function InstallProcesslasso  {
	Write-Output "Installing Process Lasso"
	winget install -e --id BitSum.ProcessLasso
}

# Uninstall Process Lasso
Function UninstallProcesslasso  {
	Write-Output "Uninstalling Process Lasso"
	winget uninstall -e --id BitSum.ProcessLasso
}

# Install OrcaSlicer
Function InstallOrcaslicer  {
	Write-Output "Installing OrcaSlicer"
	winget install -e --id SoftFever.OrcaSlicer
}

# Uninstall OrcaSlicer
Function UninstallOrcaslicer  {
	Write-Output "Uninstalling OrcaSlicer"
	winget uninstall -e --id SoftFever.OrcaSlicer
}

# Install PrusaSlicer
Function InstallPrucaslicer  {
	Write-Output "Installing PrusaSlicer"
	winget install -e --id Prusa3d.PrusaSlicer
}

# Uninstall PrusaSlicer
Function UninstallPrucaslicer  {
	Write-Output "Uninstalling PrusaSlicer"
	winget uninstall -e --id Prusa3d.PrusaSlicer
}

# Install qBittorrent
Function InstallQbittorrent  {
	Write-Output "Installing qBittorrent"
	winget install -e --id qBittorrent.qBittorrent
}

# Uninstall qBittorrent
Function UninstallQbittorrent  {
	Write-Output "Uninstalling qBittorrent"
	winget uninstall -e --id qBittorrent.qBittorrent
}

# Install Transmission
Function InstallTransmission  {
	Write-Output "Installing Transmission"
	winget install -e --id Transmission.Transmission
}

# Uninstall Transmission
Function UninstallTransmission  {
	Write-Output "Uninstalling Transmission"
	winget uninstall -e --id Transmission.Transmission
}

# Install Tixati
Function InstallTixati  {
	Write-Output "Installing Tixati"
	winget install -e --id Tixati.Tixati.Portable
}

# Uninstall Tixati
Function UninstallTixati  {
	Write-Output "Uninstalling Tixati"
	winget uninstall -e --id Tixati.Tixati.Portable
}

# Install Quicklook
Function InstallQuicklook  {
	Write-Output "Installing Quicklook"
	winget install -e --id QL-Win.QuickLook
}

# Uninstall Quicklook
Function UninstallQuicklook  {
	Write-Output "Uninstalling Quicklook"
	winget uninstall -e --id QL-Win.QuickLook
}

# Install Rainmeter
Function InstallRainmeter  {
	Write-Output "Installing Rainmeter"
	winget install -e --id Rainmeter.Rainmeter
}

# Uninstall Rainmeter
Function UninstallRainmeter  {
	Write-Output "Uninstalling Rainmeter"
	winget uninstall -e --id Rainmeter.Rainmeter
}

# Install Revo Uninstaller
Function InstallRevo  {
	Write-Output "Installing Revo Uninstaller"
	winget install -e --id RevoUninstaller.RevoUninstaller
}

# Uninstall Revo Uninstaller
Function UninstallRevo  {
	Write-Output "Uninstalling Revo Uninstaller"
	winget uninstall -e --id RevoUninstaller.RevoUninstaller
}

# Install Wise Program Uninstaller (WiseCleaner)
Function InstallWiseProgramUninstaller  {
	Write-Output "Installing Wise Program Uninstaller (WiseCleaner)"
	winget install -e --id WiseCleaner.WiseProgramUninstaller
}

# Uninstall Wise Program Uninstaller (WiseCleaner)
Function UninstallWiseProgramUninstaller  {
	Write-Output "Uninstalling Wise Program Uninstaller (WiseCleaner)"
	winget uninstall -e --id WiseCleaner.WiseProgramUninstaller
}

# Install Ripgrep
Function InstallRipgrep  {
	Write-Output "Installing Ripgrep"
	winget install -e --id BurntSushi.ripgrep.MSVC
}

# Uninstall Ripgrep
Function UninstallRipgrep  {
	Write-Output "Uninstalling Ripgrep"
	winget uninstall -e --id BurntSushi.ripgrep.MSVC
}

# Install Rufus Imager
Function InstallRufus  {
	Write-Output "Installing Rufus Imager"
	winget install -e --id Rufus.Rufus
}

# Uninstall Rufus Imager
Function UninstallRufus  {
	Write-Output "Uninstalling Rufus Imager"
	winget uninstall -e --id Rufus.Rufus
}

# Install SageThumbs
Function InstallSagethumbs  {
	Write-Output "Installing SageThumbs"
	winget install -e --id CherubicSoftware.SageThumbs
}

# Uninstall SageThumbs
Function UninstallSagethumbs  {
	Write-Output "Uninstalling SageThumbs"
	winget uninstall -e --id CherubicSoftware.SageThumbs
}

# Install Samsung Magician
Function InstallSamsungmagician  {
	Write-Output "Installing Samsung Magician"
	winget install -e --id Samsung.SamsungMagician
}

# Uninstall Samsung Magician
Function UninstallSamsungmagician  {
	Write-Output "Uninstalling Samsung Magician"
	winget uninstall -e --id Samsung.SamsungMagician
}

# Install Sandboxie Plus
Function InstallSandboxie  {
	Write-Output "Installing Sandboxie Plus"
	winget install -e --id Sandboxie.Plus
}

# Uninstall Sandboxie Plus
Function UninstallSandboxie  {
	Write-Output "Uninstalling Sandboxie Plus"
	winget uninstall -e --id Sandboxie.Plus
}

# Install Snappy Driver Installer Origin
Function InstallSdio  {
	Write-Output "Installing Snappy Driver Installer Origin"
	winget install -e --id GlennDelahoy.SnappyDriverInstallerOrigin
}

# Uninstall Snappy Driver Installer Origin
Function UninstallSdio  {
	Write-Output "Uninstalling Snappy Driver Installer Origin"
	winget uninstall -e --id GlennDelahoy.SnappyDriverInstallerOrigin
}

# Install Nilesoft Shell
Function InstallNilesoftShell  {
	Write-Output "Installing Nilesoft Shell"
	winget install -e --id Nilesoft.Shell
}

# Uninstall Nilesoft Shell
Function UninstallNilesoftShell  {
	Write-Output "Uninstalling Nilesoft Shell"
	winget uninstall -e --id Nilesoft.Shell
}

# Install SignalRGB
Function InstallSignalrgb  {
	Write-Output "Installing SignalRGB"
	winget install -e --id WhirlwindFX.SignalRgb
}

# Uninstall SignalRGB
Function UninstallSignalrgb  {
	Write-Output "Uninstalling SignalRGB"
	winget uninstall -e --id WhirlwindFX.SignalRgb
}

# Install Spacedrive File Manager
Function InstallSpacedrive  {
	Write-Output "Installing Spacedrive File Manager"
	winget install -e --id spacedrive.Spacedrive
}

# Uninstall Spacedrive File Manager
Function UninstallSpacedrive  {
	Write-Output "Uninstalling Spacedrive File Manager"
	winget uninstall -e --id spacedrive.Spacedrive
}

# Install SpaceSniffer
Function InstallSpacesniffer  {
	Write-Output "Installing SpaceSniffer"
	winget install -e --id UderzoSoftware.SpaceSniffer
}

# Uninstall SpaceSniffer
Function UninstallSpacesniffer  {
	Write-Output "Uninstalling SpaceSniffer"
	winget uninstall -e --id UderzoSoftware.SpaceSniffer
}

# Install SuperF4
Function InstallSuperf4  {
	Write-Output "Installing SuperF4"
	winget install -e --id StefanSundin.Superf4
}

# Uninstall SuperF4
Function UninstallSuperf4  {
	Write-Output "Uninstalling SuperF4"
	winget uninstall -e --id StefanSundin.Superf4
}

# Install SyncTrayzor
Function InstallSynctrayzor  {
	Write-Output "Installing SyncTrayzor"
	winget install -e --id SyncTrayzor.SyncTrayzor
}

# Uninstall SyncTrayzor
Function UninstallSynctrayzor  {
	Write-Output "Uninstalling SyncTrayzor"
	winget uninstall -e --id SyncTrayzor.SyncTrayzor
}

# Install Tabby.sh
Function InstallTabby  {
	Write-Output "Installing Tabby.sh"
	winget install -e --id Eugeny.Tabby
}

# Uninstall Tabby.sh
Function UninstallTabby  {
	Write-Output "Uninstalling Tabby.sh"
	winget uninstall -e --id Eugeny.Tabby
}

# Install Tailscale
Function InstallTailscale  {
	Write-Output "Installing Tailscale"
	winget install -e --id tailscale.tailscale
}

# Uninstall Tailscale
Function UninstallTailscale  {
	Write-Output "Uninstalling Tailscale"
	winget uninstall -e --id tailscale.tailscale
}

# Install TeamViewer
Function InstallTeamviewer  {
	Write-Output "Installing TeamViewer"
	winget install -e --id TeamViewer.TeamViewer
}

# Uninstall TeamViewer
Function UninstallTeamviewer  {
	Write-Output "Uninstalling TeamViewer"
	winget uninstall -e --id TeamViewer.TeamViewer
}

# Install Total Commander
Function InstallTotalcommander  {
	Write-Output "Installing Total Commander"
	winget install -e --id Ghisler.TotalCommander
}

# Uninstall Total Commander
Function UninstallTotalcommander  {
	Write-Output "Uninstalling Total Commander"
	winget uninstall -e --id Ghisler.TotalCommander
}

# Install TreeSize Free
Function InstallTreesize  {
	Write-Output "Installing TreeSize Free"
	winget install -e --id JAMSoftware.TreeSize.Free
}

# Uninstall TreeSize Free
Function UninstallTreesize  {
	Write-Output "Uninstalling TreeSize Free"
	winget uninstall -e --id JAMSoftware.TreeSize.Free
}

# Install Translucent Taskbar
Function InstallTtaskbar  {
	Write-Output "Installing Translucent Taskbar"
	winget install -e --id 9PF4KZ2VN4W9
}

# Uninstall Translucent Taskbar
Function UninstallTtaskbar  {
	Write-Output "Uninstalling Translucent Taskbar"
	winget uninstall -e --id 9PF4KZ2VN4W9
}

# Install Twinkle Tray
Function InstallTwinkletray  {
	Write-Output "Installing Twinkle Tray"
	winget install -e --id xanderfrangos.twinkletray
}

# Uninstall Twinkle Tray
Function UninstallTwinkletray  {
	Write-Output "Uninstalling Twinkle Tray"
	winget uninstall -e --id xanderfrangos.twinkletray
}

# Install Wazuh.
Function InstallWazuh  {
	Write-Output "Installing Wazuh."
	winget install -e --id Wazuh.WazuhAgent
}

# Uninstall Wazuh.
Function UninstallWazuh  {
	Write-Output "Uninstalling Wazuh."
	winget uninstall -e --id Wazuh.WazuhAgent
}

# Install Windows PC Health Check
Function InstallWindowspchealth  {
	Write-Output "Installing Windows PC Health Check"
	winget install -e --id Microsoft.WindowsPCHealthCheck
}

# Uninstall Windows PC Health Check
Function UninstallWindowspchealth  {
	Write-Output "Uninstalling Windows PC Health Check"
	winget uninstall -e --id Microsoft.WindowsPCHealthCheck
}

# Install WindowGrid
Function InstallWindowGrid  {
	Write-Output "Installing WindowGrid"
	winget install -e --id na
}

# Uninstall WindowGrid
Function UninstallWindowGrid  {
	Write-Output "Uninstalling WindowGrid"
	winget uninstall -e --id na
}

# Install UniGetUI
Function InstallWingetui  {
	Write-Output "Installing UniGetUI"
	winget install -e --id SomePythonThings.WingetUIStore
}

# Uninstall UniGetUI
Function UninstallWingetui  {
	Write-Output "Uninstalling UniGetUI"
	winget uninstall -e --id SomePythonThings.WingetUIStore
}

# Install WinPaletter
Function InstallWinpaletter  {
	Write-Output "Installing WinPaletter"
	winget install -e --id Abdelrhman-AK.WinPaletter
}

# Uninstall WinPaletter
Function UninstallWinpaletter  {
	Write-Output "Uninstalling WinPaletter"
	winget uninstall -e --id Abdelrhman-AK.WinPaletter
}

# Install WinRAR
Function InstallWinrar  {
	Write-Output "Installing WinRAR"
	winget install -e --id RARLab.WinRAR
}

# Uninstall WinRAR
Function UninstallWinrar  {
	Write-Output "Uninstalling WinRAR"
	winget uninstall -e --id RARLab.WinRAR
}

# Install WiseToys
Function InstallWisetoys  {
	Write-Output "Installing WiseToys"
	winget install -e --id WiseCleaner.WiseToys
}

# Uninstall WiseToys
Function UninstallWisetoys  {
	Write-Output "Uninstalling WiseToys"
	winget uninstall -e --id WiseCleaner.WiseToys
}

# Install TeraCopy
Function InstallTeraCopy  {
	Write-Output "Installing TeraCopy"
	winget install -e --id CodeSector.TeraCopy
}

# Uninstall TeraCopy
Function UninstallTeraCopy  {
	Write-Output "Uninstalling TeraCopy"
	winget uninstall -e --id CodeSector.TeraCopy
}

# Install WizFile
Function InstallWizfile  {
	Write-Output "Installing WizFile"
	winget install -e --id AntibodySoftware.WizFile
}

# Uninstall WizFile
Function UninstallWizfile  {
	Write-Output "Uninstalling WizFile"
	winget uninstall -e --id AntibodySoftware.WizFile
}

# Install WizTree
Function InstallWiztree  {
	Write-Output "Installing WizTree"
	winget install -e --id AntibodySoftware.WizTree
}

# Uninstall WizTree
Function UninstallWiztree  {
	Write-Output "Uninstalling WizTree"
	winget uninstall -e --id AntibodySoftware.WizTree
}

# Install Xtreme Download Manager
Function InstallXdm  {
	Write-Output "Installing Xtreme Download Manager"
	winget install -e --id subhra74.XtremeDownloadManager
}

# Uninstall Xtreme Download Manager
Function UninstallXdm  {
	Write-Output "Uninstalling Xtreme Download Manager"
	winget uninstall -e --id subhra74.XtremeDownloadManager
}

# Install HxD Hex Editor
Function InstallXeheditor  {
	Write-Output "Installing HxD Hex Editor"
	winget install -e --id MHNexus.HxD
}

# Uninstall HxD Hex Editor
Function UninstallXeheditor  {
	Write-Output "Uninstalling HxD Hex Editor"
	winget uninstall -e --id MHNexus.HxD
}

# Install XnView classic
Function InstallXnview  {
	Write-Output "Installing XnView classic"
	winget install -e --id XnSoft.XnView.Classic
}

# Uninstall XnView classic
Function UninstallXnview  {
	Write-Output "Uninstalling XnView classic"
	winget uninstall -e --id XnSoft.XnView.Classic
}

# Install ZeroTier One
Function InstallZerotierone  {
	Write-Output "Installing ZeroTier One"
	winget install -e --id ZeroTier.ZeroTierOne
}

# Uninstall ZeroTier One
Function UninstallZerotierone  {
	Write-Output "Uninstalling ZeroTier One"
	winget uninstall -e --id ZeroTier.ZeroTierOne
}

# Install ZoomIt
Function InstallZoomit  {
	Write-Output "Installing ZoomIt"
	winget install -e --id Microsoft.Sysinternals.ZoomIt
}

# Uninstall ZoomIt
Function UninstallZoomit  {
	Write-Output "Uninstalling ZoomIt"
	winget uninstall -e --id Microsoft.Sysinternals.ZoomIt
}

# Install Zoxide
Function InstallZoxide  {
	Write-Output "Installing Zoxide"
	winget install -e --id ajeetdsouza.zoxide
}

# Uninstall Zoxide
Function UninstallZoxide  {
	Write-Output "Uninstalling Zoxide"
	winget uninstall -e --id ajeetdsouza.zoxide
}

# Install Syncthingtray
Function InstallSyncthingtray  {
	Write-Output "Installing Syncthingtray"
	winget install -e --id Martchus.syncthingtray
}

# Uninstall Syncthingtray
Function UninstallSyncthingtray  {
	Write-Output "Uninstalling Syncthingtray"
	winget uninstall -e --id Martchus.syncthingtray
}

# Install Intel-PresentMon
Function InstallIntelpresentmon  {
	Write-Output "Installing Intel-PresentMon"
	winget install -e --id Intel.PresentMon.Beta
}

# Uninstall Intel-PresentMon
Function UninstallIntelpresentmon  {
	Write-Output "Uninstalling Intel-PresentMon"
	winget uninstall -e --id Intel.PresentMon.Beta
}

# Install TightVNC
Function InstallTightvnc  {
	Write-Output "Installing TightVNC"
	winget install -e --id GlavSoft.TightVNC
}

# Uninstall TightVNC
Function UninstallTightvnc  {
	Write-Output "Uninstalling TightVNC"
	winget uninstall -e --id GlavSoft.TightVNC
}

# Install UltraVNC
Function InstallUltravnc  {
	Write-Output "Installing UltraVNC"
	winget install -e --id uvncbvba.UltraVnc
}

# Uninstall UltraVNC
Function UninstallUltravnc  {
	Write-Output "Uninstalling UltraVNC"
	winget uninstall -e --id uvncbvba.UltraVnc
}

# Install Windows Firewall Control
Function InstallWindowsfirewallcontrol  {
	Write-Output "Installing Windows Firewall Control"
	winget install -e --id BiniSoft.WindowsFirewallControl
}

# Uninstall Windows Firewall Control
Function UninstallWindowsfirewallcontrol  {
	Write-Output "Uninstalling Windows Firewall Control"
	winget uninstall -e --id BiniSoft.WindowsFirewallControl
}

# Install VistaSwitcher
Function InstallVistaswitcher  {
	Write-Output "Installing VistaSwitcher"
	winget install -e --id ntwind.VistaSwitcher
}

# Uninstall VistaSwitcher
Function UninstallVistaswitcher  {
	Write-Output "Uninstalling VistaSwitcher"
	winget uninstall -e --id ntwind.VistaSwitcher
}

# Install Windows Auto Dark Mode
Function InstallAutodarkmode  {
	Write-Output "Installing Windows Auto Dark Mode"
	winget install -e --id Armin2208.WindowsAutoNightMode
}

# Uninstall Windows Auto Dark Mode
Function UninstallAutodarkmode  {
	Write-Output "Uninstalling Windows Auto Dark Mode"
	winget uninstall -e --id Armin2208.WindowsAutoNightMode
}

# Install Ambie White Noise
Function InstallAmbieWhiteNoise  {
	Write-Output "Installing Ambie White Noise"
	winget install -e --id 9P07XNM5CHP0
}

# Uninstall Ambie White Noise
Function UninstallAmbieWhiteNoise  {
	Write-Output "Uninstalling Ambie White Noise"
	winget uninstall -e --id 9P07XNM5CHP0
}

# Install Magic Wormhole
Function InstallMagicwormhole  {
	Write-Output "Installing Magic Wormhole"
	winget install -e --id magic-wormhole.magic-wormhole
}

# Uninstall Magic Wormhole
Function UninstallMagicwormhole  {
	Write-Output "Uninstalling Magic Wormhole"
	winget uninstall -e --id magic-wormhole.magic-wormhole
}

# Install croc
Function InstallCroc  {
	Write-Output "Installing croc"
	winget install -e --id schollz.croc
}

# Uninstall croc
Function UninstallCroc  {
	Write-Output "Uninstalling croc"
	winget uninstall -e --id schollz.croc
}

# Install GlazeWM
Function InstallGlazewm  {
	Write-Output "Installing GlazeWM"
	winget install -e --id glzr-io.glazewm
}

# Uninstall GlazeWM
Function UninstallGlazewm  {
	Write-Output "Uninstalling GlazeWM"
	winget uninstall -e --id glzr-io.glazewm
}

# Install FanControl
Function InstallFancontrol  {
	Write-Output "Installing FanControl"
	winget install -e --id Rem0o.FanControl
}

# Uninstall FanControl
Function UninstallFancontrol  {
	Write-Output "Uninstalling FanControl"
	winget uninstall -e --id Rem0o.FanControl
}

# Install Windhawk
Function InstallWindhawk  {
	Write-Output "Installing Windhawk"
	winget install -e --id RamenSoftware.Windhawk
}

# Uninstall Windhawk
Function UninstallWindhawk  {
	Write-Output "Uninstalling Windhawk"
	winget uninstall -e --id RamenSoftware.Windhawk
}

# Install ForceAutoHDR
Function InstallForceAutoHDR  {
	Write-Output "Installing ForceAutoHDR"
	winget install -e --id ForceAutoHDR.7gxycn08
}

# Uninstall ForceAutoHDR
Function UninstallForceAutoHDR  {
	Write-Output "Uninstalling ForceAutoHDR"
	winget uninstall -e --id ForceAutoHDR.7gxycn08
}

# Install JoyToKey
Function InstallJoyToKey  {
	Write-Output "Installing JoyToKey"
	winget install -e --id JTKsoftware.JoyToKey
}

# Uninstall JoyToKey
Function UninstallJoyToKey  {
	Write-Output "Uninstalling JoyToKey"
	winget uninstall -e --id JTKsoftware.JoyToKey
}

# Install Format Factory
Function InstallFormatFactory  {
	Write-Output "Installing Format Factory"
	winget install -e --id na
}

# Uninstall Format Factory
Function UninstallFormatFactory  {
	Write-Output "Uninstalling Format Factory"
	winget uninstall -e --id na
}

# Install Dropbox
Function InstallDropox  {
	Write-Output "Installing Dropbox"
	winget install -e --id Dropbox.Dropbox
}

# Uninstall Dropbox
Function UninstallDropox  {
	Write-Output "Uninstalling Dropbox"
	winget uninstall -e --id Dropbox.Dropbox
}

# Install OFGB (Oh Frick Go Back)
Function InstallOFGB  {
	Write-Output "Installing OFGB (Oh Frick Go Back)"
	winget install -e --id xM4ddy.OFGB
}

# Uninstall OFGB (Oh Frick Go Back)
Function UninstallOFGB  {
	Write-Output "Uninstalling OFGB (Oh Frick Go Back)"
	winget uninstall -e --id xM4ddy.OFGB
}

# Install Lenovo Legion Toolkit
Function InstallLenovoLegionToolkit  {
	Write-Output "Installing Lenovo Legion Toolkit"
	winget install -e --id BartoszCichecki.LenovoLegionToolkit
}

# Uninstall Lenovo Legion Toolkit
Function UninstallLenovoLegionToolkit  {
	Write-Output "Uninstalling Lenovo Legion Toolkit"
	winget uninstall -e --id BartoszCichecki.LenovoLegionToolkit
}

#endregion Third



#region Windows Apps

# Uninstall Microsoft Edge
Function UninstallMicrosoftEdge {
	Write-Output "Trying to uninstall Microsoft Edge"
	winget uninstall -e --id Microsoft.Edge
}

# Install Microsoft Edge
Function InstallMicrosoftEdge {
	Write-Output "Trying to install Microsoft Edge"
	winget install -e --id Microsoft.Edge
}

# Uninstall Cortana
Function UninstallCortana {
	Write-Output "Trying to uninstall Cortana"
	winget uninstall "Cortana"
}

# Install Cortana
Function InstallCortana {
	Write-Output "Trying to install Cortana"
	winget install "Cortana"
}

# Uninstall MSNWeather
Function UninstallMSNWeather {
	Write-Output "Trying to uninstall MSN Weather"
	winget uninstall "MSN Weather"
}

# Install MSNWeather
Function InstallMSNWeather {
	Write-Output "Trying to install MSN Weather"
	winget install "MSN Weather"
}

# Uninstall Get Help
Function UninstallGetHelp {
	Write-Output "Trying to uninstall Get Help"	
	winget uninstall "Get Help"	
}

# Install Get Help
Function InstallGetHelp {
	Write-Output "Trying to install Get Help"	
	winget install "Get Help"	
}

# Uninstall Microsoft Tips
Function UninstallMicrosoftTips {
	Write-Output "Trying to uninstall Microsoft Tips"	
	winget uninstall "Microsoft Tips"	
}

# Install Microsoft Tips
Function InstallMicrosoftTips {
	Write-Output "Trying to install Microsoft Tips"	
	winget install "Microsoft Tips"	
}

# Uninstall HEIF Image Extensions
Function UninstallHEIFImageExtensions {
	Write-Output "Trying to uninstall HEIF Image Extensions"
	winget uninstall "HEIF Image Extensions"	
}

# Install HEIF Image Extensions
Function InstallHEIFImageExtensions {
	Write-Output "Trying to install HEIF Image Extensions"
	winget install "HEIF Image Extensions"	
}

# Uninstall Paint 3D
Function UninstallPaint3D {
	Write-Output "Trying to uninstall Paint 3D"	
	winget uninstall "Paint 3D"	
}

# Install Paint 3D
Function InstallPaint3D {
	Write-Output "Trying to install Paint 3D"	
	winget install "Paint 3D"	
}

# Uninstall 3D Viewer
Function Uninstall3DViewer {
	Write-Output "Trying to uninstall 3D Viewer"	
	winget uninstall "3D Viewer"	
}

# Install 3D Viewer
Function Install3DViewer {
	Write-Output "Trying to install 3D Viewer"	
	winget install "3D Viewer"	
}

# Uninstall Office
Function UninstallOffice {
	Write-Output "Trying to uninstall Office"
	winget uninstall "Office"	
}

# Install Office
Function InstallOffice {
	Write-Output "Trying to install Office"
	winget install "Office"	
}

# Uninstall Microsoft Solitaire Collection
Function UninstallMicrosoftSolitaireCollection {
	Write-Output "Trying to uninstall Microsoft Solitaire Collection"	
	winget uninstall "Microsoft Solitaire Collection"
}

# Install Microsoft Solitaire Collection
Function InstallMicrosoftSolitaireCollection {
	Write-Output "Trying to install Microsoft Solitaire Collection"	
	winget install "Microsoft Solitaire Collection"
}

# Uninstall Microsoft Sticky Notes
Function UninstallMicrosoftStickyNotes {
	Write-Output "Trying to uninstall Microsoft Sticky Notes"	
	winget uninstall "Microsoft Sticky Notes"
}

# Install Microsoft Sticky Notes
Function InstallMicrosoftStickyNotes {
	Write-Output "Trying to install Microsoft Sticky Notes"	
	winget install "Microsoft Sticky Notes"
}

# Uninstall Mixed Reality Portal
Function UninstallMixedRealityPortal {
	Write-Output "Trying to uninstall Mixed Reality Portal"	
	winget uninstall "Mixed Reality Portal"	
}

# Install Mixed Reality Portal
Function InstallMixedRealityPortal {
	Write-Output "Trying to install Mixed Reality Portal"	
	winget install "Mixed Reality Portal"	
}

# Uninstall OneNote
Function UninstallOneNote {
	Write-Output "Trying to uninstall OneNote"	
	winget uninstall "OneNote for Windows 10"
}

# Install OneNote
Function InstallOneNote {
	Write-Output "Trying to install OneNote"	
	winget install "OneNote"
}

# Uninstall Microsoft People
Function UninstallMicrosoftPeople {
	Write-Output "Trying to uninstall Microsoft People"
	winget uninstall "Microsoft People"
}

# Install Microsoft People
Function InstallMicrosoftPeople {
	Write-Output "Trying to install Microsoft People"
	winget install "Microsoft People"
}

# Uninstall Snip & Sketch
Function UninstallSnipSketch {
	Write-Output "Trying to uninstall Snip & Sketch"	
	winget uninstall "Snip & Sketch"	
}

# Install Snip & Sketch
Function InstallSnipSketch {
	Write-Output "Trying to install Snip & Sketch"	
	winget install "Snip & Sketch"	
}

# Uninstall Skype
Function UninstallSkype {
	Write-Output "Trying to uninstall Skype"	
	winget uninstall "Skype"
}

# Install Skype
Function InstallSkype {
	Write-Output "Trying to install Skype"	
	winget install "Skype"
}

# Uninstall Store Experience Host
Function UninstallStoreExperienceHost {
	Write-Output "Trying to uninstall Store Experience Host"
	winget uninstall "Store Experience Host"	
}

# Install Store Experience Host
Function InstallStoreExperienceHost {
	Write-Output "Trying to install Store Experience Host"
	winget install "Store Experience Host"	
}

# Uninstall VP9 Video Extensions
Function UninstallVP9VideoExtensions {
	Write-Output "Trying to uninstall VP9 Video Extensions"	
	winget uninstall "VP9 Video Extensions"
}

# Install VP9 Video Extensions
Function InstallVP9VideoExtensions {
	Write-Output "Trying to install VP9 Video Extensions"	
	winget install "VP9 Video Extensions"
}

# Uninstall Microsoft Pay
Function UninstallMicrosoftPay {
	Write-Output "Trying to uninstall Microsoft Pay"
	winget uninstall "Microsoft Pay"	
}

# Install Microsoft Pay
Function InstallMicrosoftPay {
	Write-Output "Trying to install Microsoft Pay"
	winget install "Microsoft Pay"	
}

# Uninstall Web Media Extensions
Function UninstallWebMediaExtensions {
	Write-Output "Trying to uninstall Web Media Extensions"
	winget uninstall "Web Media Extensions"	
}

# Install Web Media Extensions
Function InstallWebMediaExtensions {
	Write-Output "Trying to install Web Media Extensions"
	winget install "Web Media Extensions"	
}

# Uninstall Webp Image Extensions
Function UninstallWebpImageExtensions {
	Write-Output "Trying to uninstall Webp Image Extensions"
	winget uninstall "Webp Image Extensions"	
}

# Install Webp Image Extensions
Function InstallWebpImageExtensions {
	Write-Output "Trying to install Webp Image Extensions"
	winget install "Webp Image Extensions"	
}

# Uninstall Microsoft Photos
Function UninstallMicrosoftPhotos {
	Write-Output "Trying to uninstall Microsoft Photos"
	winget uninstall "Microsoft Photos"	
}

# Install Microsoft Photos
Function InstallMicrosoftPhotos {
	Write-Output "Trying to install Microsoft Photos"
	winget install "Microsoft Photos"	
}

# Uninstall Windows Clock
Function UninstallWindowsClock {
	Write-Output "Trying to uninstall Windows Clock"
	winget uninstall "Windows Clock"
}

# Install Windows Clock
Function InstallWindowsClock {
	Write-Output "Trying to install Windows Clock"
	winget install "Windows Clock"
}

# Uninstall Windows Calculator
Function UninstallWindowsCalculator {
	Write-Output "Trying to uninstall Windows Calculator"
	winget uninstall "Windows Calculator"
}

# Install Windows Calculator
Function InstallWindowsCalculator {
	Write-Output "Trying to install Windows Calculator"
	winget install "Windows Calculator"
}

# Uninstall Windows Camera
Function UninstallWindowsCamera {
	Write-Output "Trying to uninstall Windows Camera"
	winget uninstall "Windows Camera"
}

# Install Windows Camera
Function InstallWindowsCamera {
	Write-Output "Trying to install Windows Camera"
	winget install "Windows Camera"
}

# Uninstall Feedback Hub
Function UninstallFeedbackHub {
	Write-Output "Trying to uninstall Feedback Hub"
	winget uninstall "Feedback Hub"	
}

# Install Feedback Hub
Function InstallFeedbackHub {
	Write-Output "Trying to install Feedback Hub"
	winget install "Feedback Hub"	
}

# Uninstall Windows Maps
Function UninstallWindowsMaps {
	Write-Output "Trying to uninstall Windows Maps"
	winget uninstall "Windows Maps"	
}

# Install Windows Maps
Function InstallWindowsMaps {
	Write-Output "Trying to install Windows Maps"
	winget install "Windows Maps"	
}

# Uninstall Windows Voice Recorder
Function UninstallWindowsVoiceRecorder {
	Write-Output "Trying to uninstall Windows Voice Recorder"	
	winget uninstall "Windows Voice Recorder"	
}

# Install Windows Voice Recorder
Function InstallWindowsVoiceRecorder {
	Write-Output "Trying to install Windows Voice Recorder"	
	winget install "Windows Voice Recorder"	
}

# Uninstall Xbox
Function UninstallXbox {
	Write-Output "Trying to uninstall Xbox"
	winget uninstall "Xbox"	
}

# Install Xbox
Function InstallXbox {
	Write-Output "Trying to install Xbox"
	winget install "Xbox"	
}

# Uninstall Xbox TCUI
Function UninstallXboxTCUI {
	Write-Output "Trying to uninstall Xbox TCUI"
	winget uninstall "Xbox TCUI"	
}

# Install Xbox TCUI
Function InstallXboxTCUI {
	Write-Output "Trying to install Xbox TCUI"
	winget install "Xbox TCUI"	
}

# Uninstall Xbox Game Bar Plugin
Function UninstallXboxGameBarPlugin {
	Write-Output "Trying to uninstall Xbox Game Bar Plugin"
	winget uninstall "Xbox Game Bar Plugin"
}

# Install Xbox Game Bar Plugin
Function InstallXboxGameBarPlugin {
	Write-Output "Trying to install Xbox Game Bar Plugin"
	winget install "Xbox Game Bar Plugin"
}

# Uninstall Xbox Game Bar
Function UninstallXboxGameBar {
	Write-Output "Trying to uninstall Xbox Game Bar"
	winget uninstall "Xbox Game Bar"	
}

# Install Xbox Game Bar
Function InstallXboxGameBar {
	Write-Output "Trying to install Xbox Game Bar"
	winget install "Xbox Game Bar"	
}

# Uninstall Xbox Identity Provider
Function UninstallXboxIdentityProvider {
	Write-Output "Trying to uninstall Xbox Identity Provider"
	winget uninstall "Xbox Identity Provider"
}

# Install Xbox Identity Provider
Function InstallXboxIdentityProvider {
	Write-Output "Trying to install Xbox Identity Provider"
	winget install "Xbox Identity Provider"
}

# Uninstall Xbox Game Speech Window
Function UninstallXboxGameSpeechWindow {
	Write-Output "Trying to uninstall Xbox Game Speech Window"
	winget uninstall "Xbox Game Speech Window"	
}

# Install Xbox Game Speech Window
Function InstallXboxGameSpeechWindow {
	Write-Output "Trying to install Xbox Game Speech Window"
	winget install "Xbox Game Speech Window"	
}

# Uninstall Phone Link
Function UninstallPhoneLink {
	Write-Output "Trying to uninstall Phone Link"
	winget uninstall "Phone Link"
}

# Install Phone Link
Function InstallPhoneLink {
	Write-Output "Trying to install Phone Link"
	winget install "Phone Link"
}

# Uninstall Groove Music
Function UninstallGrooveMusic {
	Write-Output "Trying to uninstall Groove Music"
	winget uninstall "Groove Music"	
}

# Install Groove Music
Function InstallGrooveMusic {
	Write-Output "Trying to install Groove Music"
	winget install "Groove Music"	
}

# Uninstall Movies & TV
Function UninstallMoviesTV {
	Write-Output "Trying to uninstall Movies & TV"
	winget uninstall "Movies & TV"	
}

# Install Movies & TV
Function InstallMoviesTV {
	Write-Output "Trying to install Movies & TV"
	winget install "Movies & TV"	
}

# Uninstall Mail and Calendar
Function UninstallMailCalendar {
	Write-Output "Trying to uninstall Mail and Calendar"
	winget uninstall "Mail and Calendar"	
}

# Install Mail and Calendar
Function InstallMailCalendar {
	Write-Output "Trying to install Mail and Calendar"
	winget install "Mail and Calendar"	
}

# Uninstall Microsoft Store
Function UninstallMicrosoftStore {
	Write-Output "Trying to uninstall Microsoft Store"
	winget uninstall "Microsoft Store"
}

# Install Microsoft Store
Function InstallMicrosoftStore {
	Write-Output "Trying to install Microsoft Store"
	winget install "Microsoft Store"
}

#endregion Windows Apps


#region Privacy & Telemetry

# Enable the "Connected User Experiences and Telemetry" service (DiagTrack), and allow the connection for the Unified Telemetry Client Outbound Traffic (default value)
Function EnableDiagTrackService {
	Write-Output "Enabling DiagTrack Service ..."
	# Connected User Experiences and Telemetry
	Get-Service -Name DiagTrack -ErrorAction Ignore | Set-Service -StartupType Automatic
	Get-Service -Name DiagTrack -ErrorAction Ignore | Start-Service

	# Allow connection for the Unified Telemetry Client Outbound Traffic
	Get-NetFirewallRule -Group DiagTrack -ErrorAction Ignore | Set-NetFirewallRule -Enabled True -Action Allow
}

# Disable the "Connected User Experiences and Telemetry" service (DiagTrack), and block the connection for the Unified Telemetry Client Outbound Traffic. Disabling the "Connected User Experiences and Telemetry" service (DiagTrack) can cause you not being able to get Xbox achievements anymore and affects Feedback Hub.
Function DisableDiagTrackService {
	Write-Output "Disabling DiagTrack Service ..."
	# Connected User Experiences and Telemetry
	Get-Service -Name DiagTrack -ErrorAction Ignore | Stop-Service -Force
	Get-Service -Name DiagTrack -ErrorAction Ignore | Set-Service -StartupType Disabled

	# Block connection for the Unified Telemetry Client Outbound Traffic
	Get-NetFirewallRule -Group DiagTrack -ErrorAction Ignore | Set-NetFirewallRule -Enabled True -Action Block
}

#

# Set the diagnostic data collection to minimum
Function MinimalDiagnosticDataLevel {
	Write-Output "Setting Minimal Diagnostic Data Level ..."
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection))
	{
		New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Force
	}

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Force
	}

	$EditionID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").EditionID
	if (($EditionID -match "Enterprise") -or ($EditionID -match "Education"))
	{
		# Security level
		New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 0 -Force
		Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 0
	}
	else
	{
		# Required diagnostic data
		New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 1 -Force
		Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 1
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name ShowedToastAtLevel -PropertyType DWord -Value 1 -Force

	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 0
}

# Set the diagnostic data collection to default (default value)
Function DefaultDiagnosticDataLevel {
	Write-Output "Setting Default Diagnostic Data Level ..."
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection))
	{
		New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Force
	}

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Force
	}
	# Optional diagnostic data
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 3 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name ShowedToastAtLevel -PropertyType DWord -Value 3 -Force
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Force -ErrorAction Ignore

	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DELETE
}

#

# Turn off the Windows Error Reporting
Function DisableErrorReporting {
	Write-Output "Disabling Error Reporting ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting", "HKCU:\Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type DELETE
	Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type DELETE
	Get-ScheduledTask -TaskName QueueReporting -ErrorAction Ignore | Disable-ScheduledTask
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Windows Error Reporting" -Name Disabled -PropertyType DWord -Value 1 -Force

	Get-Service -Name WerSvc | Stop-Service -Force
	Get-Service -Name WerSvc | Set-Service -StartupType Disabled
}

# Turn on the Windows Error Reporting (default value)
Function EnableErrorReporting {
	Write-Output "Enabling Error Reporting ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting", "HKCU:\Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type DELETE
	Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type DELETE
	Get-ScheduledTask -TaskName QueueReporting -ErrorAction Ignore | Enable-ScheduledTask
	Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Force -ErrorAction Ignore

	Get-Service -Name WerSvc | Set-Service -StartupType Manual
	Get-Service -Name WerSvc | Start-Service
}

#

# Change the feedback frequency to "Never"
Function NeverFeedbackFrequency {
	Write-Output "Setting Never Feedback Frequency ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Siuf\Rules))
	{
		New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -Force

	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore
}

# Change the feedback frequency to "Automatically" (default value)
Function AutomaticallyFeedbackFrequency {
	Write-Output "Setting Automatically Feedback Frequency ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name DoNotShowFeedbackNotifications -Type DELETE
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name PeriodInNanoSeconds, NumberOfSIUFInPeriod -Force -ErrorAction Ignore
}

#

# Do not use sign-in info to automatically finish setting up device and reopen apps after an update or restart
Function DisableSigninInfo {
	Write-Output "Disabling Signin Info ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name DisableAutomaticRestartSignOn -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name DisableAutomaticRestartSignOn -Type DELETE
	$SID = (Get-CimInstance -ClassName Win32_UserAccount | Where-Object -FilterScript {$_.Name -eq $env:USERNAME}).SID
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$SID"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$SID" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$SID" -Name OptOut -PropertyType DWord -Value 1 -Force
}

# Use sign-in info to automatically finish setting up device and reopen apps after an update or restart (default value)
Function EnableSigninInfo {
	Write-Output "Enabling Signin Info ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name DisableAutomaticRestartSignOn -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name DisableAutomaticRestartSignOn -Type DELETE
	$SID = (Get-CimInstance -ClassName Win32_UserAccount | Where-Object -FilterScript {$_.Name -eq $env:USERNAME}).SID
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\$SID" -Name OptOut -Force -ErrorAction Ignore
}

#

# Do not let websites provide locally relevant content by accessing language list
Function DisableLanguageListAccess {
	Write-Output "Disabling Language List Access ..."
	New-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name HttpAcceptLanguageOptOut -PropertyType DWord -Value 1 -Force
}

# Let websites provide locally relevant content by accessing language list (default value)
Function EnableLanguageListAccess {
	Write-Output "Enabling Language List Access ..."
	Remove-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name HttpAcceptLanguageOptOut -Force -ErrorAction Ignore
}

#

# Do not allow apps to use advertising ID to make ads more interresting to you based on your app usage
Function DisableAdvertisingID {
	Write-Output "Disabling Advertising ID ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -Name DisabledByGroupPolicy -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -Name DisabledByGroupPolicy -Type DELETE

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -PropertyType DWord -Value 0 -Force
}

# Let apps use advertising ID to make ads more interresting to you based on your app usage (default value)
Function EnableAdvertisingID {
	Write-Output "Enabling Advertising ID ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -Name DisabledByGroupPolicy -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -Name DisabledByGroupPolicy -Type DELETE

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -PropertyType DWord -Value 1 -Force
}

#

# Show the Windows welcome experiences after updates and occasionally when I sign in to highlight what's new and suggested (default value)
Function ShowWindowsWelcomeExperience {
	Write-Output "Showing Windows Welcome Experience ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-310093Enabled -PropertyType DWord -Value 1 -Force
}

# Hide the Windows welcome experiences after updates and occasionally when I sign in to highlight what's new and suggested
Function HideWindowsWelcomeExperience {
	Write-Output "Hiding Windows Welcome Experience ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-310093Enabled -PropertyType DWord -Value 0 -Force
}

#

# Do not get tips, tricks, and suggestions as you use Windows
Function DisableWindowsTips {
	Write-Output "Disabling Windows Tips ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableSoftLanding -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableSoftLanding -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 0 -Force
}

# Get tips, tricks, and suggestions as you use Windows (default value)
Function EnableWindowsTips {
	Write-Output "Enabling Windows Tips ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableSoftLanding -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableSoftLanding -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -PropertyType DWord -Value 1 -Force
}

#

# Hide from me suggested content in the Settings app
Function HideSettingsSuggestedContent {
	Write-Output "Hiding Settings Suggested Content ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338393Enabled -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353694Enabled -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353696Enabled -PropertyType DWord -Value 0 -Force
}

# Show me suggested content in the Settings app (default value)
Function ShowSettingsSuggestedContent {
	Write-Output "Showing Settings Suggested Content ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338393Enabled -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353694Enabled -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353696Enabled -PropertyType DWord -Value 1 -Force		
}

#

# Turn off automatic installing suggested apps
Function DisableAppsSilentInstalling {
	Write-Output "Disabling Apps Silent Installing ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -PropertyType DWord -Value 0 -Force		
}

# Turn on automatic installing suggested apps (default value)
Function EnableAppsSilentInstalling {
	Write-Output "Enabling Apps Silent Installing ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -PropertyType DWord -Value 1 -Force		
}

#

# Do not suggest ways I can finish setting up my device to get the most out of Windows
Function DisableWhatsNewInWindows {
	Write-Output "Disabling Whats New In Windows ..."
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Name ScoobeSystemSettingEnabled -PropertyType DWord -Value 0 -Force
}

# Suggest ways I can finish setting up my device to get the most out of Windows (default value)
Function EnableWhatsNewInWindows {
	Write-Output "Enabling Whats New In Windows ..."
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Name ScoobeSystemSettingEnabled -PropertyType DWord -Value 1 -Force
}

#

# Do not let Microsoft offer you tailored experiences based on the diagnostic data setting you have chosen
Function DisableTailoredExperiences {
	Write-Output "Disabling Tailored Experiences ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CloudContent -Name DisableTailoredExperiencesWithDiagnosticData -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\CloudContent -Name DisableTailoredExperiencesWithDiagnosticData -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy -Name TailoredExperiencesWithDiagnosticDataEnabled -PropertyType DWord -Value 0 -Force

}

# Let Microsoft offer you tailored experiences based on the diagnostic data setting you have chosen (default value)
Function EnableTailoredExperiences {
	Write-Output "Enabling Tailored Experiences ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CloudContent -Name DisableTailoredExperiencesWithDiagnosticData -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\CloudContent -Name DisableTailoredExperiencesWithDiagnosticData -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy -Name TailoredExperiencesWithDiagnosticDataEnabled -PropertyType DWord -Value 1 -Force
}

#

# Disable Bing search in Start Menu
Function DisableBingSearch {
	Write-Output "Disabling Bing Search ..."
	if (-not (Test-Path -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer))
	{
		New-Item -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Force
	}
	New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -PropertyType DWord -Value 1 -Force

	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Type DWORD -Value 1
}

# Enable Bing search in Start Menu (default value)
Function EnableBingSearch {
	Write-Output "Enabling Bing Search ..."
	Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Type DELETE
}

#endregion Privacy & Telemetry


#region UI & Personalization

# Show the "This PC" icon on Desktop
Function ShowThisPC {
	Write-Output "Showing This PC ..."
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -PropertyType DWord -Value 0 -Force
}

# Hide the "This PC" icon on Desktop (default value)
Function HideThisPC {
	Write-Output "Hiding This PC ..."
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Force -ErrorAction Ignore
}

#

# Do not use item check boxes
Function DisableCheckBoxes {
	Write-Output "Disabling Check Boxes ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name AutoCheckSelect -PropertyType DWord -Value 0 -Force	
}

# Use check item check boxes (default value)
Function EnableCheckBoxes {
	Write-Output "Enabling Check Boxes ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name AutoCheckSelect -PropertyType DWord -Value 1 -Force	
}

#

# Show hidden files, folders, and drives
Function EnableHiddenItems {
	Write-Output "Enabling Hidden Items ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name Hidden -PropertyType DWord -Value 1 -Force		
}

# Do not show hidden files, folders, and drives (default value)
Function DisableHiddenItems {
	Write-Output "Disabling Hidden Items ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name Hidden -PropertyType DWord -Value 2 -Force
}

#

# Show file name extensions
Function ShowFileExtensions {
	Write-Output "Showing File Extensions ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -PropertyType DWord -Value 0 -Force		
}

# Hide file name extensions (default value)
Function HideFileExtensions {
	Write-Output "Hiding File Extensions ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -PropertyType DWord -Value 1 -Force		
}

#

# Show folder merge conflicts
Function ShowMergeConflicts {
	Write-Output "Showing Merge Conflicts ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideMergeConflicts -PropertyType DWord -Value 0 -Force
}

# Hide folder merge conflicts (default value)
Function HideMergeConflicts {
	Write-Output "Hiding Merge Conflicts ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideMergeConflicts -PropertyType DWord -Value 1 -Force
}

#

# Open File Explorer to "This PC"
Function ThisPCOpenFileExplorerTo {
	Write-Output "This PC Open File Explorer To ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -PropertyType DWord -Value 1 -Force
}

# Open File Explorer to Quick access (default value)
Function QuickAccessOpenFileExplorerTo {
	Write-Output "Quick Access Open File Explorer To ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -PropertyType DWord -Value 2 -Force		
}

#

# Expand the File Explorer ribbon
Function ExpandedFileExplorerRibbon {
	Write-Output "Setting Expanded File Explorer Ribbon ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name ExplorerRibbonStartsMinimized -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name ExplorerRibbonStartsMinimized -Type DELETE
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name ExplorerRibbonStartsMinimized -Type DELETE
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Ribbon))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 0 -Force
}

# Minimize File Explorer ribbon (default value)
Function MinimizedFileExplorerRibbon {
	Write-Output "Setting Minimized File Explorer Ribbon ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name ExplorerRibbonStartsMinimized -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name ExplorerRibbonStartsMinimized -Type DELETE
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name ExplorerRibbonStartsMinimized -Type DELETE
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Ribbon))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 1 -Force
}

#

# Do not show sync provider notification within File Explorer
Function HideOneDriveFileExplorerAd {
	Write-Output "Hiding OneDrive File Explorer Ad ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSyncProviderNotifications -PropertyType DWord -Value 0 -Force
}

# Show sync provider notification within File Explorer (default value)
Function ShowOneDriveFileExplorerAd {
	Write-Output "Showing OneDrive File Explorer Ad ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSyncProviderNotifications -PropertyType DWord -Value 1 -Force
}

#

# When I snap a window, do not show what I can snap next to it
Function DisableSnapAssist {
	Write-Output "Disabling Snap Assist ..."
	# Property type is string
	New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WindowArrangementActive -PropertyType String -Value 1 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SnapAssist -PropertyType DWord -Value 0 -Force
}

# When I snap a window, show what I can snap next to it (default value)
Function EnableSnapAssist {
	Write-Output "Enabling Snap Assist ..."
	# Property type is string
	New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name WindowArrangementActive -PropertyType String -Value 1 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SnapAssist -PropertyType DWord -Value 1 -Force
}

#

# Show the file transfer dialog box in the detailed mode
Function DetailedFileTransferDialog {
	Write-Output "Setting Detailed File Transfer Dialog ..."
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Name EnthusiastMode -PropertyType DWord -Value 1 -Force
}

# Show the file transfer dialog box in the compact mode (default value)
Function CompactFileTransferDialog {
	Write-Output "Setting Compact File Transfer Dialog ..."
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Name EnthusiastMode -PropertyType DWord -Value 0 -Force
}

#

# Display the recycle bin files delete confirmation dialog
Function EnableRecycleBinDeleteConfirmation {
	Write-Output "Enabling Recycle Bin Delete Confirmation ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ConfirmFileDelete -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name ConfirmFileDelete -Type DELETE
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name ConfirmFileDelete -Type DELETE

	$ShellState = Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState
	$ShellState[4] = $ShellState[4] -band -bnot 0x00000004
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force
}

# Do not display the recycle bin files delete confirmation dialog (default value)
Function DisableRecycleBinDeleteConfirmation {
	Write-Output "Disabling Recycle Bin Delete Confirmation ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ConfirmFileDelete -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name ConfirmFileDelete -Type DELETE
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name ConfirmFileDelete -Type DELETE

	$ShellState = Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState
	$ShellState[4] = $ShellState[4] -bor 0x00000004
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShellState -PropertyType Binary -Value $ShellState -Force
}

#

# Hide ThreeDObjects user folder in "This PC"
Function HideThreeDObjects {
	Write-Output "Hiding ThreeD Objects ..."
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force
	}
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
}

# Show ThreeDObjects user folder in "This PC" (default value)
Function ShowThreeDObjects {
	Write-Output "Showing ThreeD Objects ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
}

#

# Hide Desktop user folder in "This PC"
Function HideDesktop {
	Write-Output "Hiding Desktop ..."
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Force
	}
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
}

# Show Desktop user folder in "This PC" (default value)
Function ShowDesktop {
	Write-Output "Showing Desktop ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
}

#

# Hide Documents user folder in "This PC"
Function HideDocuments {
	Write-Output "Hiding Documents ..."
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Force
	}
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
}

# Show Documents user folder in "This PC" (default value)
Function ShowDocuments {
	Write-Output "Showing Documents ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
}

#

# Hide Downloads user folder in "This PC"
Function HideDownloads {
	Write-Output "Hiding Downloads ..."
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Force
	}
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
}

# Show Downloads user folder in "This PC" (default value)
Function ShowDownloads {
	Write-Output "Showing Downloads ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
}

#

# Hide Music user folder in "This PC"
Function HideMusic {
	Write-Output "Hiding Music ..."
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Force
	}
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
}

# Show Music user folder in "This PC" (default value)
Function ShowMusic {
	Write-Output "Showing Music ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
}

#

# Hide Pictures user folder in "This PC"
Function HidePictures {
	Write-Output "Hiding Pictures ..."
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Force
	}
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
}

# Show Pictures user folder in "This PC" (default value)
Function ShowPictures {
	Write-Output "Showing Pictures ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
}

#

# Hide Videos user folder in "This PC"
Function HideVideos {
	Write-Output "Hiding Videos ..."
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Force
	}
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force
}

# Show Videos user folder in "This PC" (default value)
Function ShowVideos {
	Write-Output "Showing Videos ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name ThisPCPolicy -Force -ErrorAction Ignore
}

#

# Hide recently used files in Quick access
Function HideQuickAccessRecentFiles {
	Write-Output "Hiding Quick Access Recent Files ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type DELETE
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 0 -Force		
}

# Show recently used files in Quick access (default value)
Function ShowQuickAccessRecentFiles {
	Write-Output "Showing Quick Access Recent Files ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type DELETE
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 1 -Force
}

#

# Hide frequently used folders in Quick access
Function HideQuickAccessFrequentFolders {
	Write-Output "Hiding Quick Access Frequent Folders ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -PropertyType DWord -Value 0 -Force
}

# Show frequently used folders in Quick access (default value)
Function ShowQuickAccessFrequentFolders {
	Write-Output "Showing Quick Access Frequent Folders ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -PropertyType DWord -Value 1 -Force
}

#

# Hide search highlights
Function HideSearchHighlights {
	Write-Output "Hiding Search Highlights ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name EnableDynamicContentInWSB -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name EnableDynamicContentInWSB -Type DELETE
	# Checking whether "Web search in Windows Search" was disabled. It also disable Search Highlights automatically
	# We have to use GetValue() due to "Set-StrictMode -Version Latest"
	$DisableSearchBoxSuggestions = ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer", "DisableSearchBoxSuggestions", $null))
	if ($DisableSearchBoxSuggestions -eq 1)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
		return
	}
	else
	{
		New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds\DSB -Name ShowDynamicContent -PropertyType DWord -Value 0 -Force
		New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SearchSettings -Name IsDynamicSearchBoxEnabled -PropertyType DWord -Value 0 -Force
	}
}

# Show search highlights (default value)
Function ShowSearchHighlights {
	Write-Output "Showing Search Highlights ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name EnableDynamicContentInWSB -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name EnableDynamicContentInWSB -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds\DSB -Name ShowDynamicContent -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SearchSettings -Name IsDynamicSearchBoxEnabled -PropertyType DWord -Value 1 -Force
}

#

# Hide Cortana button on the taskbar
Function HideCortanaButton {
	Write-Output "Hiding Cortana Button ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name AllowCortana -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name AllowCortana -Type DELETE

	if (-not (Get-AppxPackage -Name Microsoft.549981C3F5F10))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowCortanaButton -PropertyType DWord -Value 0 -Force
}

# Show Cortana button on the taskbar (default value)
Function ShowCortanaButton {
	Write-Output "Showing Cortana Button ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name AllowCortana -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name AllowCortana -Type DELETE

	if (-not (Get-AppxPackage -Name Microsoft.549981C3F5F10))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowCortanaButton -PropertyType DWord -Value 1 -Force
}

#

# Hide the Task View button on the taskbar
Function HideTaskViewButton {
	Write-Output "Hiding Task View Button ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 0 -Force
}

# Show the Task View button on the taskbar (default value)
Function ShowTaskViewButton {
	Write-Output "Showing Task View Button ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 1 -Force
}

#

# Disable "News and Interests" on the taskbar
Function DisableNewsInterests {
	Write-Output "Disabling News Interest ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name EnableFeeds -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\NewsAndInterests\AllowNewsAndInterests" -Name value -Force -ErrorAction Ignore

	if (-not (Get-Package -Name "Microsoft Edge" -ProviderName Programs -ErrorAction Ignore))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	# We have to use GetValue() due to "Set-StrictMode -Version Latest"
	$MachineId = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient", "MachineId", $null)
	if (-not $MachineId)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	# https://forums.mydigitallife.net/threads/taskbarda-widgets-registry-change-is-now-blocked.88547/#post-1849006
	$Signature = @{
		Namespace          = "WinAPI"
		Name               = "Signature"
		Language           = "CSharp"
		CompilerParameters = $CompilerParameters
		MemberDefinition   = @"
[DllImport("Shlwapi.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false)]
public static extern int HashData(byte[] pbData, int cbData, byte[] piet, int outputLen);
"@
	}
	if (-not ("WinAPI.Signature" -as [type]))
	{
		Add-Type @Signature
	}

	# We cannot set a value to EnShellFeedsTaskbarViewMode, having called any of APIs, except of copying powershell.exe (or any other tricks) with a different name, due to a UCPD driver tracks all executables to block the access to the registry
	Copy-Item -Path "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -Destination "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell_temp.exe" -Force
	# Combine variables into a string
	$Combined = $MachineId + '_' + 2
	# Reverse the whole string
	$CharArray = $Combined.ToCharArray()
	[array]::Reverse($CharArray)
	$Reverse = -join $CharArray
	$bytesIn = [System.Text.Encoding]::Unicode.GetBytes($Reverse)
	$bytesOut = [byte[]]::new(4)
	[WinAPI.Signature]::HashData($bytesIn, 0x53, $bytesOut, $bytesOut.Count)
	# Get value to save in EnShellFeedsTaskbarViewMode key
	$DWordData = [System.BitConverter]::ToUInt32($bytesOut,0)

	& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell_temp.exe" -Command {New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 2 -Force}
	# We need to use here an approach with "-Command & {}" as there's a variable inside
	& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell_temp.exe" -Command "& {New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name EnShellFeedsTaskbarViewMode -PropertyType DWord -Value $DWordData -Force}"
}

# Enable "News and Interests" on the taskbar (default value)
Function EnableNewsInterests {
	Write-Output "Enabling News Interest ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name EnableFeeds -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\NewsAndInterests\AllowNewsAndInterests" -Name value -Force -ErrorAction Ignore

	if (-not (Get-Package -Name "Microsoft Edge" -ProviderName Programs -ErrorAction Ignore))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	# We have to use GetValue() due to "Set-StrictMode -Version Latest"
	$MachineId = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient", "MachineId", $null)
	if (-not $MachineId)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	# https://forums.mydigitallife.net/threads/taskbarda-widgets-registry-change-is-now-blocked.88547/#post-1849006
	$Signature = @{
		Namespace          = "WinAPI"
		Name               = "Signature"
		Language           = "CSharp"
		CompilerParameters = $CompilerParameters
		MemberDefinition   = @"
[DllImport("Shlwapi.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false)]
public static extern int HashData(byte[] pbData, int cbData, byte[] piet, int outputLen);
"@
	}
	if (-not ("WinAPI.Signature" -as [type]))
	{
		Add-Type @Signature
	}

	# We cannot set a value to EnShellFeedsTaskbarViewMode, having called any of APIs, except of copying powershell.exe (or any other tricks) with a different name, due to a UCPD driver tracks all executables to block the access to the registry
	Copy-Item -Path "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -Destination "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell_temp.exe" -Force
	# Combine variables into a string
	$Combined = $MachineId + '_' + 0
	# Reverse the whole string
	$CharArray = $Combined.ToCharArray()
	[array]::Reverse($CharArray)
	$Reverse = -join $CharArray
	$bytesIn = [System.Text.Encoding]::Unicode.GetBytes($Reverse)
	$bytesOut = [byte[]]::new(4)
	[WinAPI.Signature]::HashData($bytesIn, 0x53, $bytesOut, $bytesOut.Count)
	# Get value to save in EnShellFeedsTaskbarViewMode key
	$DWordData = [System.BitConverter]::ToUInt32($bytesOut,0)

	& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell_temp.exe" -Command {New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 0 -Force}
	# We need to use here an approach with "-Command & {}" as there's a variable inside
	& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell_temp.exe" -Command "& {New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name EnShellFeedsTaskbarViewMode -PropertyType DWord -Value $DWordData -Force}"
}

#

# Hide the Meet Now icon in the notification area
Function HideMeetNow {
	Write-Output "Hiding Meet Now ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer, HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAMeetNow -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAMeetNow -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAMeetNow -Type DELETE
	$Script:MeetNow = $false
	$Settings = Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -ErrorAction Ignore
	$Settings[9] = 128
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -PropertyType Binary -Value $Settings -Force
}

# Show the Meet Now icon in the notification area (default value)
Function ShowMeetNow {
	Write-Output "Showing Meet Now ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer, HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAMeetNow -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAMeetNow -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAMeetNow -Type DELETE
	$Script:MeetNow = $true
	$Settings = Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -ErrorAction Ignore
	$Settings[9] = 0
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -PropertyType Binary -Value $Settings -Force
}

#

# Hide the Windows Ink Workspace button on the taskbar
Function HideWindowsInkWorkspace {
	Write-Output "Hiding Windows Ink Workspace ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -Name AllowWindowsInkWorkspace -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAMeetNow -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PenWorkspace -Name PenWorkspaceButtonDesiredVisibility -PropertyType DWord -Value 0 -Force
}

# Show Windows Ink Workspace button on the taskbar (default value)
Function ShowWindowsInkWorkspace {
	Write-Output "Showing Windows Ink Workspace ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -Name AllowWindowsInkWorkspace -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name HideSCAMeetNow -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PenWorkspace -Name PenWorkspaceButtonDesiredVisibility -PropertyType DWord -Value 1 -Force
}

#

# Always show all icons in the notification area
Function ShowNotificationAreaIcons {
	Write-Output "Showing Notification Area Icons ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name EnableAutoTray -PropertyType DWord -Value 0 -Force
}

# Hide all icons in the notification area (default value)
Function HideNotificationAreaIcons {
	Write-Output "Hiding Notification Area Icons ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name EnableAutoTray -PropertyType DWord -Value 1 -Force
}

#

# Show seconds on the taskbar clock
Function ShowSecondsInSystemClock {
	Write-Output "Showing Seconds In System Clock ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 1 -Force
}

# Hide seconds on the taskbar clock (default value)
Function HideSecondsInSystemClock {
	Write-Output "Hiding Seconds In System Clock ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSecondsInSystemClock -PropertyType DWord -Value 0 -Force
}

#

# Set the default Windows mode to dark
Function DarkWindowsColorMode {
	Write-Output "Setting Dark Windows Color Mode ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -PropertyType DWord -Value 0 -Force
}

# Set the default Windows mode to light (default value)
Function LightWindowsColorMode {
	Write-Output "Setting Light Windows Color Mode ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -PropertyType DWord -Value 1 -Force
}

#

# Set the default app mode to dark
Function DarkAppColorMode {
	Write-Output "Setting Dark App Color Mode ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -PropertyType DWord -Value 0 -Force
}

# Set the default app mode to light (default value)
Function LightAppColorMode {
	Write-Output "Setting Light App Color Mode ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -PropertyType DWord -Value 1 -Force
}

#

# Hide the "New App Installed" indicator
Function HideNewAppInstalledNotification {
	Write-Output "Hiding New App Installed Notification ..."
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer))
	{
		New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoNewAppAlert -PropertyType DWord -Value 1 -Force

	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoNewAppAlert -Type DWORD -Value 1
}

# Show the "New App Installed" indicator (default value)
Function ShowNewAppInstalledNotification {
	Write-Output "Showing New App Installed Notification ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoNewAppAlert -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoNewAppAlert -Type DELETE
}

#

# Hide first sign-in animation after the upgrade
Function DisableFirstLogonAnimation {
	Write-Output "Disabling First Logon Animation ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableFirstLogonAnimation -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableFirstLogonAnimation -Type DELETE
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name EnableFirstLogonAnimation -PropertyType DWord -Value 0 -Force
}

# Show first sign-in animation after the upgrade (default value)
Function EnableFirstLogonAnimation {
	Write-Output "Enabling First Logon Animation ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableFirstLogonAnimation -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableFirstLogonAnimation -Type DELETE
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name EnableFirstLogonAnimation -PropertyType DWord -Value 1 -Force
}

#

# Set the quality factor of the JPEG desktop wallpapers to maximum
Function MaxJPEGWallpapersQuality {
	Write-Output "Setting Max JPEG Wallpapers Quality ..."
	New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name JPEGImportQuality -PropertyType DWord -Value 100 -Force
}

# Set the quality factor of the JPEG desktop wallpapers to default (default value)
Function DefaultJPEGWallpapersQuality {
	Write-Output "Setting Default JPEG Wallpapers Quality ..."
	Remove-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name JPEGImportQuality -Force -ErrorAction Ignore
}

#

# Start Task Manager in the expanded mode
Function ExpandedTaskManagerWindow {
	Write-Output "Setting Expanded Task Manager Window ..."
	$Taskmgr = Get-Process -Name Taskmgr -ErrorAction Ignore

	Start-Sleep -Seconds 1

	if ($Taskmgr)
	{
		$Taskmgr.CloseMainWindow()
	}
	Start-Process -FilePath Taskmgr.exe -PassThru

	Start-Sleep -Seconds 3

	do
	{
		Start-Sleep -Milliseconds 100
		$Preferences = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences
	}
	until ($Preferences)

	Stop-Process -Name Taskmgr -ErrorAction Ignore

	$Preferences[28] = 0
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -PropertyType Binary -Value $Preferences -Force
}

# Start Task Manager in the compact mode (default value)
Function CompactTaskManagerWindow {
	Write-Output "Setting Compact Task Manager Window ..."
	$Taskmgr = Get-Process -Name Taskmgr -ErrorAction Ignore

	Start-Sleep -Seconds 1

	if ($Taskmgr)
	{
		$Taskmgr.CloseMainWindow()
	}
	Start-Process -FilePath Taskmgr.exe -PassThru

	Start-Sleep -Seconds 3

	do
	{
		Start-Sleep -Milliseconds 100
		$Preferences = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences
	}
	until ($Preferences)

	Stop-Process -Name Taskmgr -ErrorAction Ignore
	$Preferences[28] = 1
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -PropertyType Binary -Value $Preferences -Force
}

#

# Do not add the "- Shortcut" suffix to the file name of created shortcuts
Function DisableShortcutsSuffix {
	Write-Output "Disabling Shortcuts Suffix ..."
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name link -Force -ErrorAction Ignore
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates -Name ShortcutNameTemplate -PropertyType String -Value "%s.lnk" -Force
}

# Add the "- Shortcut" suffix to the file name of created shortcuts (default value)
Function EnableShortcutsSuffix {
	Write-Output "Enabling Shortcuts Suffix ..."
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer -Name link -Force -ErrorAction Ignore
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates -Name ShortcutNameTemplate -Force -ErrorAction Ignore
}

#

# Use the Print screen button to open screen snipping
Function EnablePrtScnSnippingTool {
	Write-Output "Enabling PrtScn Snipping Tool ..."
	New-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -PropertyType DWord -Value 1 -Force
}

# Do not use the Print screen button to open screen snipping (default value)
Function DisablePrtScnSnippingTool {
	Write-Output "Disabling PrtScn Snipping Tool ..."
	New-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -PropertyType DWord -Value 0 -Force
}

#

# Let me use a different input method for each app window
Function EnableAppsLanguageSwitch {
	Write-Output "Enabling Apps Language Switch ..."
	Set-WinLanguageBarOption -UseLegacySwitchMode
}

# Do not use a different input method for each app window (default value)
Function DisableAppsLanguageSwitch {
	Write-Output "Disabling Apps Language Switch ..."
	Set-WinLanguageBarOption
}

#

# When I grab a windows's title bar and shake it, don't minimize all other windows
Function DisableAeroShaking {
	Write-Output "Disabling Aero Shaking ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\Software\Policies\Microsoft\Windows\Explorer -Name NoWindowMinimizingShortcuts -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoWindowMinimizingShortcuts -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoWindowMinimizingShortcuts -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name DisallowShaking -PropertyType DWord -Value 1 -Force
}

# When I grab a windows's title bar and shake it, minimize all other windows (default value)
Function EnableAeroShaking {
	Write-Output "Enabling Aero Shaking ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\Software\Policies\Microsoft\Windows\Explorer -Name NoWindowMinimizingShortcuts -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoWindowMinimizingShortcuts -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoWindowMinimizingShortcuts -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name DisallowShaking -PropertyType DWord -Value 0 -Force
}

#

# Do not group files and folder in the Downloads folder
Function NoneFolderGroupBy {
	Write-Output "Setting None for Folder Group By ..."
	# Clear any Common Dialog views
	Get-ChildItem -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\*\Shell" -Recurse | Where-Object -FilterScript {$_.PSChildName -eq "{885A186E-A440-4ADA-812B-DB871B942259}"} | Remove-Item -Force

	# https://learn.microsoft.com/en-us/windows/win32/properties/props-system-null
	if (-not (Test-Path -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}"))
	{
		New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}" -Force
	}
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}" -Name ColumnList -PropertyType String -Value "System.Null" -Force
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}" -Name GroupBy -PropertyType String -Value "System.Null" -Force
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}" -Name LogicalViewMode -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}" -Name Name -PropertyType String -Value NoName -Force
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}" -Name Order -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}" -Name PrimaryProperty -PropertyType String -Value "System.ItemNameDisplay" -Force
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}" -Name SortByList -PropertyType String -Value "prop:System.ItemNameDisplay" -Force
}

# Group files and folder by date modified in the Downloads folder (default value)
Function DefaultFolderGroupBy {
	Write-Output "Setting Default for Folder Group By ..."
	Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}" -Recurse -Force -ErrorAction Ignore
}

#

# Expand to open folder on navigation pane
Function EnableNavigationPaneExpand {
	Write-Output "Enabling Navigation Pane Expand ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -PropertyType DWord -Value 1 -Force
}

# Do not expand to open folder on navigation pane (default value)
Function DisableNavigationPaneExpand {
	Write-Output "Disabling Navigation Pane Expand ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -PropertyType DWord -Value 0 -Force		
}

#endregion UI & Personalization

#region OneDrive

# Uninstall OneDrive. OneDrive user folder won't be removed if any file found there
Function UninstallOneDrive {
	Write-Output "Uninstalling OneDrive ..."
	If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) {
		New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null
	}
	Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1

	Stop-Process -Name "OneDrive" -ErrorAction SilentlyContinue
	Start-Sleep -s 2
	$onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
	If (!(Test-Path $onedrive)) {
		$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
	}
	Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
	Start-Sleep -s 2
	Stop-Process -Name "explorer" -ErrorAction SilentlyContinue
	Start-Sleep -s 2
	Remove-Item -Path "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
	Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
	Remove-Item -Path "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
	Remove-Item -Path "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
	If (!(Test-Path "HKCR:")) {
		New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
	}
	Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
	Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
}

# Install OneDrive (default value)
Function InstallOneDrive {
	Write-Output "Installing OneDrive ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -ErrorAction SilentlyContinue
	& "$env:SystemRoot\SysWOW64\OneDriveSetup.exe"
}

#endregion OneDrive

#region System

# Turn on Storage Sense
Function EnableStorageSense {
	Write-Output "Enabling Storage Sense ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\StorageSense -Name AllowStorageSenseGlobal -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\StorageSense -Name AllowStorageSenseGlobal -Type DELETE

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -ItemType Directory -Force
	}
	# Turn on Storage Sense
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01 -PropertyType DWord -Value 1 -Force

	# Turn on automatic cleaning up temporary system and app files
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -PropertyType DWord -Value 1 -Force

	# Run Storage Sense every month
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 30 -Force
}

# Turn off Storage Sense (default value)
Function DisableStorageSense {
	Write-Output "Disabling Storage Sense ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\StorageSense -Name AllowStorageSenseGlobal -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\StorageSense -Name AllowStorageSenseGlobal -Type DELETE

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -ItemType Directory -Force
	}
	# Turn off Storage Sense
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01 -PropertyType DWord -Value 0 -Force

	# Turn off automatic cleaning up temporary system and app files
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -PropertyType DWord -Value 0 -Force

	# Run Storage Sense during low free disk space
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 0 -Force
}

#

# Disable hibernation. Not recommended for laptops
Function DisableHibernation {
	Write-Output "Disabling Hibernation ..."
	& "$env:SystemRoot\System32\powercfg.exe" /HIBERNATE OFF
}

# Enable hibernate (default value)
Function EnableHibernation {
	Write-Output "Enabling Hibernation ..."
	& "$env:SystemRoot\System32\powercfg.exe" /HIBERNATE ON
}

#

# Enable Windows long paths support which is limited for 260 characters by default
Function EnableWin32LongPathsSupport {
	Write-Output "Enabling Win32 Long Paths Support ..."
	New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -PropertyType DWord -Value 1 -Force
	Set-Policy -Scope Computer -Path SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -Type DWORD -Value 1
}

# Disable Windows long paths support which is limited for 260 characters by default (default value)
Function DisableWin32LongPathsSupport {
	Write-Output "Disabling Win32 Long Paths Support ..."
	New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -PropertyType DWord -Value 0 -Force
	Set-Policy -Scope Computer -Path SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -Type DWORD -Value 0
}

#

# Display Stop error code when BSoD occurs
Function EnableBSoDStopError {
	Write-Output "Enabling BSoD Stop Error ..."
	New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl -Name DisplayParameters -PropertyType DWord -Value 1 -Force
}

# Do not display stop error code when BSoD occurs (default value)
Function DisableBSoDStopError {
	Write-Output "Disabling BSoD Stop Error ..."
	New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl -Name DisplayParameters -PropertyType DWord -Value 0 -Force
}

#

# Choose when to be notified about changes to your computer: never notify
Function NeverAdminApprovalMode {
	Write-Output "Setting Never Admin Approval Mode ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name FilterAdministratorToken -Force -ErrorAction Ignore
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorUser -PropertyType DWord -Value 3 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableInstallerDetection -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ValidateAdminCodeSignatures -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableSecureUIAPaths -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name PromptOnSecureDesktop -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableVirtualization -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableUIADesktopToggle -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -PropertyType DWord -Value 0 -Force
}

# Choose when to be notified about changes to your computer: notify me only when apps try to make changes to my computer (default value)
Function DefaultAdminApprovalMode {
	Write-Output "Setting Default Admin Approval Mode ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name FilterAdministratorToken -Force -ErrorAction Ignore
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorUser -PropertyType DWord -Value 3 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableInstallerDetection -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ValidateAdminCodeSignatures -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableSecureUIAPaths -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name PromptOnSecureDesktop -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableVirtualization -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableUIADesktopToggle -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -PropertyType DWord -Value 5 -Force
}

#

# Turn off Delivery Optimization
Function DisableDeliveryOptimization {
	Write-Output "Disabling Delivery Optimization ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization -Name DODownloadMode -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization -Name DODownloadMode -Type DELETE
	New-ItemProperty -Path Registry::HKEY_USERS\S-1-5-20\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings -Name DownloadMode -PropertyType DWord -Value 0 -Force
	Delete-DeliveryOptimizationCache -Force
}

# Turn on Delivery Optimization (default value)
Function EnableDeliveryOptimization {
	Write-Output "Enabling Delivery Optimization ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization -Name DODownloadMode -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization -Name DODownloadMode -Type DELETE
	New-ItemProperty -Path Registry::HKEY_USERS\S-1-5-20\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings -Name DownloadMode -PropertyType DWord -Value 1 -Force
}

#

# Do not let Windows manage my default printer
Function DisableWindowsManageDefaultPrinter {
	Write-Output "Disabling Windows Manage Default Printer ..."
	Set-Policy -Scope User -Path "Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name LegacyDefaultPrinterMode -Type DELETE
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name LegacyDefaultPrinterMode -PropertyType DWord -Value 1 -Force
}

# Let Windows manage my default printer (default value)
Function EnableWindowsManageDefaultPrinter {
	Write-Output "Enabling Windows Manage Default Printer ..."
	Set-Policy -Scope User -Path "Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name LegacyDefaultPrinterMode -Type DELETE
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name LegacyDefaultPrinterMode -PropertyType DWord -Value 0 -Force
}











# Turn on automatic cleaning up temporary system and app files
Function EnableStorageSenseTempFiles {
	Write-Output "Enabling Storage Sense Temp Files ..."
	if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1")
	{
		New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -PropertyType DWord -Value 1 -Force
	}	
}

# Turn off automatic cleaning up temporary system and app files
Function DisableStorageSenseTempFiles {
	Write-Output "Disabling Storage Sense Temp Files ..."
	if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1")
	{
		New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 04 -PropertyType DWord -Value 0 -Force
	}
}

# Run Storage Sense every month
Function MonthStorageSenseFrequency {
	Write-Output "Setting Month Storage Sense Frequency ..."
	if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1")
	{
		New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 30 -Force
	}
}

# Run Storage Sense during low free disk space
Function DefaultStorageSenseFrequency {
	Write-Output "Setting Default Storage Sense Frequency ..."
	if ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 01) -eq "1")
	{
		New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy -Name 2048 -PropertyType DWord -Value 0 -Force
	}
}





# Disable the Windows 260 character path limit
Function DisableWin32LongPathLimit {
	Write-Output "Disabling Win32 Long Path Limit ..."
	New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -PropertyType DWord -Value 1 -Force
}

# Enable the Windows 260 character path limit
Function EnableWin32LongPathLimit {
	Write-Output "Enabling Win32 Long Path Limit ..."
	New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -PropertyType DWord -Value 0 -Force
}





# Turn on access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled
Function EnableMappedDrivesAppElevatedAccess {
	Write-Output "Enabling Mapped Drives App Elevated Access ..."
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLinkedConnections -PropertyType DWord -Value 1 -Force
}

# Turn off access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled
Function DisableMappedDrivesAppElevatedAccess {
	Write-Output "Disabling Mapped Drives App Elevated Access ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLinkedConnections -Force -ErrorAction Ignore
}





# Receive updates for other Microsoft products
Function EnableUpdateMicrosoftProducts {
	Write-Output "Enabling Update Microsoft Products ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AllowMUUpdateService -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AllowMUUpdateService -Type DELETE
	(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
}

# Do not receive updates for other Microsoft products
Function DisableUpdateMicrosoftProducts {
	Write-Output "Disabling Update Microsoft Products ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AllowMUUpdateService -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AllowMUUpdateService -Type DELETE
	if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService)
	{
		(New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
	}
}

# Notify me when a restart is required to finish updating
Function ShowRestartNotification {
	Write-Output "Showing Restart Notification ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetAutoRestartNotificationDisable -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetAutoRestartNotificationDisable -Type DELETE
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name RestartNotificationsAllowed2 -PropertyType DWord -Value 1 -Force		
}

# Do not notify me when a restart is required to finish updating
Function HideRestartNotification {
	Write-Output "Hiding Restart Notification ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetAutoRestartNotificationDisable -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetAutoRestartNotificationDisable -Type DELETE
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name RestartNotificationsAllowed2 -PropertyType DWord -Value 0 -Force
}

# Restart as soon as possible to finish updating
Function EnableRestartDeviceAfterUpdate {
	Write-Output "Enabling Restart Device After Update ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursEnd, ActiveHoursStart, SetActiveHours -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursEnd -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursStart -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetActiveHours -Type DELETE
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name IsExpedited -PropertyType DWord -Value 1 -Force
}

# Don't restart as soon as possible to finish updating 
Function DisableRestartDeviceAfterUpdate {
	Write-Output "Disabling Restart Device After Update ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursEnd, ActiveHoursStart, SetActiveHours -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursEnd -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursStart -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetActiveHours -Type DELETE
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name IsExpedited -PropertyType DWord -Value 0 -Force
}

# Automatically adjust active hours for me based on daily usage
Function AutomaticallyActiveHours {
	Write-Output "Setting Automatically Active Hours ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name NoAutoRebootWithLoggedOnUsers, AlwaysAutoRebootAtScheduledTime -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name NoAutoRebootWithLoggedOnUsers -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AlwaysAutoRebootAtScheduledTime -Type DELETE

	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursEnd, ActiveHoursStart, SetActiveHours -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursEnd -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursStart -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetActiveHours -Type DELETE
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name SmartActiveHoursState -PropertyType DWord -Value 1 -Force
}

# Manually adjust active hours for me based on daily usage
Function ManuallyActiveHours {
	Write-Output "Setting Manually Active Hours ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name NoAutoRebootWithLoggedOnUsers, AlwaysAutoRebootAtScheduledTime -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name NoAutoRebootWithLoggedOnUsers -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name AlwaysAutoRebootAtScheduledTime -Type DELETE

	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursEnd, ActiveHoursStart, SetActiveHours -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursEnd -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name ActiveHoursStart -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetActiveHours -Type DELETE
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name SmartActiveHoursState -PropertyType DWord -Value 0 -Force
}

# Do not get the latest updates as soon as they're available
Function DisableWindowsLatestUpdate {
	Write-Output "Disabling Windows Latest Update ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name AllowOptionalContent, SetAllowOptionalContent -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name AllowOptionalContent -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetAllowOptionalContent -Type DELETE
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name IsContinuousInnovationOptedIn -PropertyType DWord -Value 0 -Force
}

# Get the latest updates as soon as they're available
Function EnableWindowsLatestUpdate {
	Write-Output "Enabling Windows Latest Update ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name AllowOptionalContent, SetAllowOptionalContent -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name AllowOptionalContent -Type DELETE
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name SetAllowOptionalContent -Type DELETE
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name IsContinuousInnovationOptedIn -PropertyType DWord -Value 1 -Force
}

# Set power plan on "High performance"
Function HighPowerPlan {
	Write-Output "Setting High Power Plan ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Power\PowerSettings -Name ActivePowerScheme -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Power\PowerSettings -Name ActivePowerScheme -Type DELETE
	& "$env:SystemRoot\System32\powercfg.exe" /SETACTIVE SCHEME_MIN
}

# Set power plan on "Balanced"
Function BalancedPowerPlan {
	Write-Output "Setting Balanced Power Plan ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Power\PowerSettings -Name ActivePowerScheme -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Power\PowerSettings -Name ActivePowerScheme -Type DELETE
	& "$env:SystemRoot\System32\powercfg.exe" /SETACTIVE SCHEME_BALANCED
}

# Do not allow the computer to turn off the network adapters to save power
Function DisableNetworkAdaptersSavePower {
	Write-Output "Disabling Network Adapters Save Power ..."
	Write-Information -MessageData "" -InformationAction Continue
	# Extract the localized "Please wait..." string from shell32.dll
	Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

	# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
	# We need also check for adapter status per some laptops have many equal adapters records in adapters list
	$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
	if (-not $Adapters)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	$PhysicalAdaptersStatusUp = @(Get-NetAdapter -Physical | Where-Object -FilterScript {($_.Status -eq "Up") -and $_.MacAddress})

	# Checking whether PC is currently connected to a Wi-Fi network
	# NetConnectionStatus 2 is Wi-Fi
	$InterfaceIndex = (Get-CimInstance -ClassName Win32_NetworkAdapter -Namespace root/CIMV2 | Where-Object -FilterScript {$_.NetConnectionStatus -eq 2}).InterfaceIndex
	if (Get-NetAdapter -Physical | Where-Object -FilterScript {($_.Status -eq "Up") -and ($_.PhysicalMediaType -eq "Native 802.11") -and ($_.InterfaceIndex -eq $InterfaceIndex)})
	{
		# Get currently connected Wi-Fi network SSID
		$SSID = (Get-NetConnectionProfile).Name
	}
	foreach ($Adapter in $Adapters)
	{
		$Adapter.AllowComputerToTurnOffDevice = "Disabled"
		$Adapter | Set-NetAdapterPowerManagement
	}
	# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up
	# Otherwise functions below will indicate that there is no the Internet connection
	if ($PhysicalAdaptersStatusUp)
	{
		# If Wi-Fi network was used
		if ($SSID)
		{
			Write-Verbose -Message $SSID -Verbose
			# Connect to it
			netsh wlan connect name=$SSID
		}

		while
		(
			Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp.Name | Where-Object -FilterScript {($_.Status -eq "Disconnected") -and $_.MacAddress}
		)
		{
			Write-Information -MessageData "" -InformationAction Continue
			# Extract the localized "Please wait..." string from shell32.dll
			Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

			Start-Sleep -Seconds 2
		}
	}
}

# Allow the computer to turn off the network adapters to save power
Function EnableNetworkAdaptersSavePower {
	Write-Output "Enabling Network Adapters Save Power ..."
	Write-Information -MessageData "" -InformationAction Continue
	# Extract the localized "Please wait..." string from shell32.dll
	Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

	# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
	# We need also check for adapter status per some laptops have many equal adapters records in adapters list
	$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
	if (-not $Adapters)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	$PhysicalAdaptersStatusUp = @(Get-NetAdapter -Physical | Where-Object -FilterScript {($_.Status -eq "Up") -and $_.MacAddress})

	# Checking whether PC is currently connected to a Wi-Fi network
	# NetConnectionStatus 2 is Wi-Fi
	$InterfaceIndex = (Get-CimInstance -ClassName Win32_NetworkAdapter -Namespace root/CIMV2 | Where-Object -FilterScript {$_.NetConnectionStatus -eq 2}).InterfaceIndex
	if (Get-NetAdapter -Physical | Where-Object -FilterScript {($_.Status -eq "Up") -and ($_.PhysicalMediaType -eq "Native 802.11") -and ($_.InterfaceIndex -eq $InterfaceIndex)})
	{
		# Get currently connected Wi-Fi network SSID
		$SSID = (Get-NetConnectionProfile).Name
	}
	foreach ($Adapter in $Adapters)
	{
		$Adapter.AllowComputerToTurnOffDevice = "Enabled"
		$Adapter | Set-NetAdapterPowerManagement
	}
	# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up
	# Otherwise functions below will indicate that there is no the Internet connection
	if ($PhysicalAdaptersStatusUp)
	{
		# If Wi-Fi network was used
		if ($SSID)
		{
			Write-Verbose -Message $SSID -Verbose
			# Connect to it
			netsh wlan connect name=$SSID
		}

		while
		(
			Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp.Name | Where-Object -FilterScript {($_.Status -eq "Disconnected") -and $_.MacAddress}
		)
		{
			Write-Information -MessageData "" -InformationAction Continue
			# Extract the localized "Please wait..." string from shell32.dll
			Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

			Start-Sleep -Seconds 2
		}
	}
}

# Override for default input method: English
Function EnglishInputMethod {
	Write-Output "Setting English Input Method  ..."
	Set-WinDefaultInputMethodOverride -InputTip "0409:00000409"
}

# Override for default input method: use language list
Function DefaultInputMethod {
	Write-Output "Setting Default Input Method  ..."
	Remove-ItemProperty -Path "HKCU:\Control Panel\International\User Profile" -Name InputMethodOverride -Force -ErrorAction Ignore
}

# Use the latest installed .NET runtime for all apps
Function EnableLatestInstalledNET {
	Write-Output "Enabling Latest Installed .NET ..."
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force
}

# Do not use the latest installed .NET runtime for all apps
Function DisableLatestInstalledNET {
	Write-Output "Disabling Latest Installed .NET ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore
}

# Ask me before running troubleshooter
Function DefaultRecommendedTroubleshooting {
	Write-Output "Setting Default Recommended Troubleshooting ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Force -ErrorAction Ignore
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -Force -ErrorAction Ignore
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name ShowedToastAtLevel -Force -ErrorAction Ignore

	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DELETE

	# Turn on Windows Error Reporting
	Get-ScheduledTask -TaskName QueueReporting -ErrorAction Ignore | Enable-ScheduledTask
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting", "HKCU:\Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type DELETE
	Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type DELETE

	Get-Service -Name WerSvc | Set-Service -StartupType Manual
	Get-Service -Name WerSvc | Start-Service
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Microsoft\WindowsMitigation))
	{
		New-Item -Path HKLM:\SOFTWARE\Microsoft\WindowsMitigation -Force
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsMitigation -Name UserPreference -PropertyType DWord -Value 2 -Force
}

# Run troubleshooter automatically, then notify me
Function AutomaticallyRecommendedTroubleshooting {
	Write-Output "Setting Automatically Recommended Troubleshooting ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Force -ErrorAction Ignore
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -Force -ErrorAction Ignore
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name ShowedToastAtLevel -Force -ErrorAction Ignore

	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DELETE

	# Turn on Windows Error Reporting
	Get-ScheduledTask -TaskName QueueReporting -ErrorAction Ignore | Enable-ScheduledTask
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting", "HKCU:\Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type DELETE
	Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type DELETE

	Get-Service -Name WerSvc | Set-Service -StartupType Manual
	Get-Service -Name WerSvc | Start-Service
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Microsoft\WindowsMitigation))
	{
		New-Item -Path HKLM:\SOFTWARE\Microsoft\WindowsMitigation -Force
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsMitigation -Name UserPreference -PropertyType DWord -Value 3 -Force
}

# Launch folder windows in a separate process
Function EnableFoldersLaunchSeparateProcess {
	Write-Output "Enabling Folders Launch Separate Process ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SeparateProcess -PropertyType DWord -Value 1 -Force
}

# Do not launch folder windows in a separate process
Function DisableFoldersLaunchSeparateProcess {
	Write-Output "Disabling Folders Launch Separate Process ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SeparateProcess -PropertyType DWord -Value 0 -Force
}

# Disable and delete reserved storage after the next update installation
Function DisableReservedStorage {
	Write-Output "Disabling Reserved Storage ..."
	try
	{
		Set-WindowsReservedStorageState -State Disabled
	}
	catch [System.Runtime.InteropServices.COMException]
	{
		Write-Warning -Message ($Localization.ReservedStorageIsInUse -f $MyInvocation.Line.Trim())
		Write-Error -Message ($Localization.ReservedStorageIsInUse -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
	}
}

# Enable reserved storage after the next update installation
Function EnableReservedStorage {
	Write-Output "Enabling Reserved Storage ..."
	Set-WindowsReservedStorageState -State Enabled
}

# Disable help lookup via F1
Function DisableF1HelpPage {
	Write-Output "Disabling F1 Help Page ..."
	if (-not (Test-Path -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64"))
	{
		New-Item -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64" -Force
	}
	New-ItemProperty -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}\1.0\0\win64" -Name "(default)" -PropertyType String -Value "" -Force
}

# Enable help lookup via F1
Function EnableF1HelpPage {
	Write-Output "Enabling F1 Help Page ..."
	Remove-Item -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}" -Recurse -Force -ErrorAction Ignore
}

# Enable Num Lock at startup
Function EnableNumLock {
	Write-Output "Enabling NumLock at startup ..."
	New-ItemProperty -Path "Registry::HKEY_USERS\.DEFAULT\Control Panel\Keyboard" -Name InitialKeyboardIndicators -PropertyType String -Value 2147483650 -Force
}

# Disable Num Lock at startup
Function DisableNumLock {
	Write-Output "Disabling NumLock at startup ..."
	New-ItemProperty -Path "Registry::HKEY_USERS\.DEFAULT\Control Panel\Keyboard" -Name InitialKeyboardIndicators -PropertyType String -Value 2147483648 -Force
}

# Disable Caps Lock
Function DisableCapsLock {
	Write-Output "Disabling Caps Lock ..."
	Remove-ItemProperty -Path "HKCU:\Keyboard Layout" -Name Attributes -Force -ErrorAction Ignore
	New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -Name "Scancode Map" -PropertyType Binary -Value ([byte[]](0,0,0,0,0,0,0,0,2,0,0,0,0,0,58,0,0,0,0,0)) -Force
}

# Enable Caps Lock
Function EnableCapsLock {
	Write-Output "Enabling Caps Lock ..."
	Remove-ItemProperty -Path "HKCU:\Keyboard Layout" -Name Attributes -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -Name "Scancode Map" -Force -ErrorAction Ignore		
}

# Turn off pressing the Shift key 5 times to turn Sticky keys
Function DisableStickyShift {
	Write-Output "Disabling Sticky Shift ..."
	New-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name Flags -PropertyType String -Value 506 -Force
}

# Turn on pressing the Shift key 5 times to turn Sticky keys
Function EnableStickyShift {
	Write-Output "Enabling Sticky Shift ..."
	New-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name Flags -PropertyType String -Value 510 -Force
}

# Don't use AutoPlay for all media and devices
Function DisableAutoplay {
	Write-Output "Disabling Autoplay ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoDriveTypeAutoRun -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoDriveTypeAutoRun -Type DELETE
	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoDriveTypeAutoRun -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers -Name DisableAutoplay -PropertyType DWord -Value 1 -Force
}

# Use AutoPlay for all media and devices
Function EnableAutoplay {
	Write-Output "Enabling Autoplay ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoDriveTypeAutoRun -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoDriveTypeAutoRun -Type DELETE
	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoDriveTypeAutoRun -Type DELETE
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers -Name DisableAutoplay -PropertyType DWord -Value 0 -Force
}

# Disable thumbnail cache removal
Function DisableThumbnailCacheRemoval {
	Write-Output "Disabling Thumbnail Cache Removal ..."
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" -Name Autorun -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" -Name Autorun -PropertyType DWord -Value 0 -Force
}

# Enable thumbnail cache removal
Function EnableThumbnailCacheRemoval {
	Write-Output "Enabling Thumbnail Cache Removal ..."
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" -Name Autorun -PropertyType DWord -Value 3 -Force
	New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Thumbnail Cache" -Name Autorun -PropertyType DWord -Value 3 -Force
}

# Automatically saving my restartable apps and restart them when I sign back in
Function EnableSaveRestartableApps {
	Write-Output "Enabling Save Restartable Apps ..."
	New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name RestartApps -Value 1 -Force
}

# Turn off automatically saving my restartable apps and restart them when I sign back in
Function DisableSaveRestartableApps {
	Write-Output "Disabling Save Restartable Apps ..."
	New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name RestartApps -Value 0 -Force
}

# Enable "Network Discovery" and "File and Printers Sharing" for workgroup networks
Function EnableNetworkDiscovery {
	Write-Output "Enabling Network Discovery ..."
	$FirewallRules = @(
		# File and printer sharing
		"@FirewallAPI.dll,-32752",

		# Network discovery
		"@FirewallAPI.dll,-28502"
	)
	Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled True
	Set-NetFirewallRule -Profile Private -Name FPS-SMB-In-TCP -Enabled True
	Set-NetConnectionProfile -NetworkCategory Private
}

# Disable "Network Discovery" and "File and Printers Sharing" for workgroup networks
Function DisableNetworkDiscovery {
	Write-Output "Disabling Network Discovery ..."
	$FirewallRules = @(
		# File and printer sharing
		"@FirewallAPI.dll,-32752",

		# Network discovery
		"@FirewallAPI.dll,-28502"
	)
	Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled False
}

# Restart as soon as possible to finish updating
Function EnableDeviceRestartAfterUpdate {
	Write-Output "Enabling Device Restart After Update ..."
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name IsExpedited -PropertyType DWord -Value 1 -Force
}

# Don't restart as soon as possible to finish updating
Function DisableDeviceRestartAfterUpdate {
	Write-Output "Disabling Device Restart After Update ..."
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name IsExpedited -PropertyType DWord -Value 0 -Force
}

# Prevent all internal SATA drives from showing up as removable media in the taskbar notification area
Function DisableSATADrivesRemovableMedia {
	Write-Output "Disabling SATA Drives Removable Media ..."
	New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\storahci\Parameters\Device -Name TreatAsInternalPort -Value @(0, 1, 2, 3, 4, 5) -Type MultiString -Force
}

# Show up all internal SATA drives as removeable media in the taskbar notification area
Function DefaultSATADrivesRemovableMedia {
	Write-Output "Default Setting SATA Drives Removable Media ..."
	Remove-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\storahci\Parameters\Device -Name TreatAsInternalPort -Force -ErrorAction Ignore
}

# Back up the system registry to %SystemRoot%\System32\config\RegBack folder
Function EnableRegistryBackup {
	Write-Output "Enabling Registry Backup ..."
	New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -PropertyType DWord -Value 1 -Force
}

# Do not back up the system registry to %SystemRoot%\System32\config\RegBack folder
Function DisableRegistryBackup {
	Write-Output "Disabling Registry Backup ..."
	Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Force -ErrorAction Ignore
}

#endregion System

#region Start menu

# Hide recently added apps in Start menu
Function HideRecentlyAddedApps {
	Write-Output "Hiding Recently Added Apps ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore
	if (-not (Test-Path -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer))
	{
		New-Item -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Force
	}
	New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force

	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1
}

# Show recently added apps in Start menu
Function ShowRecentlyAddedApps {
	Write-Output "Showing Recently Added Apps ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore
	Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DELETE
}

# Hide app suggestions in Start menu
Function HideAppSuggestions {
	Write-Output "Hiding App Suggestions ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableWindowsConsumerFeatures -Force -ErrorAction Ignore
	if (([WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") -match "Enterprise") -or ([WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") -match "Education"))
	{
		Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableWindowsConsumerFeatures -Type DELETE
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -PropertyType DWord -Value 0 -Force
}

# Show app suggestions in Start menu
Function ShowAppSuggestions {
	Write-Output "Showing App Suggestions ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableWindowsConsumerFeatures -Force -ErrorAction Ignore
	if (([WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") -match "Enterprise") -or ([WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") -match "Education"))
	{
		Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableWindowsConsumerFeatures -Type DELETE
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -PropertyType DWord -Value 1 -Force		
}

#endregion Start menu

#region UWP apps

# Disable Cortana autostarting
Function DisableCortanaAutostart {
	Write-Output "Disabling Cortana Autostart ..."
		if (-not (Get-AppxPackage -Name Microsoft.549981C3F5F10))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	if (-not (Test-Path -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId"))
	{
		New-Item -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId" -Force
	}
	New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId" -Name State -PropertyType DWord -Value 1 -Force
}

# Enable Cortana autostarting
Function EnableCortanaAutostart {
	Write-Output "Enabling Cortana Autostart ..."
	if (-not (Get-AppxPackage -Name Microsoft.549981C3F5F10))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	if (-not (Test-Path -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId"))
	{
		New-Item -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId" -Force
	}
	New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId" -Name State -PropertyType DWord -Value 2 -Force
}

# Do not let UWP apps run in the background
Function DisableBackgroundUWPApps {
	Write-Output "Disabling Background UWP Apps ..."
	# Remove all excluded apps running in the background
	Get-ChildItem -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications | ForEach-Object -Process {
		Remove-ItemProperty -Path $_.PsPath -Name * -Force
	}

	# Exclude apps from the Bundle only
	$BackgroundAccessApplications = @((Get-ChildItem -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications).PSChildName)
	$ExcludedBackgroundAccessApplications = @()
	foreach ($BackgroundAccessApplication in $BackgroundAccessApplications)
	{
		if (Get-AppxPackage -PackageTypeFilter Bundle -AllUsers | Where-Object -FilterScript {$_.PackageFamilyName -eq $BackgroundAccessApplication})
		{
			$ExcludedBackgroundAccessApplications += $BackgroundAccessApplication
		}
	}

	Get-ChildItem -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications | Where-Object -FilterScript {$_.PSChildName -in $ExcludedBackgroundAccessApplications} | ForEach-Object -Process {
		New-ItemProperty -Path $_.PsPath -Name Disabled -PropertyType DWord -Value 1 -Force
		New-ItemProperty -Path $_.PsPath -Name DisabledByUser -PropertyType DWord -Value 1 -Force
	}

	# Open the "Background apps" page
	Start-Process -FilePath ms-settings:privacy-backgroundapps
}

# Let all UWP apps run in the background
Function EnableBackgroundUWPApps {
	Write-Output "Enabling Background UWP Apps ..."
	Get-ChildItem -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications | ForEach-Object -Process {
		Remove-ItemProperty -Path $_.PsPath -Name * -Force
	}
}

#endregion UWP apps

#region Gaming

# Disable Xbox Game Bar
Function DisableXboxGameBar {
	Write-Output "Disabling Xbox Game Bar ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
}

# Enable Xbox Game Bar
Function EnableXboxGameBar {
	Write-Output "Enabling Xbox Game Bar ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
}

# Disable Xbox Game Bar tips
Function DisableXboxGameTips {
	Write-Output "Disabling Xbox Game Tips ..."
	if (-not (Get-AppxPackage -Name Microsoft.GamingApp))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name ShowStartupPanel -PropertyType DWord -Value 0 -Force		
}

# Enable Xbox Game Bar tips
Function EnableXboxGameTips {
	Write-Output "Enabling Xbox Game Tips ..."
	if (-not (Get-AppxPackage -Name Microsoft.GamingApp))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name ShowStartupPanel -PropertyType DWord -Value 1 -Force		
}

# Enable hardware-accelerated GPU scheduling
Function EnableGPUScheduling {
	Write-Output "Enabling GPU Scheduling ..."
	# Determining whether PC has an external graphics card
	$AdapterDACType = Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {($_.AdapterDACType -ne "Internal") -and ($null -ne $_.AdapterDACType)}
	# Determining whether an OS is not installed on a virtual machine
	$ComputerSystemModel = (Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual"
	# Checking whether a WDDM verion is 2.7 or higher
	$WddmVersion_Min = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage", "WddmVersion_Min", $null)

	if ($AdapterDACType -and ($ComputerSystemModel -notmatch "Virtual") -and ($WddmVersion_Min -ge 2700))
	{
		New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers -Name HwSchMode -PropertyType DWord -Value 2 -Force
	}
}

# Disable hardware-accelerated GPU scheduling
Function DisableGPUScheduling {
	Write-Output "Disabling GPU Scheduling ..."
	New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers -Name HwSchMode -PropertyType DWord -Value 1 -Force
}

#endregion Gaming

#region Microsoft Defender & Security

# Enable Microsoft Defender Exploit Guard network protection
Function EnableNetworkProtection {
	Write-Output "Enabling Network Protection ..."
	if ((-not $Script:DefenderEnabled) -or $Script:DefenderMpPreferenceBroken)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	Set-MpPreference -EnableNetworkProtection Enabled
}

# Disable Microsoft Defender Exploit Guard network protection
Function DisableNetworkProtection {
	Write-Output "Disabling Network Protection ..."
	if ((-not $Script:DefenderEnabled) -or $Script:DefenderMpPreferenceBroken)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	Set-MpPreference -EnableNetworkProtection Disabled
}

# Enable detection for potentially unwanted applications and block them
Function EnablePUAppsDetection {
	Write-Output "Enabling PU Apps Detection ..."
	if ((-not $Script:DefenderEnabled) -or $Script:DefenderMpPreferenceBroken)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	Set-MpPreference -PUAProtection Enabled
}

# Disable detection for potentially unwanted applications and block them
Function DisablePUAppsDetection {
	Write-Output "Disabling PU Apps Detection ..."
	if ((-not $Script:DefenderEnabled) -or $Script:DefenderMpPreferenceBroken)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	Set-MpPreference -PUAProtection Disabled
}

# Enable sandboxing for Microsoft Defender
Function EnableDefenderSandbox {
	Write-Output "Enabling Defender Sandbox ..."
	if ((-not $Script:DefenderEnabled) -or $Script:DefenderMpPreferenceBroken)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	& "$env:SystemRoot\System32\setx.exe" /M MP_FORCE_USE_SANDBOX 1
}

# Disable sandboxing for Microsoft Defender
Function DisableDefenderSandbox {
	Write-Output "Disabling Defender Sandbox ..."
	if ((-not $Script:DefenderEnabled) -or $Script:DefenderMpPreferenceBroken)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	& "$env:SystemRoot\System32\setx.exe" /M MP_FORCE_USE_SANDBOX 0
}

# Create the "Process Creation" Event Viewer сustom view to log the executed processes and their arguments
Function EnableEventViewerCustomView {
	Write-Output "Enabling Event Viewer Custom View ..."
	# Enable events auditing generated when a process is created (starts)
	auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable

	# Include command line in process creation events
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -PropertyType DWord -Value 1 -Force
	#Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Type DWORD -Value 1

	$XML = @"
<ViewerConfig>
	<QueryConfig>
		<QueryParams>
			<UserQuery />
		</QueryParams>
		<QueryNode>
			<Name>$($Localization.EventViewerCustomViewName)</Name>
			<Description>$($Localization.EventViewerCustomViewDescription)</Description>
			<QueryList>
				<Query Id="0" Path="Security">
					<Select Path="Security">*[System[(EventID=4688)]]</Select>
				</Query>
			</QueryList>
		</QueryNode>
	</QueryConfig>
</ViewerConfig>
"@

	if (-not (Test-Path -Path "$env:ProgramData\Microsoft\Event Viewer\Views"))
	{
		New-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views" -ItemType Directory -Force
	}

	# Save ProcessCreation.xml in the UTF-8 with BOM encoding
	Set-Content -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Value $XML -Encoding UTF8 -Force
}

# Remove the "Process Creation" Event Viewer custom view
Function DisableEventViewerCustomView {
	Write-Output "Disabling Event Viewer Custom View ..."
	# Unlike in Windows 11 default value for Windows 10 is "disable" by default
	auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:disable /failure:disable
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Type CLEAR
	Remove-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Force -ErrorAction Ignore
}

# Enable logging for all Windows PowerShell modules
Function EnablePowerShellModulesLogging {
	Write-Output "Enabling PowerShell Modules Logging ..."
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames))
	{
		New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames -Force
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging -Name EnableModuleLogging -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames -Name * -PropertyType String -Value * -Force

	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging -Name EnableModuleLogging -Type DWORD -Value 1
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames -Name * -Type SZ -Value *
}

# Disable logging for all Windows PowerShell modules
Function DisablePowerShellModulesLogging {
	Write-Output "Disabling PowerShell Modules Logging ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging -Name EnableModuleLogging -Force -ErrorAction Ignore
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames -Name * -Force -ErrorAction Ignore

	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging -Name EnableModuleLogging -Type DELETE	
}

# Enable logging for all PowerShell scripts input to the Windows PowerShell event log
Function EnablePowerShellScriptsLogging {
	Write-Output "Enabling PowerShell Scripts Logging ..."
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging))
	{
		New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -Force
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -Name EnableScriptBlockLogging -PropertyType DWord -Value 1 -Force

	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -Name EnableScriptBlockLogging -Type DWORD -Value 1
}

# Disable logging for all PowerShell scripts input to the Windows PowerShell event log
Function DisablePowerShellScriptsLogging {
	Write-Output "Disabling PowerShell Scripts Logging ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -Name EnableScriptBlockLogging -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -Name EnableScriptBlockLogging -Type DELETE
}

# Enable apps and files checking within Microsoft Defender SmartScreen
Function EnableAppsSmartScreen {
	Write-Output "Enabling Apps SmartScreen ..."
	if ((-not $Script:DefenderEnabled) -or $Script:DefenderMpPreferenceBroken)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name SmartScreenEnabled -PropertyType String -Value Warn -Force		
}

# Disable apps and files checking within Microsoft Defender SmartScreen
Function DisableAppsSmartScreen {
	Write-Output "Disabling Apps SmartScreen ..."
	if ((-not $Script:DefenderEnabled) -or $Script:DefenderMpPreferenceBroken)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name SmartScreenEnabled -PropertyType String -Value Off -Force
}

# Microsoft Defender SmartScreen doesn't marks downloaded files from the Internet as unsafe
Function DisableSaveZoneInformation {
	Write-Output "Disabling Save Zone Information ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Type DELETE
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -PropertyType DWord -Value 1 -Force

	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Type DWORD -Value 1
}

# Microsoft Defender SmartScreen marks downloaded files from the Internet as unsafe
Function EnableSaveZoneInformation {
	Write-Output "Enabling Save Zone Information ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Type DELETE
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Attachments -Name SaveZoneInformation -Type DELETE
}

# Disable Windows Script Host
Function DisableWindowsScriptHost {
	Write-Output "Disabling Windows Script Host ..."
	# Check if any scheduled tasks were created before, because they rely on Windows Host running vbs files
	Get-ScheduledTask -TaskName SoftwareDistribution, Temp, "Windows Cleanup", "Windows Cleanup Notification" -ErrorAction Ignore | ForEach-Object -Process {
	# Skip if a scheduled task exists
		if ($_.State -eq "Ready")
		{
			break
		}
	}
	if (-not (Test-Path -Path "HKCU:\SOFTWARE\Microsoft\Windows Script Host\Settings"))
	{
		New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Force
	}
	New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -PropertyType DWord -Value 0 -Force
}

# Enable Windows Script Host
Function EnableWindowsScriptHost {
	Write-Output "Enabling Windows Script Host ..."
	Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
}

# Disable Windows Sandbox
Function DisableWindowsSandbox {
	Write-Output "Disabling Windows Sandbox ..."
	$EditionID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").EditionID
	if (($EditionID -notmatch "Professional") -and ($EditionID -notmatch "Enterprise") -and ($EditionID -notmatch "Education"))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	# Checking whether x86 virtualization is enabled in the firmware
	if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
	{
		Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
	}
	else
	{
		try
		{
			# Determining whether Hyper-V is enabled
			if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
			{
				Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
			}
		}
		catch [System.Exception]
		{
			Write-Error -Message $Localization.EnableHardwareVT -ErrorAction SilentlyContinue
			Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
		}
	}
}

# Enable Windows Sandbox
Function EnableWindowsSandbox {
	Write-Output "Enabling Windows Sandbox ..."
	$EditionID = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").EditionID
	if (($EditionID -notmatch "Professional") -and ($EditionID -notmatch "Enterprise") -and ($EditionID -notmatch "Education"))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	# Checking whether x86 virtualization is enabled in the firmware
	if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
	{
		Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
	}
	else
	{
		try
		{
			# Determining whether Hyper-V is enabled
			if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
			{
				Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
			}
		}
		catch [System.Exception]
		{
			Write-Error -Message $Localization.EnableHardwareVT -ErrorAction SilentlyContinue
			Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
		}
	}
}

#endregion Microsoft Defender & Security

#region Context menu

# Show the "Extract all" item in the Windows Installer (.msi) context menu
Function ShowMSIExtractContext {
	Write-Output "Showing MSI Extract Context ..."
	if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command))
	{
		New-Item -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command -Force
	}
	$Value = "msiexec.exe /a `"%1`" /qb TARGETDIR=`"%1 extracted`""
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command -Name "(default)" -PropertyType String -Value $Value -Force
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name MUIVerb -PropertyType String -Value "@shell32.dll,-37514" -Force
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name Icon -PropertyType String -Value "shell32.dll,-16817" -Force
}

# Hide the "Extract all" item from the Windows Installer (.msi) context menu
Function HideMSIExtractContext {
	Write-Output "Hiding MSI Extract Context ..."
	Remove-Item -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Recurse -Force -ErrorAction Ignore
}

# Show the "Install" item in the Cabinet (.cab) filenames extensions context menu
Function ShowCABInstallContext {
	Write-Output "Showing CAB Install Context ..."
	if ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.cab\UserChoice", "ProgId", $null) -eq "CABFolder")
	{
		if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas\Command))
		{
			New-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas\Command -Force
		}
		New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas\Command -Name "(default)" -PropertyType String -Value "cmd /c DISM.exe /Online /Add-Package /PackagePath:`"%1`" /NoRestart & pause" -Force
		New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas -Name MUIVerb -PropertyType String -Value "@shell32.dll,-10210" -Force
		New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas -Name HasLUAShield -PropertyType String -Value "" -Force
	}
	else
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
}

# Hide the "Install" item from the Cabinet (.cab) filenames extensions context menu
Function HideCABInstallContext {
	Write-Output "Hiding CAB Install Context ..."
	Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\runas -Recurse -Force -ErrorAction Ignore
}

# Hide the "Cast to Device" item from the media files and folders context menu
Function HideCastToDeviceContext {
	Write-Output "Hiding Cast To Device Context ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore
	if (-not (Test-Path -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"))
	{
		New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Force
	}
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force
}

# Show the "Cast to Device" item in the media files and folders context menu
Function ShowCastToDeviceContext {
	Write-Output "Showing Cast To Device Context ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore
}

# Show the "Share" item in the context menu
Function ShowShareContext {
	Write-Output "Showing Share Context ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
	Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
}

# Hide the "Share" item from the context menu
Function HideShareContext {
	Write-Output "Hiding Share Context ..."
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
	if (-not (Test-Path -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"))
	{
		New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Force
	}
	New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force
}

# Hide the "Edit with Paint 3D" item from the media files context menu
Function HideEditWithPaint3DContext {
	Write-Output "Hiding Edit With Paint3D Context ..."
	if (-not (Get-AppxPackage -Name Microsoft.MSPaint))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	$Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff")
	$Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff")
	foreach ($Extension in $Extensions)
	{
		New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$Extension\Shell\3D Edit" -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force
	}
}

# Show the "Edit with Paint 3D" item in the media files context menu
Function ShowEditWithPaint3DContext {
	Write-Output "Showing Edit With Paint3D Context ..."
	if (-not (Get-AppxPackage -Name Microsoft.MSPaint))
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}

	$Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff")
	$Extensions = @(".bmp", ".gif", ".jpe", ".jpeg", ".jpg", ".png", ".tif", ".tiff")
	foreach ($Extension in $Extensions)
	{
		Remove-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\$Extension\Shell\3D Edit" -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore
	}
}

# Show the "Edit" item in the images context menu
Function ShowImagesEditContext {
	Write-Output "Showing Images Edit Context ..."
	if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*").State -ne "Installed")
	{
		return
	}
	Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore
}

# Hide the "Edit" item from the images context menu
Function HideImagesEditContext {
	Write-Output "Hiding Images Edit Context ..."
	if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*").State -ne "Installed")
	{
		return
	}
	if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit))
	{
		New-Item -Path Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit -Force
	}
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force
}

# Hide the "Print" item from the .bat and .cmd context menu
Function HidePrintCMDContext {
	Write-Output "Hiding Print CMD Context ..."
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\batfile\shell\print -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\cmdfile\shell\print -Name ProgrammaticAccessOnly -PropertyType String -Value "" -Force
}

# Show the "Print" item in the .bat and .cmd context menu
Function ShowPrintCMDContext {
	Write-Output "Showing Print CMD Context ..."
	Remove-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\batfile\shell\print, Registry::HKEY_CLASSES_ROOT\cmdfile\shell\print -Name ProgrammaticAccessOnly -Force -ErrorAction Ignore
}

# Hide the "Include in Library" item from the folders and drives context menu
Function HideIncludeInLibraryContext {
	Write-Output "Hiding Include In Library Context ..."
	New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Library Location" -Name "(default)" -PropertyType String -Value "-{3dad6c5d-2167-4cae-9914-f99e41c12cfa}" -Force
}


# Show the "Include in Library" item in the folders and drives context menu
Function ShowIncludeInLibraryContext {
	Write-Output "Showing Include In Library Context ..."
	New-ItemProperty -Path "Registry::HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Library Location" -Name "(default)" -PropertyType String -Value "{3dad6c5d-2167-4cae-9914-f99e41c12cfa}" -Force
}

# Hide the "Send to" item from the folders context menu
Function HideSendToContext {
	Write-Output "Hiding Send To Context ..."
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\SendTo -Name "(default)" -PropertyType String -Value "-{7BA4C740-9E81-11CF-99D3-00AA004AE837}" -Force
}

# Show the "Send to" item in the folders context menu
Function ShowSendToContext {
	Write-Output "Showing Send To Context ..."
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\SendTo -Name "(default)" -PropertyType String -Value "{7BA4C740-9E81-11CF-99D3-00AA004AE837}" -Force
}

# Hide the "Bitmap image" item from the "New" context menu
Function HideBitmapImageNewContext {
	Write-Output "Hiding Bitmap Image New Context ..."
	if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*").State -eq "Installed")
	{
		Remove-Item -Path Registry::HKEY_CLASSES_ROOT\.bmp\ShellNew -Force -ErrorAction Ignore
	}
}

# Show the "Bitmap image" item to the "New" context menu
Function ShowBitmapImageNewContext {
	Write-Output "Showing Bitmap Image New Context ..."
	if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*").State -eq "Installed")
	{
		if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\.bmp\ShellNew))
		{
			New-Item -Path Registry::HKEY_CLASSES_ROOT\.bmp\ShellNew -Force
		}
		New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.bmp\ShellNew -Name ItemName -PropertyType ExpandString -Value "@%SystemRoot%\System32\mspaint.exe,-59414" -Force
		New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.bmp\ShellNew -Name NullFile -PropertyType String -Value "" -Force
	}
	else
	{
		try
		{
			Write-Information -MessageData "" -InformationAction Continue
			Write-Verbose -Message $Localization.Patient -Verbose
	
			Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*" | Add-WindowsCapability -Online
		}
		catch [System.Runtime.InteropServices.COMException]
		{
			Write-Warning -Message ($Localization.NoResponse -f "http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice")
			Write-Error -Message ($Localization.NoResponse -f "http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice") -ErrorAction SilentlyContinue
			Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
		}
	}
}

# Show the "Rich Text Document" item to the "New" context menu
Function ShowRichTextDocumentNewContext {
	Write-Output "Showing Rich Text Document New Context ..."
	if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.WordPad*").State -eq "Installed")
	{
		if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\.rtf\ShellNew))
		{
			New-Item -Path Registry::HKEY_CLASSES_ROOT\.rtf\ShellNew -Force
		}
		New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.rtf\ShellNew -Name Data -PropertyType String -Value "{\rtf1}" -Force
		New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.rtf\ShellNew -Name ItemName -PropertyType ExpandString -Value "@%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE,-213" -Force
	}
	else
	{
		try
		{
			Write-Information -MessageData "" -InformationAction Continue
			Write-Verbose -Message $Localization.Patient -Verbose

			Get-WindowsCapability -Online -Name "Microsoft.Windows.WordPad*" | Add-WindowsCapability -Online
		}
		catch [System.Runtime.InteropServices.COMException]
		{
			Write-Warning -Message ($Localization.NoResponse -f "http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice")
			Write-Error -Message ($Localization.NoResponse -f "http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice") -ErrorAction SilentlyContinue
			Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
		}
	}
}

# Hide the "Rich Text Document" item from the "New" context menu
Function HideRichTextDocumentNewContext {
	Write-Output "Hiding Rich Text Document New Context ..."
	if ((Get-WindowsCapability -Online -Name "Microsoft.Windows.WordPad*").State -eq "Installed")
	{
		Remove-Item -Path Registry::HKEY_CLASSES_ROOT\.rtf\ShellNew -Force -ErrorAction Ignore
	}
}

# Hide the "Compressed (zipped) Folder" item from the "New" context menu
Function HideCompressedFolderNewContext {
	Write-Output "Hiding Compressed Folder New Context ..."
	Remove-Item -Path Registry::HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew -Force -ErrorAction Ignore
}

# Show the "Compressed (zipped) Folder" item to the "New" context menu
Function ShowCompressedFolderNewContext {
	Write-Output "Showing Compressed Folder New Context ..."
	if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew))
	{
		New-Item -Path Registry::HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew -Force
	}
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew -Name Data -PropertyType Binary -Value ([byte[]](80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)) -Force
	New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew -Name ItemName -PropertyType ExpandString -Value "@%SystemRoot%\system32\zipfldr.dll,-10194" -Force
}

# Enable the "Open", "Print", and "Edit" items if more than 15 files selected
Function EnableMultipleInvokeContext {
	Write-Output "Enabling Multiple Invoke Context ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name MultipleInvokePromptMinimum -PropertyType DWord -Value 300 -Force
}

# Disable the "Open", "Print", and "Edit" items if more than 15 files selected
Function DisableMultipleInvokeContext {
	Write-Output "Disabling Multiple Invoke Context ..."
	Remove-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name MultipleInvokePromptMinimum -Force -ErrorAction Ignore
}

# Hide the "Look for an app in the Microsoft Store" item in the "Open with" dialog
Function HideUseStoreOpenWith {
	Write-Output "Hiding Use Store Open With ..."
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer))
	{
		New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -PropertyType DWord -Value 1 -Force
}

# Show the "Look for an app in the Microsoft Store" item in the "Open with" dialog
Function ShowUseStoreOpenWith {
	Write-Output "Showing Use Store Open With ..."
	Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Force -ErrorAction Ignore
}

#endregion Context menu

#region Other

# Hide the search on the taskbar
Function HideTaskbarSearch {
	Write-Output "Hiding Taskbar Search ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name DisableSearch, SearchOnTaskbarMode -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name DisableSearch -Type DELETE
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name SearchOnTaskbarMode -Type DELETE

	# Checking whether small taskbar buttons enabled
	# We have to use GetValue() due to "Set-StrictMode -Version Latest"
	$TaskbarSmallIcons = ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSmallIcons", $null))
	if ($TaskbarSmallIcons -eq 1)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Search -Name SearchboxTaskbarMode -PropertyType DWord -Value 0 -Force
}

# Show the search icon on the taskbar
Function SearchIconTaskbarSearch {
	Write-Output "Showing Search Icon Taskbar Search ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name DisableSearch, SearchOnTaskbarMode -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name DisableSearch -Type DELETE
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name SearchOnTaskbarMode -Type DELETE

	# Checking whether small taskbar buttons enabled
	# We have to use GetValue() due to "Set-StrictMode -Version Latest"
	$TaskbarSmallIcons = ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSmallIcons", $null))
	if ($TaskbarSmallIcons -eq 1)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Search -Name SearchboxTaskbarMode -PropertyType DWord -Value 1 -Force
}

# Show the search box on the taskbar
Function SearchBoxTaskbarSearch {
	Write-Output "Showing Search Box Taskbar Search ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name DisableSearch, SearchOnTaskbarMode -Force -ErrorAction Ignore
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name DisableSearch -Type DELETE
	Set-Policy -Scope Computer -Path "SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name SearchOnTaskbarMode -Type DELETE

	# Checking whether small taskbar buttons enabled
	# We have to use GetValue() due to "Set-StrictMode -Version Latest"
	$TaskbarSmallIcons = ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSmallIcons", $null))
	if ($TaskbarSmallIcons -eq 1)
	{
		Write-Information -MessageData "" -InformationAction Continue
		Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose
		Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue

		return
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Search -Name SearchboxTaskbarMode -PropertyType DWord -Value 2 -Force
}

# Taskbar Always combine, hide labels
Function AlwaysCombineHideLabelsTaskbar {
	Write-Output "Setting Taskbar to Always combine, hide labels ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name TaskbarGlomLevel -PropertyType DWord -Value 0 -Force
}

# Taskbar Combine when taskbar is full
Function CombineWhenFullTaskbar {
	Write-Output "Setting Taskbar to combine when taskbar is full ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name TaskbarGlomLevel -PropertyType DWord -Value 1 -Force
}

# Taskbar Never combine
Function NeverCombineTaskbar {
	Write-Output "Setting Taskbar to never combine ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name TaskbarGlomLevel -PropertyType DWord -Value 2 -Force
}

# View the Control Panel icons by category
Function CategoryControlPanelView {
	Write-Output "Setting Category Control Panel View ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ForceClassicControlPanel -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ForceClassicControlPanel -Type DELETE

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Name AllItemsIconView -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Name StartupPage -PropertyType DWord -Value 0 -Force
}

# View the Control Panel icons by large icons
Function LargeIconsControlPanelView {
	Write-Output "Setting Large Icons Control Panel View ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ForceClassicControlPanel -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ForceClassicControlPanel -Type DELETE

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Name AllItemsIconView -PropertyType DWord -Value 0 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Name StartupPage -PropertyType DWord -Value 1 -Force
}

# View the Control Panel icons by small icons
Function SmallIconsControlPanelView {
	Write-Output "Setting Small Icons Control Panel View ..."
	# Remove all policies in order to make changes visible in UI
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ForceClassicControlPanel -Force -ErrorAction Ignore
	Set-Policy -Scope User -Path Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name ForceClassicControlPanel -Type DELETE

	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Name AllItemsIconView -PropertyType DWord -Value 1 -Force
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel -Name StartupPage -PropertyType DWord -Value 1 -Force
}

#endregion Other


# Holder for None (Must keep)
Function None {
}

# Relaunch the script with administrator privileges
Function RequireAdmin {
	If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
		Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" $PSCommandArgs" -WorkingDirectory $pwd -Verb RunAs
		Exit
	}
}

# Create Restore Point
Function CreateRestorePoint {
  Write-Output "Creating Restore Point incase something bad happens"
  Enable-ComputerRestore -Drive "C:\"
  Checkpoint-Computer -Description "RestorePoint1" -RestorePointType "MODIFY_SETTINGS"
}


Function Global:Set-Policy
{
	[CmdletBinding()]
	param
	(
		[Parameter(
			Mandatory = $true,
			Position = 1
		)]
		[string]
		[ValidateSet("Computer", "User")]
		$Scope,

		[Parameter(
			Mandatory = $true,
			Position = 2
		)]
		[string]
		$Path,

		[Parameter(
			Mandatory = $true,
			Position = 3
		)]
		[string]
		$Name,

		[Parameter(
			Mandatory = $true,
			Position = 4
		)]
		[ValidateSet("DWORD", "SZ", "EXSZ", "DELETE")]
		[string]
		$Type,

		[Parameter(
			Mandatory = $false,
			Position = 5
		)]
		$Value
	)

	if (-not (Test-Path -Path "$env:SystemRoot\System32\gpedit.msc"))
	{
		return
	}

	switch ($Type)
	{
		"DELETE"
		{
			$Policy = @"
$Scope
$($Path)
$($Name)
$($Type)`n
"@
		}
		default
		{
			$Policy = @"
$Scope
$($Path)
$($Name)
$($Type):$($Value)`n
"@
		}
	}

	# Save in UTF8 without BOM
	Add-Content -Path "$env:TEMP\LGPO.txt" -Value $Policy -Encoding Default -Force
}


# Normalize path to preset file
$preset = ""
$PSCommandArgs = $args
If ($args -And $args[0].ToLower() -eq "-preset") {
	$preset = Resolve-Path $($args | Select-Object -Skip 1)
	$PSCommandArgs = "-preset `"$preset`""
}

# Load function names from command line arguments or a preset file
If ($args) {
	$tweaks = $args
	If ($preset) {
		$tweaks = Get-Content $preset -ErrorAction Stop | ForEach { $_.Trim() } | Where { $_ -ne "" -and $_[0] -ne "#" }
	}
}

# Call the desired tweak functions
$tweaks | ForEach { Invoke-Expression $_ }