2022-04-27 22:42:07 -05:00
<#
. NOTES
Author : Chris Titus @christitustech
GitHub : https : / / github . com / ChrisTitusTech
Version 0.0 . 1
#>
$inputXML = @"
< Window x: Class = " WinUtility.MainWindow "
xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation "
xmlns : x = " http://schemas.microsoft.com/winfx/2006/xaml "
xmlns : d = " http://schemas.microsoft.com/expression/blend/2008 "
xmlns : mc = " http://schemas.openxmlformats.org/markup-compatibility/2006 "
xmlns : local = " clr-namespace:WinUtility "
mc : Ignorable = " d "
Background = " #777777 "
2022-04-29 23:11:51 -05:00
Title = " Chris Titus Tech's Windows Utility " Height = " 533 " Width = " 786 " >
< Viewbox >
< Grid Background = " #777777 " ShowGridLines = " False " Name = " MainGrid " >
< Grid . ColumnDefinitions >
< ColumnDefinition Width = " 3* " / >
< ColumnDefinition Width = " 7* " / >
< / Grid . ColumnDefinitions >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Column = " 0 " >
< Image Height = " 200 " Width = " 200 " Name = " Icon " SnapsToDevicePixels = " True " Source = " https://christitus.com/images/logo-full.png " Margin = " 0,10,0,10 " / >
< Button Content = " Install " VerticalAlignment = " Top " Height = " 40 " Background = " #222222 " BorderThickness = " 0,0,0,0 " FontWeight = " Bold " Foreground = " #ffffff " Name = " Tab1BT " / >
< Button Content = " Tweaks " VerticalAlignment = " Top " Height = " 40 " Background = " #333333 " BorderThickness = " 0,0,0,0 " FontWeight = " Bold " Foreground = " #ffffff " Name = " Tab2BT " / >
< Button Content = " Config " VerticalAlignment = " Top " Height = " 40 " Background = " #444444 " BorderThickness = " 0,0,0,0 " FontWeight = " Bold " Foreground = " #ffffff " Name = " Tab3BT " / >
< Button Content = " Updates " VerticalAlignment = " Top " Height = " 40 " Background = " #555555 " BorderThickness = " 0,0,0,0 " FontWeight = " Bold " Foreground = " #ffffff " Name = " Tab4BT " / >
< / StackPanel >
< TabControl Grid . Column = " 1 " Padding = " -1 " Name = " TabNav " SelectedIndex = " 0 " >
< TabItem Header = " Install " Visibility = " Collapsed " Name = " Tab1 " >
< Grid Background = " #222222 " >
< Grid . ColumnDefinitions >
< ColumnDefinition Width = " 1* " / >
< ColumnDefinition Width = " 1* " / >
< ColumnDefinition Width = " 1* " / >
< / Grid . ColumnDefinitions >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Column = " 0 " Margin = " 10 " >
< Label Content = " Browsers " FontSize = " 16 " Margin = " 5,0 " / >
< CheckBox Name = " Installbrave " Content = " Brave " Margin = " 5,0 " / >
< CheckBox Name = " Installchrome " Content = " Google Chrome " Margin = " 5,0 " / >
< CheckBox Name = " Installchromium " Content = " Un-Googled Chromium " Margin = " 5,0 " / >
< CheckBox Name = " Installfirefox " Content = " Firefox " Margin = " 5,0 " / >
< CheckBox Name = " Installlibrewolf " Content = " LibreWolf " Margin = " 5,0 " / >
< CheckBox Name = " Installvivaldi " Content = " Vivaldi " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
< Label Content = " Communications " FontSize = " 16 " Margin = " 5,0 " / >
< CheckBox Name = " Installdiscord " Content = " Discord " Margin = " 5,0 " / >
< CheckBox Name = " Installhexchat " Content = " Hexchat " Margin = " 5,0 " / >
< CheckBox Name = " Installmatrix " Content = " Matrix " Margin = " 5,0 " / >
< CheckBox Name = " Installsignal " Content = " Signal " Margin = " 5,0 " / >
< CheckBox Name = " Installskype " Content = " Skype " Margin = " 5,0 " / >
< CheckBox Name = " Installslack " Content = " Slack " Margin = " 5,0 " / >
< CheckBox Name = " Installteams " Content = " Microsoft Teams " Margin = " 5,0 " / >
< CheckBox Name = " Installzoom " Content = " Zoom Video Conference " Margin = " 5,0 " / >
< Label Content = " Development " FontSize = " 16 " Margin = " 5,0 " / >
< CheckBox Name = " Installatom " Content = " Atom " Margin = " 5,0 " / >
< CheckBox Name = " Installgithubdesktop " Content = " GitHub Desktop " Margin = " 5,0 " / >
< CheckBox Name = " Installjava8 " Content = " OpenJDK Java 8 " Margin = " 5,0 " / >
< CheckBox Name = " Installjava16 " Content = " OpenJDK Java 16 " Margin = " 5,0 " / >
< CheckBox Name = " Installjava18 " Content = " Oracle Java 18 " Margin = " 5,0 " / >
< CheckBox Name = " Installjetbrains " Content = " Jetbrains Toolbox " Margin = " 5,0 " / >
< CheckBox Name = " Installnodejs " Content = " NodeJS " Margin = " 5,0 " / >
< CheckBox Name = " Installnodejslts " Content = " NodeJS LTS " Margin = " 5,0 " / >
< CheckBox Name = " Installpython3 " Content = " Python3 " Margin = " 5,0 " / >
< CheckBox Name = " Installsublime " Content = " Sublime " Margin = " 5,0 " / >
< CheckBox Name = " Installvisualstudio " Content = " Visual Studio 2022 Community " Margin = " 5,0 " / >
< CheckBox Name = " Installvscode " Content = " VS Code " Margin = " 5,0 " / >
< CheckBox Name = " Installvscodium " Content = " VS Codium " Margin = " 5,0 " / >
< / StackPanel >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Column = " 1 " Margin = " 10 " >
< Label Content = " Document " FontSize = " 16 " Margin = " 5,0 " / >
2022-04-29 23:11:51 -05:00
< CheckBox Name = " Installadobe " Content = " Adobe Reader DC " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
< CheckBox Name = " Installlibreoffice " Content = " LibreOffice " Margin = " 5,0 " / >
2022-04-29 23:11:51 -05:00
< CheckBox Name = " Installnotepadplus " Content = " Notepad++ " Margin = " 5,0 " / >
< CheckBox Name = " Installobsidian " Content = " Obsidian " Margin = " 5,0 " / >
< CheckBox Name = " Installsumatra " Content = " Sumatra PDF " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
2022-04-29 23:11:51 -05:00
< Label Content = " Games " FontSize = " 16 " Margin = " 5,0 " / >
< CheckBox Name = " Installepicgames " Content = " Epic Games Launcher " Margin = " 5,0 " / >
< CheckBox Name = " Installgog " Content = " GOG Galaxy " Margin = " 5,0 " / >
< CheckBox Name = " Installsteam " Content = " Steam " Margin = " 5,0 " / >
< Label Content = " Pro Tools " FontSize = " 16 " Margin = " 5,0 " / >
< CheckBox Name = " Installadvancedip " Content = " Advanced IP Scanner " Margin = " 5,0 " / >
< CheckBox Name = " Installmremoteng " Content = " mRemoteNG " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
< CheckBox Name = " Installputty " Content = " Putty " Margin = " 5,0 " / >
< CheckBox Name = " Installscp " Content = " WinSCP " Margin = " 5,0 " / >
2022-04-29 23:11:51 -05:00
< CheckBox Name = " Installwireshark " Content = " WireShark " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
2022-04-29 23:11:51 -05:00
< Label Content = " Multimedia Tools " FontSize = " 16 " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
< CheckBox Name = " Installaudacity " Content = " Audacity " Margin = " 5,0 " / >
2022-04-29 23:11:51 -05:00
< CheckBox Name = " Installblender " Content = " Blender (3D Graphics) " Margin = " 5,0 " / >
< CheckBox Name = " Installeartrumpet " Content = " Eartrumpet (Audio) " Margin = " 5,0 " / >
< CheckBox Name = " Installflameshot " Content = " Flameshot (Screenshots) " Margin = " 5,0 " / >
< CheckBox Name = " Installfoobar " Content = " Foobar2000 (Music Player) " Margin = " 5,0 " / >
< CheckBox Name = " Installgimp " Content = " GIMP (Image Editor) " Margin = " 5,0 " / >
< CheckBox Name = " Installgreenshot " Content = " Greenshot (Screenshots) " Margin = " 5,0 " / >
< CheckBox Name = " Installhandbrake " Content = " HandBrake " Margin = " 5,0 " / >
< CheckBox Name = " Installimageglass " Content = " ImageGlass (Image Viewer) " Margin = " 5,0 " / >
< CheckBox Name = " Installinkscape " Content = " Inkscape " Margin = " 5,0 " / >
< CheckBox Name = " Installmpc " Content = " Media Player Classic (Video Player) " Margin = " 5,0 " / >
< CheckBox Name = " Installobs " Content = " OBS Studio " Margin = " 5,0 " / >
< CheckBox Name = " Installsharex " Content = " ShareX (Screenshots) " Margin = " 5,0 " / >
< CheckBox Name = " Installspotify " Content = " Spotify " Margin = " 5,0 " / >
< CheckBox Name = " Installvlc " Content = " VLC (Video Player) " Margin = " 5,0 " / >
< CheckBox Name = " Installvoicemeeter " Content = " Voicemeeter (Audio) " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
2022-04-29 23:11:51 -05:00
< / StackPanel >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Column = " 2 " Margin = " 10 " >
< Label Content = " Utilities " FontSize = " 16 " Margin = " 5,0 " / >
< CheckBox Name = " Installsevenzip " Content = " 7-Zip " Margin = " 5,0 " / >
< CheckBox Name = " Installanydesk " Content = " AnyDesk " Margin = " 5,0 " / >
< CheckBox Name = " Installautohotkey " Content = " AutoHotkey " Margin = " 5,0 " / >
< CheckBox Name = " Installbitwarden " Content = " Bitwarden " Margin = " 5,0 " / >
< CheckBox Name = " Installcpuz " Content = " CPU-Z " Margin = " 5,0 " / >
< CheckBox Name = " Installetcher " Content = " Etcher USB Creator " Margin = " 5,0 " / >
< CheckBox Name = " Installesearch " Content = " Everything Search " Margin = " 5,0 " / >
< CheckBox Name = " Installgpuz " Content = " GPU-Z " Margin = " 5,0 " / >
< CheckBox Name = " Installhwinfo " Content = " HWInfo " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
< CheckBox Name = " Installkeepass " Content = " KeePassXC " Margin = " 5,0 " / >
2022-04-29 23:11:51 -05:00
< CheckBox Name = " Installmalwarebytes " Content = " MalwareBytes " Margin = " 5,0 " / >
< CheckBox Name = " Installnvclean " Content = " NVCleanstall " Margin = " 5,0 " / >
< CheckBox Name = " Installpowertoys " Content = " Microsoft Powertoys " Margin = " 5,0 " / >
< CheckBox Name = " Installrevo " Content = " RevoUninstaller " Margin = " 5,0 " / >
< CheckBox Name = " Installrufus " Content = " Rufus Imager " Margin = " 5,0 " / >
< CheckBox Name = " Installteamviewer " Content = " TeamViewer " Margin = " 5,0 " / >
< CheckBox Name = " Installttaskbar " Content = " Translucent Taskbar " Margin = " 5,0 " / >
< CheckBox Name = " Installtreesize " Content = " TreeSize Free " Margin = " 5,0 " / >
< CheckBox Name = " Installwindirstat " Content = " WinDirStat " Margin = " 5,0 " / >
< CheckBox Name = " Installterminal " Content = " Windows Terminal " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
< Button Name = " install " Background = " AliceBlue " Content = " Start Install " Margin = " 20,5,20,5 " ToolTip = " Install all checked programs " / >
< Button Name = " InstallUpgrade " Background = " AliceBlue " Content = " Upgrade Installs " Margin = " 20,5,20,5 " ToolTip = " Upgrade All Existing Programs on System " / >
2022-04-29 23:11:51 -05:00
< / StackPanel >
< / Grid >
< / TabItem >
< TabItem Header = " Tweaks " Visibility = " Collapsed " Name = " Tab2 " >
< Grid Background = " #333333 " >
< Grid . ColumnDefinitions >
< ColumnDefinition Width = " 1* " / >
< ColumnDefinition Width = " 1* " / >
< / Grid . ColumnDefinitions >
< Grid . RowDefinitions >
< RowDefinition Height = " 1* " / >
< RowDefinition Height = " 6* " / >
< / Grid . RowDefinitions >
< StackPanel Background = " #777777 " Orientation = " Horizontal " Grid . Row = " 0 " HorizontalAlignment = " Center " Grid . ColumnSpan = " 2 " >
< Label Content = " Recommended Selections: " FontSize = " 17 " VerticalAlignment = " Center " / >
< Button Name = " desktop " Content = " Desktop " Margin = " 7 " / >
< Button Name = " laptop " Content = " Laptop " Margin = " 7 " / >
< Button Name = " minimal " Content = " Minimal " Margin = " 7 " / >
< / StackPanel >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Row = " 1 " Grid . Column = " 0 " Margin = " 10,5 " >
< Label FontSize = " 16 " Content = " Essential Tweaks " / >
< CheckBox Name = " EssTweaksRP " Content = " Create Restore Point " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksOO " Content = " Run O and O Shutup " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksTele " Content = " Disable Telemetry " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksWifi " Content = " Disable Wifi-Sense " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksAH " Content = " Disable Activity History " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksLoc " Content = " Disable Location Tracking " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksHome " Content = " Disable Homegroup " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksStorage " Content = " Disable Storage Sense " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksHiber " Content = " Disable Hibernation " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksDVR " Content = " Disable GameDVR " Margin = " 5,0 " / >
< CheckBox Name = " EssTweaksServices " Content = " Set Services to Manual " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
2022-04-29 23:11:51 -05:00
< / StackPanel >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Row = " 1 " Grid . Column = " 1 " Margin = " 10,5 " >
< Label FontSize = " 16 " Content = " Misc. Tweaks " / >
< CheckBox Name = " MiscTweaksPower " Content = " Disable Power Throttling " Margin = " 5,0 " / >
< CheckBox Name = " MiscTweaksLapPower " Content = " Enable Power Throttling " Margin = " 5,0 " / >
< CheckBox Name = " MiscTweaksNum " Content = " Enable NumLock on Startup " Margin = " 5,0 " / >
< CheckBox Name = " MiscTweaksLapNum " Content = " Disable Numlock on Startup " Margin = " 5,0 " / >
< CheckBox Name = " MiscTweaksExt " Content = " Show File Extensions " Margin = " 5,0 " / >
< CheckBox Name = " MiscTweaksDisplay " Content = " Set Display for Performance " Margin = " 5,0 " / >
< CheckBox Name = " MiscTweaksUTC " Content = " Set Time to UTC (Dual Boot) " Margin = " 5,0 " / >
2022-05-10 08:18:13 -05:00
< CheckBox Name = " EssTweaksDeBloat " Content = " Remove ALL MS Store Apps " Margin = " 5,0 " / >
2022-04-29 23:11:51 -05:00
< Button Name = " tweaksbutton " Background = " AliceBlue " Content = " Run Tweaks " Margin = " 20,10,20,0 " / >
< Button Name = " undoall " Background = " AliceBlue " Content = " Undo All Tweaks " Margin = " 20,5 " / >
< / StackPanel >
< / Grid >
< / TabItem >
< TabItem Header = " Config " Visibility = " Collapsed " Name = " Tab3 " >
2022-05-10 08:18:13 -05:00
< Grid Background = " #444444 " >
2022-04-29 23:11:51 -05:00
< Grid . ColumnDefinitions >
< ColumnDefinition Width = " 1* " / >
< ColumnDefinition Width = " 1* " / >
< / Grid . ColumnDefinitions >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Column = " 0 " Margin = " 10,5 " >
< Label Content = " Features " FontSize = " 16 " / >
2022-05-10 08:18:13 -05:00
< CheckBox Name = " Featuresdotnet " Content = " All .Net Framework (2,3,4) " Margin = " 5,0 " / >
< CheckBox Name = " Featureshyperv " Content = " HyperV Virtualization " Margin = " 5,0 " / >
< CheckBox Name = " Featureslegacymedia " Content = " Legacy Media (WMP, DirectPlay) " Margin = " 5,0 " / >
< CheckBox Name = " Featurenfs " Content = " NFS - Network File System " Margin = " 5,0 " / >
< CheckBox Name = " Featurewsl " Content = " Windows Subsystem for Linux " Margin = " 5,0 " / >
< Button Name = " FeatureInstall " FontSize = " 14 " Background = " AliceBlue " Content = " Install Features " Margin = " 20,5,20,0 " Padding = " 10 " / >
< Label Content = " Fixes " FontSize = " 16 " / >
< Button Name = " FixesUpdate " FontSize = " 14 " Background = " AliceBlue " Content = " Reset Windows Update " Margin = " 20,5,20,0 " Padding = " 10 " / >
2022-04-29 23:11:51 -05:00
< / StackPanel >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Column = " 1 " Margin = " 10,5 " >
2022-05-10 08:18:13 -05:00
< Label Content = " Legacy Windows Panels " FontSize = " 16 " / >
< Button Name = " Panelcontrol " FontSize = " 14 " Background = " AliceBlue " Content = " Control Panel " Margin = " 20,5,20,5 " Padding = " 10 " / >
< Button Name = " Panelnetwork " FontSize = " 14 " Background = " AliceBlue " Content = " Network Connections " Margin = " 20,0,20,5 " Padding = " 10 " / >
< Button Name = " Panelpower " FontSize = " 14 " Background = " AliceBlue " Content = " Power Panel " Margin = " 20,0,20,5 " Padding = " 10 " / >
< Button Name = " Panelsound " FontSize = " 14 " Background = " AliceBlue " Content = " Sound Settings " Margin = " 20,0,20,5 " Padding = " 10 " / >
< Button Name = " Panelsystem " FontSize = " 14 " Background = " AliceBlue " Content = " System Properties " Margin = " 20,0,20,5 " Padding = " 10 " / >
< Button Name = " Paneluser " FontSize = " 14 " Background = " AliceBlue " Content = " User Accounts " Margin = " 20,0,20,5 " Padding = " 10 " / >
2022-04-29 23:11:51 -05:00
< / StackPanel >
< / Grid >
< / TabItem >
< TabItem Header = " Updates " Visibility = " Collapsed " Name = " Tab4 " >
2022-05-10 08:18:13 -05:00
< Grid Background = " #555555 " >
< Grid . RowDefinitions >
< RowDefinition / >
< RowDefinition / >
< RowDefinition / >
< / Grid . RowDefinitions >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Row = " 0 " Margin = " 10,5 " >
< TextBlock Text = " This is the default settings that come with Windows. No modifications are made and will remove any custom windows update settings. " Margin = " 20,0,20,0 " Padding = " 10 " TextWrapping = " WrapWithOverflow " MaxWidth = " 300 " / >
< Button Name = " Updatesdefault " FontSize = " 16 " Background = " AliceBlue " Content = " Default (Out of Box) Settings " Margin = " 20,0,20,10 " Padding = " 10 " / >
< / StackPanel >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Row = " 1 " Margin = " 10,5 " >
< TextBlock Text = " This is my recommended setting I use on all computers. It will delay feature updates by 2 years and will install security updates 4 days after release. These are the settings I use in buisness environments. " Margin = " 20,0,20,0 " Padding = " 10 " TextWrapping = " WrapWithOverflow " MaxWidth = " 300 " / >
< Button Name = " Updatessecurity " FontSize = " 16 " Background = " AliceBlue " Content = " Security (Recommended) Settings " Margin = " 20,0,20,10 " Padding = " 10 " / >
< / StackPanel >
< StackPanel Background = " #777777 " SnapsToDevicePixels = " True " Grid . Row = " 2 " Margin = " 10,5 " >
< TextBlock Text = " This completely disables ALL Windows Updates and is NOT RECOMMENDED. You system will be easier to hack and infect without security updates. However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. " Margin = " 20,0,20,0 " Padding = " 10 " TextWrapping = " WrapWithOverflow " MaxWidth = " 300 " / >
< Button Name = " Updatesdisable " FontSize = " 16 " Background = " AliceBlue " Content = " Disable ALL Updates (NOT RECOMMENDED!) " Margin = " 20,0,20,10 " Padding = " 10 " / >
< / StackPanel >
2022-04-29 23:11:51 -05:00
< / Grid >
< / TabItem >
< / TabControl >
< / Grid >
< / Viewbox >
2022-04-27 22:42:07 -05:00
< / Window >
2022-04-29 23:11:51 -05:00
2022-04-27 22:42:07 -05:00
" @
$inputXML = $inputXML -replace 'mc:Ignorable="d"' , '' -replace " x:N " , 'N' -replace '^<Win.*' , '<Window'
[ void][System.Reflection.Assembly ] :: LoadWithPartialName ( 'presentationframework' )
[ xml ] $XAML = $inputXML
#Read XAML
2022-05-17 09:31:18 -05:00
$reader = ( New-Object System . Xml . XmlNodeReader $xaml )
try { $Form = [ Windows.Markup.XamlReader ] :: Load ( $reader ) }
2022-04-27 22:42:07 -05:00
catch [ System.Management.Automation.MethodInvocationException ] {
Write-Warning " We ran into a problem with the XAML code. Check the syntax for this control... "
write-host $error [ 0 ] . Exception . Message -ForegroundColor Red
2022-05-17 09:31:18 -05:00
If ( $error [ 0 ] . Exception . Message -like " *button* " ) {
write-warning " Ensure your <button in the `$ inputXML does NOT have a Click=ButtonClick property. PS can't handle this `n `n `n `n "
}
2022-04-27 22:42:07 -05:00
}
2022-05-17 09:31:18 -05:00
catch { # If it broke some other way <img draggable="false" role="img" class="emoji" alt="😀" src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/svg/1f600.svg">
2022-04-27 22:42:07 -05:00
Write-Host " Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed. "
}
#===========================================================================
# Store Form Objects In PowerShell
#===========================================================================
$xaml . SelectNodes ( " //*[@Name] " ) | % { Set-Variable -Name " WPF $( $_ . Name ) " -Value $Form . FindName ( $_ . Name ) }
Function Get-FormVariables {
2022-05-17 09:31:18 -05:00
If ( $global:ReadmeDisplay -ne $true ) { Write-host " If you need to reference this display again, run Get-FormVariables " -ForegroundColor Yellow ; $global:ReadmeDisplay = $true }
2022-04-27 22:42:07 -05:00
write-host " Found the following interactable elements from our form " -ForegroundColor Cyan
get-variable WPF *
}
Get-FormVariables
#===========================================================================
# Navigation Controls
#===========================================================================
$WPFTab1BT . Add_Click ( {
$WPFTabNav . Items [ 0 ] . IsSelected = $true
$WPFTabNav . Items [ 1 ] . IsSelected = $false
$WPFTabNav . Items [ 2 ] . IsSelected = $false
$WPFTabNav . Items [ 3 ] . IsSelected = $false
} )
$WPFTab2BT . Add_Click ( {
$WPFTabNav . Items [ 0 ] . IsSelected = $false
$WPFTabNav . Items [ 1 ] . IsSelected = $true
$WPFTabNav . Items [ 2 ] . IsSelected = $false
$WPFTabNav . Items [ 3 ] . IsSelected = $false
} )
$WPFTab3BT . Add_Click ( {
$WPFTabNav . Items [ 0 ] . IsSelected = $false
$WPFTabNav . Items [ 1 ] . IsSelected = $false
$WPFTabNav . Items [ 2 ] . IsSelected = $true
$WPFTabNav . Items [ 3 ] . IsSelected = $false
} )
$WPFTab4BT . Add_Click ( {
$WPFTabNav . Items [ 0 ] . IsSelected = $false
$WPFTabNav . Items [ 1 ] . IsSelected = $false
$WPFTabNav . Items [ 2 ] . IsSelected = $false
$WPFTabNav . Items [ 3 ] . IsSelected = $true
} )
#===========================================================================
2022-05-17 09:31:18 -05:00
# Tab 1 - Install
2022-04-27 22:42:07 -05:00
#===========================================================================
$WPFinstall . Add_Click ( {
2022-05-10 08:18:13 -05:00
$wingetinstall = New-Object System . Collections . Generic . List [ System.Object ]
2022-04-29 23:11:51 -05:00
If ( $WPFInstalladobe . IsChecked -eq $true ) {
2022-05-10 08:18:13 -05:00
$wingetinstall . Add ( " Adobe.Acrobat.Reader.64-bit " )
2022-04-29 23:11:51 -05:00
$WPFInstalladobe . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstalladvancedip . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Famatech.AdvancedIPScanner " )
$WPFInstalladvancedip . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-05-10 08:18:13 -05:00
If ( $WPFInstallatom . IsChecked -eq $true ) {
$wingetinstall . Add ( " GitHub.Atom " )
$WPFInstallatom . IsChecked = $false
2022-05-17 09:31:18 -05:00
}
If ( $WPFInstallaudacity . IsChecked -eq $true ) {
$wingetinstall . Add ( " Audacity.Audacity " )
$WPFInstallaudacity . IsChecked = $false
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallautohotkey . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Lexikos.AutoHotkey " )
2022-04-29 23:11:51 -05:00
$WPFInstallautohotkey . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallbrave . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " BraveSoftware.BraveBrowser " )
2022-04-29 23:11:51 -05:00
$WPFInstallbrave . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallchrome . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Google.Chrome " )
2022-04-29 23:11:51 -05:00
$WPFInstallchrome . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstalldiscord . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Discord.Discord " )
2022-04-29 23:11:51 -05:00
$WPFInstalldiscord . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallesearch . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " voidtools.Everything --source winget " )
2022-04-29 23:11:51 -05:00
$WPFInstallesearch . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstalletcher . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Balena.Etcher " )
2022-04-29 23:11:51 -05:00
$WPFInstalletcher . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallfirefox . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Mozilla.Firefox " )
2022-04-29 23:11:51 -05:00
$WPFInstallfirefox . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallgimp . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " GIMP.GIMP " )
2022-04-29 23:11:51 -05:00
$WPFInstallgimp . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallgithubdesktop . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Git.Git " )
$wingetinstall . Add ( " GitHub.GitHubDesktop " )
2022-04-29 23:11:51 -05:00
$WPFInstallgithubdesktop . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallimageglass . IsChecked -eq $true ) {
2022-05-10 08:18:13 -05:00
$wingetinstall . Add ( " DuongDieuPhap.ImageGlass " )
2022-05-17 09:31:18 -05:00
$WPFInstallimageglass . IsChecked = $false
}
2022-05-10 08:18:13 -05:00
If ( $WPFInstalljava8 . IsChecked -eq $true ) {
$wingetinstall . Add ( " AdoptOpenJDK.OpenJDK.8 " )
2022-05-17 09:31:18 -05:00
$WPFInstalljava8 . IsChecked = $false
}
If ( $WPFInstalljava16 . IsChecked -eq $true ) {
2022-05-10 08:18:13 -05:00
$wingetinstall . Add ( " AdoptOpenJDK.OpenJDK.16 " )
2022-05-17 09:31:18 -05:00
$WPFInstalljava16 . IsChecked = $false
}
If ( $WPFInstalljava18 . IsChecked -eq $true ) {
2022-05-10 08:18:13 -05:00
$wingetinstall . Add ( " Oracle.JDK.18 " )
2022-05-17 09:31:18 -05:00
$WPFInstalljava18 . IsChecked = $false
}
If ( $WPFInstalljetbrains . IsChecked -eq $true ) {
2022-05-10 08:18:13 -05:00
$wingetinstall . Add ( " JetBrains.Toolbox " )
2022-05-17 09:31:18 -05:00
$WPFInstalljetbrains . IsChecked = $false
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallmpc . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " clsid2.mpc-hc " )
2022-04-29 23:11:51 -05:00
$WPFInstallmpc . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-05-10 08:18:13 -05:00
If ( $WPFInstallnodejs . IsChecked -eq $true ) {
$wingetinstall . Add ( " OpenJS.NodeJS " )
2022-05-17 09:31:18 -05:00
$WPFInstallnodejs . IsChecked = $false
}
If ( $WPFInstallnodejslts . IsChecked -eq $true ) {
2022-05-10 08:18:13 -05:00
$wingetinstall . Add ( " OpenJS.NodeJS.LTS " )
2022-05-17 09:31:18 -05:00
$WPFInstallnodejslts . IsChecked = $false
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallnotepadplus . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Notepad++.Notepad++ " )
2022-04-29 23:11:51 -05:00
$WPFInstallnotepadplus . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallpowertoys . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Microsoft.PowerToys " )
2022-04-29 23:11:51 -05:00
$WPFInstallpowertoys . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallputty . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " PuTTY.PuTTY " )
2022-04-29 23:11:51 -05:00
$WPFInstallputty . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-05-10 08:18:13 -05:00
If ( $WPFInstallpython3 . IsChecked -eq $true ) {
$wingetinstall . Add ( " Python.Python.3 " )
2022-05-17 09:31:18 -05:00
$WPFInstallpython3 . IsChecked = $false
2022-05-10 08:18:13 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallsevenzip . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " 7zip.7zip " )
2022-04-29 23:11:51 -05:00
$WPFInstallsevenzip . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallsharex . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " ShareX.ShareX " )
2022-04-29 23:11:51 -05:00
$WPFInstallsharex . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-05-10 08:18:13 -05:00
If ( $WPFInstallsublime . IsChecked -eq $true ) {
$wingetinstall . Add ( " SublimeHQ.SublimeText.4 " )
2022-05-17 09:31:18 -05:00
$WPFInstallsublime . IsChecked = $false
2022-05-10 08:18:13 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallsumatra . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " SumatraPDF.SumatraPDF " )
2022-04-29 23:11:51 -05:00
$WPFInstallsumatra . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallterminal . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Microsoft.WindowsTerminal " )
2022-04-29 23:11:51 -05:00
$WPFInstallterminal . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallttaskbar . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " TranslucentTB.TranslucentTB " )
2022-04-29 23:11:51 -05:00
$WPFInstallttaskbar . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallvlc . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " VideoLAN.VLC " )
2022-04-29 23:11:51 -05:00
$WPFInstallvlc . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallvscode . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Git.Git " )
$wingetinstall . Add ( " Microsoft.VisualStudioCode --source winget " )
2022-04-29 23:11:51 -05:00
$WPFInstallvscode . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallvscodium . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Git.Git " )
$wingetinstall . Add ( " VSCodium.VSCodium " )
2022-04-29 23:11:51 -05:00
$WPFInstallvscodium . IsChecked = $false
2022-04-27 22:42:07 -05:00
}
2022-05-10 08:18:13 -05:00
If ( $WPFInstallwinscp . IsChecked -eq $true ) {
$wingetinstall . Add ( " WinSCP.WinSCP " )
2022-05-17 09:31:18 -05:00
$WPFInstallputty . IsChecked = $false
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallanydesk . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " AnyDeskSoftwareGmbH.AnyDesk " )
2022-04-29 23:11:51 -05:00
$WPFInstallanydesk . IsChecked = $false
}
If ( $WPFInstallbitwarden . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Bitwarden.Bitwarden " )
2022-04-29 23:11:51 -05:00
$WPFInstallbitwarden . IsChecked = $false
}
If ( $WPFInstallblender . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " BlenderFoundation.Blender " )
2022-04-29 23:11:51 -05:00
$WPFInstallblender . IsChecked = $false
}
If ( $WPFInstallchromium . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " eloston.ungoogled-chromium " )
2022-04-29 23:11:51 -05:00
$WPFInstallchromium . IsChecked = $false
}
If ( $WPFInstallcpuz . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " CPUID.CPU-Z " )
2022-04-29 23:11:51 -05:00
$WPFInstallcpuz . IsChecked = $false
}
If ( $WPFInstalleartrumpet . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " File-New-Project.EarTrumpet " )
2022-04-29 23:11:51 -05:00
$WPFInstalleartrumpet . IsChecked = $false
}
If ( $WPFInstallepicgames . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " EpicGames.EpicGamesLauncher " )
2022-04-29 23:11:51 -05:00
$WPFInstallepicgames . IsChecked = $false
}
If ( $WPFInstallflameshot . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Flameshot.Flameshot " )
2022-04-29 23:11:51 -05:00
$WPFInstallflameshot . IsChecked = $false
}
If ( $WPFInstallfoobar . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " PeterPawlowski.foobar2000 " )
2022-04-29 23:11:51 -05:00
$WPFInstallfoobar . IsChecked = $false
}
If ( $WPFInstallgog . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " GOG.Galaxy " )
2022-04-29 23:11:51 -05:00
$WPFInstallgog . IsChecked = $false
}
If ( $WPFInstallgpuz . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " TechPowerUp.GPU-Z " )
2022-04-29 23:11:51 -05:00
$WPFInstallgpuz . IsChecked = $false
}
If ( $WPFInstallgreenshot . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Greenshot.Greenshot " )
2022-04-29 23:11:51 -05:00
$WPFInstallgreenshot . IsChecked = $false
}
If ( $WPFInstallhandbrake . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " HandBrake.HandBrake " )
2022-04-29 23:11:51 -05:00
$WPFInstallhandbrake . IsChecked = $false
2022-05-10 08:18:13 -05:00
}
If ( $WPFInstallhexchat . IsChecked -eq $true ) {
$wingetinstall . Add ( " HexChat.HexChat " )
2022-05-17 09:31:18 -05:00
$WPFInstallhexchat . IsChecked = $false
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallhwinfo . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " REALiX.HWiNFO " )
2022-04-29 23:11:51 -05:00
$WPFInstallhwinfo . IsChecked = $false
}
If ( $WPFInstallinkscape . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Inkscape.Inkscape " )
2022-04-29 23:11:51 -05:00
$WPFInstallinkscape . IsChecked = $false
}
If ( $WPFInstallkeepass . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " KeePassXCTeam.KeePassXC " )
2022-04-29 23:11:51 -05:00
$WPFInstallkeepass . IsChecked = $false
}
If ( $WPFInstalllibrewolf . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " LibreWolf.LibreWolf " )
2022-04-29 23:11:51 -05:00
$WPFInstalllibrewolf . IsChecked = $false
}
If ( $WPFInstallmalwarebytes . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Malwarebytes.Malwarebytes " )
2022-04-29 23:11:51 -05:00
$WPFInstallmalwarebytes . IsChecked = $false
2022-05-10 08:18:13 -05:00
}
If ( $WPFInstallmatrix . IsChecked -eq $true ) {
$wingetinstall . Add ( " Element.Element " )
2022-05-17 09:31:18 -05:00
$WPFInstallmatrix . IsChecked = $false
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallmremoteng . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " mRemoteNG.mRemoteNG " )
2022-04-29 23:11:51 -05:00
$WPFInstallmremoteng . IsChecked = $false
}
If ( $WPFInstallnvclean . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " TechPowerUp.NVCleanstall " )
2022-04-29 23:11:51 -05:00
$WPFInstallnvclean . IsChecked = $false
}
If ( $WPFInstallobs . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " OBSProject.OBSStudio " )
2022-04-29 23:11:51 -05:00
$WPFInstallobs . IsChecked = $false
}
If ( $WPFInstallobsidian . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Obsidian.Obsidian " )
2022-04-29 23:11:51 -05:00
$WPFInstallobsidian . IsChecked = $false
}
If ( $WPFInstallrevo . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " RevoUninstaller.RevoUninstaller " )
2022-04-29 23:11:51 -05:00
$WPFInstallrevo . IsChecked = $false
}
If ( $WPFInstallrufus . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Rufus.Rufus " )
2022-04-29 23:11:51 -05:00
$WPFInstallrufus . IsChecked = $false
2022-05-10 08:18:13 -05:00
}
If ( $WPFInstallsignal . IsChecked -eq $true ) {
$wingetinstall . Add ( " OpenWhisperSystems.Signal " )
2022-05-17 09:31:18 -05:00
$WPFInstallsignal . IsChecked = $false
}
2022-05-10 08:18:13 -05:00
If ( $WPFInstallskype . IsChecked -eq $true ) {
$wingetinstall . Add ( " Microsoft.Skype " )
2022-05-17 09:31:18 -05:00
$WPFInstallskype . IsChecked = $false
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstallslack . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " SlackTechnologies.Slack " )
2022-04-29 23:11:51 -05:00
$WPFInstallslack . IsChecked = $false
}
If ( $WPFInstallspotify . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Spotify.Spotify " )
2022-04-29 23:11:51 -05:00
$WPFInstallspotify . IsChecked = $false
}
If ( $WPFInstallsteam . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Valve.Steam " )
2022-04-29 23:11:51 -05:00
$WPFInstallsteam . IsChecked = $false
}
If ( $WPFInstallteamviewer . IsChecked -eq $true ) {
2022-05-10 08:18:13 -05:00
$wingetinstall . Add ( " TeamViewer.TeamViewer " )
2022-05-17 09:31:18 -05:00
$WPFInstallteamviewer . IsChecked = $false
}
2022-05-10 08:18:13 -05:00
If ( $WPFInstallteams . IsChecked -eq $true ) {
$wingetinstall . Add ( " Microsoft.Teams " )
2022-05-17 09:31:18 -05:00
$WPFInstallteams . IsChecked = $false
}
2022-04-29 23:11:51 -05:00
If ( $WPFInstalltreesize . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " JAMSoftware.TreeSize.Free " )
2022-04-29 23:11:51 -05:00
$WPFInstalltreesize . IsChecked = $false
}
If ( $WPFInstallvisualstudio . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Microsoft.VisualStudio.2022.Community " )
2022-04-29 23:11:51 -05:00
$WPFInstallvisualstudio . IsChecked = $false
}
If ( $WPFInstallvivaldi . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " VivaldiTechnologies.Vivaldi " )
2022-04-29 23:11:51 -05:00
$WPFInstallvivaldi . IsChecked = $false
}
If ( $WPFInstallvoicemeeter . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " VB-Audio.Voicemeeter " )
2022-04-29 23:11:51 -05:00
$WPFInstallvoicemeeter . IsChecked = $false
}
If ( $WPFInstallwindirstat . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " WinDirStat.WinDirStat " )
2022-04-29 23:11:51 -05:00
$WPFInstallwindirstat . IsChecked = $false
}
If ( $WPFInstallwireshark . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " WiresharkFoundation.Wireshark " )
2022-04-29 23:11:51 -05:00
$WPFInstallwireshark . IsChecked = $false
}
If ( $WPFInstallzoom . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
$wingetinstall . Add ( " Zoom.Zoom " )
2022-04-29 23:11:51 -05:00
$WPFInstallzoom . IsChecked = $false
}
2022-05-10 08:18:13 -05:00
# Install all winget programs in new window
$wingetinstall . ToArray ( )
# Define Output variable
$wingetResult = New-Object System . Collections . Generic . List [ System.Object ]
foreach ( $node in $wingetinstall )
{
Start-Process powershell . exe -Verb RunAs -ArgumentList " -command winget install -e --accept-source-agreements --accept-package-agreements --silent $node | Out-Host " -Wait -WindowStyle Maximized
2022-05-10 08:37:41 -05:00
$wingetResult . Add ( " $node `n " )
2022-05-10 08:18:13 -05:00
}
$wingetResult . ToArray ( )
$wingetResult | % { $_ } | Out-Host
2022-05-10 08:37:41 -05:00
# Popup after finished
$ButtonType = [ System.Windows.MessageBoxButton ] :: OK
2022-05-10 08:18:13 -05:00
$MessageboxTitle = " Installed Programs "
$Messageboxbody = ( $wingetResult )
2022-05-10 08:37:41 -05:00
$MessageIcon = [ System.Windows.MessageBoxImage ] :: Information
2022-05-10 08:18:13 -05:00
2022-05-10 08:37:41 -05:00
[ System.Windows.MessageBox ] :: Show ( $Messageboxbody , $MessageboxTitle , $ButtonType , $MessageIcon )
2022-05-10 08:18:13 -05:00
} )
$WPFInstallUpgrade . Add_Click ( {
Start-Process powershell . exe -Verb RunAs -ArgumentList " -command winget upgrade --all | Out-Host " -Wait -WindowStyle Maximized
2022-05-10 08:37:41 -05:00
2022-05-10 08:18:13 -05:00
$ButtonType = [ System.Windows.MessageBoxButton ] :: OK
$MessageboxTitle = " Upgraded All Programs "
$Messageboxbody = ( " Done " )
2022-05-10 08:37:41 -05:00
$MessageIcon = [ System.Windows.MessageBoxImage ] :: Information
2022-05-10 08:18:13 -05:00
2022-05-10 08:37:41 -05:00
[ System.Windows.MessageBox ] :: Show ( $Messageboxbody , $MessageboxTitle , $ButtonType , $MessageIcon )
2022-04-29 23:11:51 -05:00
} )
2022-05-10 08:18:13 -05:00
#===========================================================================
2022-05-17 09:31:18 -05:00
# Tab 2 - Tweak Buttons
2022-05-10 08:18:13 -05:00
#===========================================================================
2022-04-29 23:11:51 -05:00
$WPFdesktop . Add_Click ( {
$WPFEssTweaksAH . IsChecked = $true
$WPFEssTweaksDeBloat . IsChecked = $false
$WPFEssTweaksDVR . IsChecked = $true
$WPFEssTweaksHiber . IsChecked = $true
$WPFEssTweaksHome . IsChecked = $true
$WPFEssTweaksLoc . IsChecked = $true
$WPFEssTweaksOO . IsChecked = $true
$WPFEssTweaksRP . IsChecked = $true
$WPFEssTweaksServices . IsChecked = $true
$WPFEssTweaksStorage . IsChecked = $true
$WPFEssTweaksTele . IsChecked = $true
$WPFEssTweaksWifi . IsChecked = $true
$WPFMiscTweaksPower . IsChecked = $true
$WPFMiscTweaksNum . IsChecked = $true
$WPFMiscTweaksLapPower . IsChecked = $false
$WPFMiscTweaksLapNum . IsChecked = $false
} )
$WPFlaptop . Add_Click ( {
$WPFEssTweaksAH . IsChecked = $true
$WPFEssTweaksDeBloat . IsChecked = $false
$WPFEssTweaksDVR . IsChecked = $true
$WPFEssTweaksHiber . IsChecked = $false
$WPFEssTweaksHome . IsChecked = $true
$WPFEssTweaksLoc . IsChecked = $true
$WPFEssTweaksOO . IsChecked = $true
$WPFEssTweaksRP . IsChecked = $true
$WPFEssTweaksServices . IsChecked = $true
$WPFEssTweaksStorage . IsChecked = $true
$WPFEssTweaksTele . IsChecked = $true
$WPFEssTweaksWifi . IsChecked = $true
$WPFMiscTweaksLapPower . IsChecked = $true
$WPFMiscTweaksLapNum . IsChecked = $true
$WPFMiscTweaksPower . IsChecked = $false
$WPFMiscTweaksNum . IsChecked = $false
} )
$WPFminimal . Add_Click ( {
$WPFEssTweaksAH . IsChecked = $false
$WPFEssTweaksDeBloat . IsChecked = $false
$WPFEssTweaksDVR . IsChecked = $false
$WPFEssTweaksHiber . IsChecked = $false
$WPFEssTweaksHome . IsChecked = $true
$WPFEssTweaksLoc . IsChecked = $false
$WPFEssTweaksOO . IsChecked = $true
$WPFEssTweaksRP . IsChecked = $true
$WPFEssTweaksServices . IsChecked = $true
$WPFEssTweaksStorage . IsChecked = $false
$WPFEssTweaksTele . IsChecked = $true
$WPFEssTweaksWifi . IsChecked = $false
$WPFMiscTweaksPower . IsChecked = $false
$WPFMiscTweaksNum . IsChecked = $false
$WPFMiscTweaksLapPower . IsChecked = $false
$WPFMiscTweaksLapNum . IsChecked = $false
2022-04-27 22:42:07 -05:00
} )
2022-04-29 23:11:51 -05:00
$WPFtweaksbutton . Add_Click ( {
If ( $WPFEssTweaksAH . IsChecked -eq $true ) {
Write-Host " Disabling Activity History... "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System " -Name " EnableActivityFeed " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System " -Name " PublishUserActivities " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System " -Name " UploadUserActivities " -Type DWord -Value 0
$WPFEssTweaksAH . IsChecked = $false
}
If ( $WPFEssTweaksDVR . IsChecked -eq $true ) {
Set-ItemProperty -Path " HKLM:\System\GameConfigStore " -Name " GameDVR_DXGIHonorFSEWindowsCompatible " -Type Hex -Value 00000000
Set-ItemProperty -Path " HKLM:\System\GameConfigStore " -Name " GameDVR_HonorUserFSEBehaviorMode " -Type Hex -Value 00000000
Set-ItemProperty -Path " HKLM:\System\GameConfigStore " -Name " GameDVR_EFSEFeatureFlags " -Type Hex -Value 00000000
Set-ItemProperty -Path " HKLM:\System\GameConfigStore " -Name " GameDVR_Enabled " -Type DWord -Value 00000000
$WPFEssTweaksDVR . IsChecked = $false
}
If ( $WPFEssTweaksHiber . IsChecked -eq $true ) {
Write-Host " Disabling Hibernation... "
Set-ItemProperty -Path " HKLM:\System\CurrentControlSet\Control\Session Manager\Power " -Name " HibernteEnabled " -Type Dword -Value 0
If ( ! ( Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings " | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings " -Name " ShowHibernateOption " -Type Dword -Value 0
$WPFEssTweaksHiber . IsChecked = $false
}
If ( $WPFEssTweaksHome . IsChecked -eq $true ) {
Write-Host " Allowing Home Groups services... "
Stop-Service " HomeGroupListener " -WarningAction SilentlyContinue
Set-Service " HomeGroupListener " -StartupType Manual
Stop-Service " HomeGroupProvider " -WarningAction SilentlyContinue
Set-Service " HomeGroupProvider " -StartupType Manual
$WPFEssTweaksHome . IsChecked = $false
}
If ( $WPFEssTweaksLoc . IsChecked -eq $true ) {
Write-Host " Disabling Location Tracking... "
If ( ! ( Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location " -Force | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location " -Name " Value " -Type String -Value " Deny "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44} " -Name " SensorPermissionState " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration " -Name " Status " -Type DWord -Value 0
Write-Host " Disabling automatic Maps updates... "
Set-ItemProperty -Path " HKLM:\SYSTEM\Maps " -Name " AutoUpdateEnabled " -Type DWord -Value 0
$WPFEssTweaksLoc . IsChecked = $false
}
If ( $WPFEssTweaksOO . IsChecked -eq $true ) {
Write-Host " Running O&O Shutup with Recommended Settings "
Import-Module BitsTransfer
Start-BitsTransfer -Source " https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg " -Destination ooshutup10 . cfg
Start-BitsTransfer -Source " https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe " -Destination OOSU10 . exe
. / OOSU10 . exe ooshutup10 . cfg / quiet
$WPFEssTweaksOO . IsChecked = $false
}
If ( $WPFEssTweaksRP . IsChecked -eq $true ) {
Write-Host " Creating Restore Point incase something bad happens "
Enable-ComputerRestore -Drive " C:\ "
Checkpoint-Computer -Description " RestorePoint1 " -RestorePointType " MODIFY_SETTINGS "
$WPFEssTweaksRP . IsChecked = $false
}
If ( $WPFEssTweaksServices . IsChecked -eq $true ) {
2022-05-17 09:31:18 -05:00
# Set Services to Manual
2022-04-29 23:11:51 -05:00
$services = @ (
2022-05-17 09:31:18 -05:00
" ALG " # Application Layer Gateway Service(Provides support for 3rd party protocol plug-ins for Internet Connection Sharing)
" AJRouter " # Needed for AllJoyn Router Service
" BcastDVRUserService_48486de " # GameDVR and Broadcast is used for Game Recordings and Live Broadcasts
#"BDESVC" # Bitlocker Drive Encryption Service
#"BFE" # Base Filtering Engine (Manages Firewall and Internet Protocol security)
#"BluetoothUserService_48486de" # Bluetooth user service supports proper functionality of Bluetooth features relevant to each user session.
#"BrokerInfrastructure" # Windows Infrastructure Service (Controls which background tasks can run on the system)
" Browser " # Let users browse and locate shared resources in neighboring computers
" BthAvctpSvc " # AVCTP service (needed for Bluetooth Audio Devices or Wireless Headphones)
" CaptureService_48486de " # Optional screen capture functionality for applications that call the Windows.Graphics.Capture API.
" cbdhsvc_48486de " # Clipboard Service
2022-04-29 23:11:51 -05:00
" diagnosticshub.standardcollector.service " # Microsoft (R) Diagnostics Hub Standard Collector Service
" DiagTrack " # Diagnostics Tracking Service
2022-05-17 09:31:18 -05:00
" dmwappushservice " # WAP Push Message Routing Service
" DPS " # Diagnostic Policy Service (Detects and Troubleshoots Potential Problems)
" edgeupdate " # Edge Update Service
" edgeupdatem " # Another Update Service
" EntAppSvc " # Enterprise Application Management.
" Fax " # Fax Service
" fhsvc " # Fax History
" FontCache " # Windows font cache
#"FrameServer" # Windows Camera Frame Server (Allows multiple clients to access video frames from camera devices)
" gupdate " # Google Update
" gupdatem " # Another Google Update Service
" iphlpsvc " # ipv6(Most websites use ipv4 instead)
2022-04-29 23:11:51 -05:00
" lfsvc " # Geolocation Service
2022-05-17 09:31:18 -05:00
#"LicenseManager" # Disable LicenseManager (Windows Store may not work properly)
" lmhosts " # TCP/IP NetBIOS Helper
2022-04-29 23:11:51 -05:00
" MapsBroker " # Downloaded Maps Manager
2022-05-17 09:31:18 -05:00
" MicrosoftEdgeElevationService " # Another Edge Update Service
" MSDTC " # Distributed Transaction Coordinator
" ndu " # Windows Network Data Usage Monitor (Disabling Breaks Task Manager Per-Process Network Monitoring)
2022-04-29 23:11:51 -05:00
" NetTcpPortSharing " # Net.Tcp Port Sharing Service
2022-05-17 09:31:18 -05:00
" PcaSvc " # Program Compatibility Assistant Service
" PerfHost " # Remote users and 64-bit processes to query performance.
" PhoneSvc " # Phone Service(Manages the telephony state on the device)
#"PNRPsvc" # Peer Name Resolution Protocol (Some peer-to-peer and collaborative applications, such as Remote Assistance, may not function, Discord will still work)
#"p2psvc" # Peer Name Resolution Protocol(Enables multi-party communication using Peer-to-Peer Grouping. If disabled, some applications, such as HomeGroup, may not function. Discord will still work)iscord will still work)
#"p2pimsvc" # Peer Networking Identity Manager (Peer-to-Peer Grouping services may not function, and some applications, such as HomeGroup and Remote Assistance, may not function correctly. Discord will still work)
" PrintNotify " # Windows printer notifications and extentions
" QWAVE " # Quality Windows Audio Video Experience (audio and video might sound worse)
2022-04-29 23:11:51 -05:00
" RemoteAccess " # Routing and Remote Access
" RemoteRegistry " # Remote Registry
2022-05-17 09:31:18 -05:00
" RetailDemo " # Demo Mode for Store Display
" RtkBtManServ " # Realtek Bluetooth Device Manager Service
" SCardSvr " # Windows Smart Card Service
" seclogon " # Secondary Logon (Disables other credentials only password will work)
" SEMgrSvc " # Payments and NFC/SE Manager (Manages payments and Near Field Communication (NFC) based secure elements)
2022-04-29 23:11:51 -05:00
" SharedAccess " # Internet Connection Sharing (ICS)
2022-05-17 09:31:18 -05:00
#"Spooler" # Printing
" stisvc " # Windows Image Acquisition (WIA)
#"StorSvc" # StorSvc (usb external hard drive will not be reconized by windows)
" SysMain " # Analyses System Usage and Improves Performance
2022-04-29 23:11:51 -05:00
" TrkWks " # Distributed Link Tracking Client
2022-05-17 09:31:18 -05:00
#"WbioSrvc" # Windows Biometric Service (required for Fingerprint reader / facial detection)
" WerSvc " # Windows error reporting
" wisvc " # Windows Insider program(Windows Insider will not work if Disabled)
#"WlanSvc" # WLAN AutoConfig
2022-04-29 23:11:51 -05:00
" WMPNetworkSvc " # Windows Media Player Network Sharing Service
2022-05-17 09:31:18 -05:00
" WpcMonSvc " # Parental Controls
" WPDBusEnum " # Portable Device Enumerator Service
" WpnService " # WpnService (Push Notifications may not work)
#"wscsvc" # Windows Security Center Service
2022-04-29 23:11:51 -05:00
" WSearch " # Windows Search
2022-05-17 09:31:18 -05:00
" XblAuthManager " # Xbox Live Auth Manager (Disabling Breaks Xbox Live Games)
" XblGameSave " # Xbox Live Game Save Service (Disabling Breaks Xbox Live Games)
" XboxNetApiSvc " # Xbox Live Networking Service (Disabling Breaks Xbox Live Games)
" XboxGipSvc " # Xbox Accessory Management Service
# Hp services
2022-04-29 23:11:51 -05:00
" HPAppHelperCap "
" HPDiagsCap "
" HPNetworkCap "
" HPSysInfoCap "
" HpTouchpointAnalyticsService "
2022-05-17 09:31:18 -05:00
# Hyper-V services
" HvHost "
2022-04-29 23:11:51 -05:00
" vmicguestinterface "
" vmicheartbeat "
2022-05-17 09:31:18 -05:00
" vmickvpexchange "
2022-04-29 23:11:51 -05:00
" vmicrdv "
2022-05-17 09:31:18 -05:00
" vmicshutdown "
" vmictimesync "
" vmicvmsession "
# Services that cannot be disabled
2022-04-29 23:11:51 -05:00
#"WdNisSvc"
)
foreach ( $service in $services ) {
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
Write-Host " Setting $service StartupType to Manual "
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Manual
}
$WPFEssTweaksServices . IsChecked = $false
}
If ( $WPFEssTweaksStorage . IsChecked -eq $true ) {
Write-Host " Disabling Storage Sense... "
Remove-Item -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy " -Recurse -ErrorAction SilentlyContinue
$WPFEssTweaksStorage . IsChecked = $false
}
If ( $WPFEssTweaksTele . IsChecked -eq $true ) {
Write-Host " Disabling Telemetry... "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection " -Name " AllowTelemetry " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection " -Name " AllowTelemetry " -Type DWord -Value 0
Disable-ScheduledTask -TaskName " Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser " | Out-Null
Disable-ScheduledTask -TaskName " Microsoft\Windows\Application Experience\ProgramDataUpdater " | Out-Null
Disable-ScheduledTask -TaskName " Microsoft\Windows\Autochk\Proxy " | Out-Null
Disable-ScheduledTask -TaskName " Microsoft\Windows\Customer Experience Improvement Program\Consolidator " | Out-Null
Disable-ScheduledTask -TaskName " Microsoft\Windows\Customer Experience Improvement Program\UsbCeip " | Out-Null
Disable-ScheduledTask -TaskName " Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector " | Out-Null
Write-Host " Disabling Application suggestions... "
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " ContentDeliveryAllowed " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " OemPreInstalledAppsEnabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " PreInstalledAppsEnabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " PreInstalledAppsEverEnabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SilentInstalledAppsEnabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SubscribedContent-338387Enabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SubscribedContent-338388Enabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SubscribedContent-338389Enabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SubscribedContent-353698Enabled " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SystemPaneSuggestionsEnabled " -Type DWord -Value 0
If ( ! ( Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " -Force | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " -Name " DisableWindowsConsumerFeatures " -Type DWord -Value 1
Write-Host " Disabling Feedback... "
If ( ! ( Test-Path " HKCU:\SOFTWARE\Microsoft\Siuf\Rules " ) ) {
New-Item -Path " HKCU:\SOFTWARE\Microsoft\Siuf\Rules " -Force | Out-Null
}
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Siuf\Rules " -Name " NumberOfSIUFInPeriod " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection " -Name " DoNotShowFeedbackNotifications " -Type DWord -Value 1
Disable-ScheduledTask -TaskName " Microsoft\Windows\Feedback\Siuf\DmClient " -ErrorAction SilentlyContinue | Out-Null
Disable-ScheduledTask -TaskName " Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload " -ErrorAction SilentlyContinue | Out-Null
Write-Host " Disabling Tailored Experiences... "
If ( ! ( Test-Path " HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " ) ) {
New-Item -Path " HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " -Force | Out-Null
}
Set-ItemProperty -Path " HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " -Name " DisableTailoredExperiencesWithDiagnosticData " -Type DWord -Value 1
Write-Host " Disabling Advertising ID... "
If ( ! ( Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo " | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo " -Name " DisabledByGroupPolicy " -Type DWord -Value 1
Write-Host " Disabling Error reporting... "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting " -Name " Disabled " -Type DWord -Value 1
Disable-ScheduledTask -TaskName " Microsoft\Windows\Windows Error Reporting\QueueReporting " | Out-Null
Write-Host " Restricting Windows Update P2P only to local network... "
If ( ! ( Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config " | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config " -Name " DODownloadMode " -Type DWord -Value 1
Write-Host " Stopping and disabling Diagnostics Tracking Service... "
Stop-Service " DiagTrack " -WarningAction SilentlyContinue
Set-Service " DiagTrack " -StartupType Disabled
Write-Host " Stopping and disabling WAP Push Service... "
Stop-Service " dmwappushservice " -WarningAction SilentlyContinue
Set-Service " dmwappushservice " -StartupType Disabled
Write-Host " Enabling F8 boot menu options... "
bcdedit / set ` { current ` } bootmenupolicy Legacy | Out-Null
Write-Host " Disabling Remote Assistance... "
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance " -Name " fAllowToGetHelp " -Type DWord -Value 0
Write-Host " Stopping and disabling Superfetch service... "
Stop-Service " SysMain " -WarningAction SilentlyContinue
Set-Service " SysMain " -StartupType Disabled
# Task Manager Details
If ( ( get-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion " -Name CurrentBuild ) . CurrentBuild -lt 22557 ) {
Write-Host " Showing task manager details... "
$taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr . exe -PassThru
Do {
Start-Sleep -Milliseconds 100
$preferences = Get-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager " -Name " Preferences " -ErrorAction SilentlyContinue
} Until ( $preferences )
Stop-Process $taskmgr
$preferences . Preferences [ 28 ] = 0
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager " -Name " Preferences " -Type Binary -Value $preferences . Preferences
} else { Write-Host " Task Manager patch not run in builds 22557+ due to bug " }
Write-Host " Showing file operations details... "
If ( ! ( Test-Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager " ) ) {
New-Item -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager " | Out-Null
}
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager " -Name " EnthusiastMode " -Type DWord -Value 1
Write-Host " Hiding Task View button... "
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " ShowTaskViewButton " -Type DWord -Value 0
Write-Host " Hiding People icon... "
If ( ! ( Test-Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People " ) ) {
New-Item -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People " | Out-Null
}
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People " -Name " PeopleBand " -Type DWord -Value 0
Write-Host " Changing default Explorer view to This PC... "
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " LaunchTo " -Type DWord -Value 1
Write-Host " Hiding 3D Objects icon from This PC... "
Remove-Item -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A} " -Recurse -ErrorAction SilentlyContinue
## Performance Tweaks and More Telemetry
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching " -Name " SearchOrderConfig " -Type DWord -Value 00000000
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile " -Name " SystemResponsiveness " -Type DWord -Value 0000000a
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile " -Name " NetworkThrottlingIndex " -Type DWord -Value 0000000a
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control " -Name " WaitToKillServiceTimeout " -Type DWord -Value 2000
Set-ItemProperty -Path " HKLM:\Control Panel\Desktop " -Name " MenuShowDelay " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\Control Panel\Desktop " -Name " WaitToKillAppTimeout " -Type DWord -Value 5000
Set-ItemProperty -Path " HKLM:\Control Panel\Desktop " -Name " HungAppTimeout " -Type DWord -Value 4000
Set-ItemProperty -Path " HKLM:\Control Panel\Desktop " -Name " AutoEndTasks " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\Control Panel\Desktop " -Name " LowLevelHooksTimeout " -Type DWord -Value 00001000
Set-ItemProperty -Path " HKLM:\Control Panel\Desktop " -Name " WaitToKillServiceTimeout " -Type DWord -Value 00002000
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management " -Name " ClearPageFileAtShutdown " -Type DWord -Value 00000001
Set-ItemProperty -Path " HKLM:\SYSTEM\ControlSet001\Services\Ndu " -Name " Start " -Type DWord -Value 00000004
Set-ItemProperty -Path " HKLM:\Control Panel\Mouse " -Name " MouseHoverTime " -Type DWord -Value 00000010
# Network Tweaks
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters " -Name " IRPStackSize " -Type DWord -Value 20
# Group svchost.exe processes
$ram = ( Get-CimInstance -ClassName Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum ) . Sum / 1 kb
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control " -Name " SvcHostSplitThresholdInKB " -Type DWord -Value $ram -Force
Write-Host " Disable News and Interests "
Set-ItemProperty -Path " HKCU:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds " -Name " EnableFeeds " -Type DWord -Value 0
# Remove "News and Interest" from taskbar
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds " -Name " ShellFeedsTaskbarViewMode " -Type DWord -Value 2
# remove "Meet Now" button from taskbar
If ( ! ( Test-Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer " ) ) {
New-Item -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer " -Force | Out-Null
}
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer " -Name " HideSCAMeetNow " -Type DWord -Value 1
Write-Host " Removing AutoLogger file and restricting directory... "
$autoLoggerDir = " $env:PROGRAMDATA \Microsoft\Diagnosis\ETLLogs\AutoLogger "
If ( Test-Path " $autoLoggerDir \AutoLogger-Diagtrack-Listener.etl " ) {
Remove-Item " $autoLoggerDir \AutoLogger-Diagtrack-Listener.etl "
}
icacls $autoLoggerDir / deny SYSTEM : ` ( OI ` ) ` ( CI ` ) F | Out-Null
Write-Host " Stopping and disabling Diagnostics Tracking Service... "
Stop-Service " DiagTrack "
Set-Service " DiagTrack " -StartupType Disabled
$WPFEssTweaksTele . IsChecked = $false
}
If ( $WPFEssTweaksWifi . IsChecked -eq $true ) {
Write-Host " Disabling Wi-Fi Sense... "
If ( ! ( Test-Path " HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting " ) ) {
New-Item -Path " HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting " -Force | Out-Null
}
Set-ItemProperty -Path " HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting " -Name " Value " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots " -Name " Value " -Type DWord -Value 0
$WPFEssTweaksWifi . IsChecked = $false
}
If ( $WPFMiscTweaksLapPower . IsChecked -eq $true ) {
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling " -Name " PowerThrottlingOff " -Type DWord -Value 00000000
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power " -Name " HiberbootEnabled " -Type DWord -Value 0000001
$WPFMiscTweaksLapPower . IsChecked = $false
}
If ( $WPFMiscTweaksLapNum . IsChecked -eq $true ) {
Write-Host " Disabling NumLock after startup... "
If ( ! ( Test-Path " HKU: " ) ) {
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
}
Set-ItemProperty -Path " HKU:\.DEFAULT\Control Panel\Keyboard " -Name " InitialKeyboardIndicators " -Type DWord -Value 0
$WPFMiscTweaksLapNum . IsChecked = $false
}
If ( $WPFMiscTweaksPower . IsChecked -eq $true ) {
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling " -Name " PowerThrottlingOff " -Type DWord -Value 00000001
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power " -Name " HiberbootEnabled " -Type DWord -Value 0000000
$WPFMiscTweaksPower . IsChecked = $false
}
If ( $WPFMiscTweaksNum . IsChecked -eq $true ) {
Write-Host " Enabling NumLock after startup... "
If ( ! ( Test-Path " HKU: " ) ) {
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
}
Set-ItemProperty -Path " HKU:\.DEFAULT\Control Panel\Keyboard " -Name " InitialKeyboardIndicators " -Type DWord -Value 2
$WPFMiscTweaksNum . IsChecked = $false
}
If ( $WPFMiscTweaksExt . IsChecked -eq $true ) {
Write-Host " Showing known file extensions... "
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " HideFileExt " -Type DWord -Value 0
$WPFMiscTweaksExt . IsChecked = $false
}
If ( $WPFMiscTweaksUTC . IsChecked -eq $true ) {
Write-Host " Setting BIOS time to UTC... "
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation " -Name " RealTimeIsUniversal " -Type DWord -Value 1
$WPFMiscTweaksUTC . IsChecked
}
If ( $WPFMiscTweaksDisplay . IsChecked -eq $true ) {
Write-Host " Adjusting visual effects for performance... "
Set-ItemProperty -Path " HKCU:\Control Panel\Desktop " -Name " DragFullWindows " -Type String -Value 0
Set-ItemProperty -Path " HKCU:\Control Panel\Desktop " -Name " MenuShowDelay " -Type String -Value 200
Set-ItemProperty -Path " HKCU:\Control Panel\Desktop " -Name " UserPreferencesMask " -Type Binary -Value ( [ byte[] ] ( 144 , 18 , 3 , 128 , 16 , 0 , 0 , 0 ) )
Set-ItemProperty -Path " HKCU:\Control Panel\Desktop\WindowMetrics " -Name " MinAnimate " -Type String -Value 0
Set-ItemProperty -Path " HKCU:\Control Panel\Keyboard " -Name " KeyboardDelay " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " ListviewAlphaSelect " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " ListviewShadow " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " TaskbarAnimations " -Type DWord -Value 0
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects " -Name " VisualFXSetting " -Type DWord -Value 3
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\DWM " -Name " EnableAeroPeek " -Type DWord -Value 0
Write-Host " Adjusted visual effects for performance "
$WPFMiscTweaksDisplay . IsChecked = false
}
If ( $WPFEssTweaksDeBloat . IsChecked -eq $true ) {
$Bloatware = @ (
#Unnecessary Windows 10 AppX Apps
" Microsoft.3DBuilder "
" Microsoft.Microsoft3DViewer "
" Microsoft.AppConnector "
" Microsoft.BingFinance "
" Microsoft.BingNews "
" Microsoft.BingSports "
" Microsoft.BingTranslator "
" Microsoft.BingWeather "
" Microsoft.BingFoodAndDrink "
" Microsoft.BingHealthAndFitness "
" Microsoft.BingTravel "
" Microsoft.MinecraftUWP "
" Microsoft.GamingServices "
# "Microsoft.WindowsReadingList"
" Microsoft.GetHelp "
" Microsoft.Getstarted "
" Microsoft.Messaging "
" Microsoft.Microsoft3DViewer "
" Microsoft.MicrosoftSolitaireCollection "
" Microsoft.NetworkSpeedTest "
" Microsoft.News "
" Microsoft.Office.Lens "
" Microsoft.Office.Sway "
" Microsoft.Office.OneNote "
" Microsoft.OneConnect "
" Microsoft.People "
" Microsoft.Print3D "
" Microsoft.SkypeApp "
" Microsoft.Wallet "
" Microsoft.Whiteboard "
" Microsoft.WindowsAlarms "
" microsoft.windowscommunicationsapps "
" Microsoft.WindowsFeedbackHub "
" Microsoft.WindowsMaps "
" Microsoft.WindowsPhone "
" Microsoft.WindowsSoundRecorder "
" Microsoft.XboxApp "
" Microsoft.ConnectivityStore "
" Microsoft.CommsPhone "
" Microsoft.ScreenSketch "
" Microsoft.Xbox.TCUI "
" Microsoft.XboxGameOverlay "
" Microsoft.XboxGameCallableUI "
" Microsoft.XboxSpeechToTextOverlay "
" Microsoft.MixedReality.Portal "
" Microsoft.XboxIdentityProvider "
" Microsoft.ZuneMusic "
" Microsoft.ZuneVideo "
#"Microsoft.YourPhone"
" Microsoft.Getstarted "
" Microsoft.MicrosoftOfficeHub "
#Sponsored Windows 10 AppX Apps
#Add sponsored/featured apps to remove in the "*AppName*" format
" *EclipseManager* "
" *ActiproSoftwareLLC* "
" *AdobeSystemsIncorporated.AdobePhotoshopExpress* "
" *Duolingo-LearnLanguagesforFree* "
" *PandoraMediaInc* "
" *CandyCrush* "
" *BubbleWitch3Saga* "
" *Wunderlist* "
" *Flipboard* "
" *Twitter* "
" *Facebook* "
" *Royal Revolt* "
" *Sway* "
" *Speed Test* "
" *Dolby* "
" *Viber* "
" *ACGMediaPlayer* "
" *Netflix* "
" *OneCalendar* "
" *LinkedInforWindows* "
" *HiddenCityMysteryofShadows* "
" *Hulu* "
" *HiddenCity* "
" *AdobePhotoshopExpress* "
" *HotspotShieldFreeVPN* "
2022-05-17 09:31:18 -05:00
#Optional: Typically not removed but you can if you need to
2022-04-29 23:11:51 -05:00
" *Microsoft.Advertising.Xaml* "
#"*Microsoft.MSPaint*"
#"*Microsoft.MicrosoftStickyNotes*"
#"*Microsoft.Windows.Photos*"
#"*Microsoft.WindowsCalculator*"
#"*Microsoft.WindowsStore*"
)
Write-Host " Removing Bloatware "
foreach ( $Bloat in $Bloatware ) {
Get-AppxPackage -Name $Bloat | Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Remove-AppxProvisionedPackage -Online
Write-Host " Trying to remove $Bloat . "
}
Write-Host " Finished Removing Bloatware Apps "
$WPFEssTweaksDeBloat . IsChecked = $false
}
2022-05-10 08:37:41 -05:00
$ButtonType = [ System.Windows.MessageBoxButton ] :: OK
2022-05-10 08:18:13 -05:00
$MessageboxTitle = " Tweaks are Finished "
$Messageboxbody = ( " Done " )
2022-05-10 08:37:41 -05:00
$MessageIcon = [ System.Windows.MessageBoxImage ] :: Information
2022-05-10 08:18:13 -05:00
2022-05-10 08:37:41 -05:00
[ System.Windows.MessageBox ] :: Show ( $Messageboxbody , $MessageboxTitle , $ButtonType , $MessageIcon )
2022-04-29 23:11:51 -05:00
} )
#===========================================================================
# Undo All
#===========================================================================
$WPFundoall . Add_Click ( {
Write-Host " Creating Restore Point incase something bad happens "
Enable-ComputerRestore -Drive " C:\ "
Checkpoint-Computer -Description " RestorePoint1 " -RestorePointType " MODIFY_SETTINGS "
Write-Host " Enabling Telemetry... "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection " -Name " AllowTelemetry " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection " -Name " AllowTelemetry " -Type DWord -Value 1
Write-Host " Enabling Wi-Fi Sense "
Set-ItemProperty -Path " HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting " -Name " Value " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots " -Name " Value " -Type DWord -Value 1
Write-Host " Enabling Application suggestions... "
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " ContentDeliveryAllowed " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " OemPreInstalledAppsEnabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " PreInstalledAppsEnabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " PreInstalledAppsEverEnabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SilentInstalledAppsEnabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SubscribedContent-338387Enabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SubscribedContent-338388Enabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SubscribedContent-338389Enabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SubscribedContent-353698Enabled " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager " -Name " SystemPaneSuggestionsEnabled " -Type DWord -Value 1
If ( ! ( Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " ) ) {
Remove-Item -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " -Recurse -ErrorAction SilentlyContinue
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " -Name " DisableWindowsConsumerFeatures " -Type DWord -Value 0
Write-Host " Enabling Activity History... "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System " -Name " EnableActivityFeed " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System " -Name " PublishUserActivities " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System " -Name " UploadUserActivities " -Type DWord -Value 1
Write-Host " Enable Location Tracking... "
If ( ! ( Test-Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location " ) ) {
Remove-Item -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location " -Recurse -ErrorAction SilentlyContinue
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location " -Name " Value " -Type String -Value " Allow "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44} " -Name " SensorPermissionState " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration " -Name " Status " -Type DWord -Value 1
Write-Host " Enabling automatic Maps updates... "
Set-ItemProperty -Path " HKLM:\SYSTEM\Maps " -Name " AutoUpdateEnabled " -Type DWord -Value 1
Write-Host " Enabling Feedback... "
If ( ! ( Test-Path " HKCU:\SOFTWARE\Microsoft\Siuf\Rules " ) ) {
Remove-Item -Path " HKCU:\SOFTWARE\Microsoft\Siuf\Rules " -Recurse -ErrorAction SilentlyContinue
}
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Siuf\Rules " -Name " NumberOfSIUFInPeriod " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection " -Name " DoNotShowFeedbackNotifications " -Type DWord -Value 0
Write-Host " Enabling Tailored Experiences... "
If ( ! ( Test-Path " HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " ) ) {
Remove-Item -Path " HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " -Recurse -ErrorAction SilentlyContinue
}
Set-ItemProperty -Path " HKCU:\SOFTWARE\Policies\Microsoft\Windows\CloudContent " -Name " DisableTailoredExperiencesWithDiagnosticData " -Type DWord -Value 0
Write-Host " Disabling Advertising ID... "
If ( ! ( Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo " ) ) {
Remove-Item -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo " -Recurse -ErrorAction SilentlyContinue
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo " -Name " DisabledByGroupPolicy " -Type DWord -Value 0
Write-Host " Allow Error reporting... "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting " -Name " Disabled " -Type DWord -Value 0
Write-Host " Allowing Diagnostics Tracking Service... "
Stop-Service " DiagTrack " -WarningAction SilentlyContinue
Set-Service " DiagTrack " -StartupType Manual
Write-Host " Allowing WAP Push Service... "
Stop-Service " dmwappushservice " -WarningAction SilentlyContinue
Set-Service " dmwappushservice " -StartupType Manual
Write-Host " Allowing Home Groups services... "
Stop-Service " HomeGroupListener " -WarningAction SilentlyContinue
Set-Service " HomeGroupListener " -StartupType Manual
Stop-Service " HomeGroupProvider " -WarningAction SilentlyContinue
Set-Service " HomeGroupProvider " -StartupType Manual
Write-Host " Enabling Storage Sense... "
New-Item -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy " | Out-Null
Write-Host " Allowing Superfetch service... "
Stop-Service " SysMain " -WarningAction SilentlyContinue
Set-Service " SysMain " -StartupType Manual
Write-Host " Setting BIOS time to Local Time instead of UTC... "
Set-ItemProperty -Path " HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation " -Name " RealTimeIsUniversal " -Type DWord -Value 0
Write-Host " Enabling Hibernation... "
Set-ItemProperty -Path " HKLM:\System\CurrentControlSet\Control\Session Manager\Power " -Name " HibernteEnabled " -Type Dword -Value 1
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings " -Name " ShowHibernateOption " -Type Dword -Value 1
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization " -Name " NoLockScreen " -ErrorAction SilentlyContinue
Write-Host " Hiding file operations details... "
If ( ! ( Test-Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager " ) ) {
Remove-Item -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager " -Recurse -ErrorAction SilentlyContinue
}
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager " -Name " EnthusiastMode " -Type DWord -Value 0
Write-Host " Showing Task View button... "
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " ShowTaskViewButton " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People " -Name " PeopleBand " -Type DWord -Value 1
Write-Host " Changing default Explorer view to Quick Access... "
Set-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " LaunchTo " -Type DWord -Value 1
Write-Host " Unrestricting AutoLogger directory "
$autoLoggerDir = " $env:PROGRAMDATA \Microsoft\Diagnosis\ETLLogs\AutoLogger "
icacls $autoLoggerDir / grant : r SYSTEM : ` ( OI ` ) ` ( CI ` ) F | Out-Null
Write-Host " Enabling and starting Diagnostics Tracking Service "
Set-Service " DiagTrack " -StartupType Automatic
Start-Service " DiagTrack "
Write-Host " Hiding known file extensions "
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " HideFileExt " -Type DWord -Value 1
Write-Host " Reset Local Group Policies to Stock Defaults "
# cmd /c secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose
cmd / c RD / S / Q " %WinDir%\System32\GroupPolicyUsers "
cmd / c RD / S / Q " %WinDir%\System32\GroupPolicy "
cmd / c gpupdate / force
# Considered using Invoke-GPUpdate but requires module most people won't have installed
Write-Output " Adjusting visual effects for appearance... "
Set-ItemProperty -Path " HKCU:\Control Panel\Desktop " -Name " DragFullWindows " -Type String -Value 1
Set-ItemProperty -Path " HKCU:\Control Panel\Desktop " -Name " MenuShowDelay " -Type String -Value 400
Set-ItemProperty -Path " HKCU:\Control Panel\Desktop " -Name " UserPreferencesMask " -Type Binary -Value ( [ byte[] ] ( 158 , 30 , 7 , 128 , 18 , 0 , 0 , 0 ) )
Set-ItemProperty -Path " HKCU:\Control Panel\Desktop\WindowMetrics " -Name " MinAnimate " -Type String -Value 1
Set-ItemProperty -Path " HKCU:\Control Panel\Keyboard " -Name " KeyboardDelay " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " ListviewAlphaSelect " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " ListviewShadow " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced " -Name " TaskbarAnimations " -Type DWord -Value 1
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects " -Name " VisualFXSetting " -Type DWord -Value 3
Set-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\DWM " -Name " EnableAeroPeek " -Type DWord -Value 1
Write-Host " Restoring Clipboard History... "
Remove-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Clipboard " -Name " EnableClipboardHistory " -ErrorAction SilentlyContinue
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\System " -Name " AllowClipboardHistory " -ErrorAction SilentlyContinue
Write-Host " Done - Reverted to Stock Settings "
Write-Host " Essential Undo Completed "
2022-05-10 08:37:41 -05:00
$ButtonType = [ System.Windows.MessageBoxButton ] :: OK
2022-05-10 08:18:13 -05:00
$MessageboxTitle = " Undo All "
$Messageboxbody = ( " Done " )
2022-05-10 08:37:41 -05:00
$MessageIcon = [ System.Windows.MessageBoxImage ] :: Information
2022-05-10 08:18:13 -05:00
2022-05-10 08:37:41 -05:00
[ System.Windows.MessageBox ] :: Show ( $Messageboxbody , $MessageboxTitle , $ButtonType , $MessageIcon )
2022-04-29 23:11:51 -05:00
} )
2022-05-10 08:18:13 -05:00
#===========================================================================
# Tab 3 - Config Buttons
#===========================================================================
$WPFFeatureInstall . Add_Click ( {
If ( $WPFFeaturesdotnet . IsChecked -eq $true ) {
Enable-WindowsOptionalFeature -Online -FeatureName " NetFx4-AdvSrvs " -All
Enable-WindowsOptionalFeature -Online -FeatureName " NetFx3 " -All
}
If ( $WPFFeatureshyperv . IsChecked -eq $true ) {
Enable-WindowsOptionalFeature -Online -FeatureName " HypervisorPlatform " -All
Enable-WindowsOptionalFeature -Online -FeatureName " Microsoft-Hyper-V-All " -All
Enable-WindowsOptionalFeature -Online -FeatureName " Microsoft-Hyper-V " -All
Enable-WindowsOptionalFeature -Online -FeatureName " Microsoft-Hyper-V-Tools-All " -All
Enable-WindowsOptionalFeature -Online -FeatureName " Microsoft-Hyper-V-Management-PowerShell " -All
Enable-WindowsOptionalFeature -Online -FeatureName " Microsoft-Hyper-V-Hypervisor " -All
Enable-WindowsOptionalFeature -Online -FeatureName " Microsoft-Hyper-V-Services " -All
Enable-WindowsOptionalFeature -Online -FeatureName " Microsoft-Hyper-V-Management-Clients " -All
cmd / c bcdedit / set hypervisorschedulertype classic
Write-Host " HyperV is now installed and configured. Please Reboot before using. "
}
If ( $WPFFeatureslegacymedia . IsChecked -eq $true ) {
Enable-WindowsOptionalFeature -Online -FeatureName " WindowsMediaPlayer " -All
Enable-WindowsOptionalFeature -Online -FeatureName " MediaPlayback " -All
Enable-WindowsOptionalFeature -Online -FeatureName " DirectPlay " -All
Enable-WindowsOptionalFeature -Online -FeatureName " LegacyComponents " -All
}
If ( $WPFFeaturewsl . IsChecked -eq $true ) {
Enable-WindowsOptionalFeature -Online -FeatureName " VirtualMachinePlatform " -All
Enable-WindowsOptionalFeature -Online -FeatureName " Microsoft-Windows-Subsystem-Linux " -All
Write-Host " WSL is now installed and configured. Please Reboot before using. "
}
If ( $WPFFeaturenfs . IsChecked -eq $true ) {
Enable-WindowsOptionalFeature -Online -FeatureName " ServicesForNFS-ClientOnly " -All
Enable-WindowsOptionalFeature -Online -FeatureName " ClientForNFS-Infrastructure " -All
Enable-WindowsOptionalFeature -Online -FeatureName " NFS-Administration " -All
nfsadmin client stop
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default " -Name " AnonymousUID " -Type DWord -Value 0
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default " -Name " AnonymousGID " -Type DWord -Value 0
nfsadmin client start
nfsadmin client localhost config fileaccess = 755 SecFlavors = + sys -krb5 -krb5i
Write-Host " NFS is now setup for user based NFS mounts "
}
2022-05-10 08:37:41 -05:00
$ButtonType = [ System.Windows.MessageBoxButton ] :: OK
2022-05-10 08:18:13 -05:00
$MessageboxTitle = " All features are now installed "
$Messageboxbody = ( " Done " )
2022-05-10 08:37:41 -05:00
$MessageIcon = [ System.Windows.MessageBoxImage ] :: Information
2022-05-10 08:18:13 -05:00
2022-05-10 08:37:41 -05:00
[ System.Windows.MessageBox ] :: Show ( $Messageboxbody , $MessageboxTitle , $ButtonType , $MessageIcon )
2022-05-10 08:18:13 -05:00
} )
$WPFPanelcontrol . Add_Click ( {
cmd / c control
} )
$WPFPanelnetwork . Add_Click ( {
cmd / c ncpa . cpl
} )
$WPFPanelpower . Add_Click ( {
cmd / c powercfg . cpl
} )
$WPFPanelsound . Add_Click ( {
cmd / c mmsys . cpl
} )
$WPFPanelsystem . Add_Click ( {
cmd / c sysdm . cpl
} )
$WPFPaneluser . Add_Click ( {
cmd / c " control userpasswords2 "
} )
#===========================================================================
# Tab 4 - Updates Buttons
#===========================================================================
$WPFUpdatesdefault . Add_Click ( {
# Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1 reversed!
Set-StrictMode -Version Latest
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'
trap {
Write-Host
Write-Host " ERROR: $_ "
Write-Host ( ( $_ . ScriptStackTrace -split '\r?\n' ) -replace '^(.*)$' , 'ERROR: $1' )
Write-Host ( ( $_ . Exception . ToString ( ) -split '\r?\n' ) -replace '^(.*)$' , 'ERROR EXCEPTION: $1' )
Write-Host
Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...'
Start-Sleep -Seconds ( 60 * 60 )
Exit 1
}
# disable automatic updates.
# XXX this does not seem to work anymore.
# see How to configure automatic updates by using Group Policy or registry settings
# at https://support.microsoft.com/en-us/help/328010
function New-Directory($path ) {
$p , $components = $path -split '[\\/]'
$components | ForEach-Object {
$p = " $p \ $_ "
2022-05-17 09:31:18 -05:00
If ( ! ( Test-Path $p ) ) {
2022-05-10 08:18:13 -05:00
New-Item -ItemType Directory $p | Out-Null
}
}
$null
}
$auPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
New-Directory $auPath
# set NoAutoUpdate.
# 0: Automatic Updates is enabled (default).
# 1: Automatic Updates is disabled.
New-ItemProperty `
-Path $auPath `
-Name NoAutoUpdate `
-Value 0 `
-PropertyType DWORD `
-Force `
| Out-Null
# set AUOptions.
# 1: Keep my computer up to date has been disabled in Automatic Updates.
# 2: Notify of download and installation.
# 3: Automatically download and notify of installation.
# 4: Automatically download and scheduled installation.
New-ItemProperty `
-Path $auPath `
-Name AUOptions `
-Value 3 `
-PropertyType DWORD `
-Force `
| Out-Null
# disable Windows Update Delivery Optimization.
# NB this applies to Windows 10.
# 0: Disabled
# 1: PCs on my local network
# 3: PCs on my local network, and PCs on the Internet
$deliveryOptimizationPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config'
2022-05-17 09:31:18 -05:00
If ( Test-Path $deliveryOptimizationPath ) {
2022-05-10 08:18:13 -05:00
New-ItemProperty `
-Path $deliveryOptimizationPath `
-Name DODownloadMode `
-Value 0 `
-PropertyType DWORD `
-Force `
| Out-Null
}
# Service tweaks for Windows Update
$services = @ (
" BITS "
" wuauserv "
)
foreach ( $service in $services ) {
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
Write-Host " Setting $service StartupType to Automatic "
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Automatic
}
Write-Host " Enabling driver offering through Windows Update... "
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata " -Name " PreventDeviceMetadataFromNetwork " -ErrorAction SilentlyContinue
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching " -Name " DontPromptForWindowsUpdate " -ErrorAction SilentlyContinue
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching " -Name " DontSearchWindowsUpdate " -ErrorAction SilentlyContinue
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching " -Name " DriverUpdateWizardWuSearchEnabled " -ErrorAction SilentlyContinue
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate " -Name " ExcludeWUDriversInQualityUpdate " -ErrorAction SilentlyContinue
Write-Host " Enabling Windows Update automatic restart... "
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU " -Name " NoAutoRebootWithLoggedOnUsers " -ErrorAction SilentlyContinue
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU " -Name " AUPowerManagement " -ErrorAction SilentlyContinue
Write-Host " Enabled driver offering through Windows Update "
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings " -Name " BranchReadinessLevel " -ErrorAction SilentlyContinue
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings " -Name " DeferFeatureUpdatesPeriodInDays " -ErrorAction SilentlyContinue
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings " -Name " DeferQualityUpdatesPeriodInDays " -ErrorAction SilentlyContinue
### Reset Windows Update Script - reregister dlls, services, and remove registry entires.
Write-Host " 1. Stopping Windows Update Services... "
Stop-Service -Name BITS
Stop-Service -Name wuauserv
Stop-Service -Name appidsvc
Stop-Service -Name cryptsvc
Write-Host " 2. Remove QMGR Data file... "
Remove-Item " $env:allusersprofile \Application Data\Microsoft\Network\Downloader\qmgr*.dat " -ErrorAction SilentlyContinue
Write-Host " 3. Renaming the Software Distribution and CatRoot Folder... "
Rename-Item $env:systemroot \ SoftwareDistribution SoftwareDistribution . bak -ErrorAction SilentlyContinue
Rename-Item $env:systemroot \ System32 \ Catroot2 catroot2 . bak -ErrorAction SilentlyContinue
Write-Host " 4. Removing old Windows Update log... "
Remove-Item $env:systemroot \ WindowsUpdate . log -ErrorAction SilentlyContinue
Write-Host " 5. Resetting the Windows Update Services to defualt settings... "
" sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU) "
" sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU) "
Set-Location $env:systemroot \ system32
Write-Host " 6. Registering some DLLs... "
regsvr32 . exe / s atl . dll
regsvr32 . exe / s urlmon . dll
regsvr32 . exe / s mshtml . dll
regsvr32 . exe / s shdocvw . dll
regsvr32 . exe / s browseui . dll
regsvr32 . exe / s jscript . dll
regsvr32 . exe / s vbscript . dll
regsvr32 . exe / s scrrun . dll
regsvr32 . exe / s msxml . dll
regsvr32 . exe / s msxml3 . dll
regsvr32 . exe / s msxml6 . dll
regsvr32 . exe / s actxprxy . dll
regsvr32 . exe / s softpub . dll
regsvr32 . exe / s wintrust . dll
regsvr32 . exe / s dssenh . dll
regsvr32 . exe / s rsaenh . dll
regsvr32 . exe / s gpkcsp . dll
regsvr32 . exe / s sccbase . dll
regsvr32 . exe / s slbcsp . dll
regsvr32 . exe / s cryptdlg . dll
regsvr32 . exe / s oleaut32 . dll
regsvr32 . exe / s ole32 . dll
regsvr32 . exe / s shell32 . dll
regsvr32 . exe / s initpki . dll
regsvr32 . exe / s wuapi . dll
regsvr32 . exe / s wuaueng . dll
regsvr32 . exe / s wuaueng1 . dll
regsvr32 . exe / s wucltui . dll
regsvr32 . exe / s wups . dll
regsvr32 . exe / s wups2 . dll
regsvr32 . exe / s wuweb . dll
regsvr32 . exe / s qmgr . dll
regsvr32 . exe / s qmgrprxy . dll
regsvr32 . exe / s wucltux . dll
regsvr32 . exe / s muweb . dll
regsvr32 . exe / s wuwebv . dll
Write-Host " 7) Removing WSUS client settings... "
REG DELETE " HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate " / v AccountDomainSid / f
REG DELETE " HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate " / v PingID / f
REG DELETE " HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate " / v SusClientId / f
Write-Host " 8) Resetting the WinSock... "
netsh winsock reset
netsh winhttp reset proxy
Write-Host " 9) Delete all BITS jobs... "
Get-BitsTransfer | Remove-BitsTransfer
Write-Host " 10) Attempting to install the Windows Update Agent... "
2022-05-17 09:31:18 -05:00
If ( $arch -eq 64 ) {
2022-05-10 08:18:13 -05:00
wusa Windows8-RT -KB2937636 -x64 / quiet
2022-05-17 09:31:18 -05:00
} else {
2022-05-10 08:18:13 -05:00
wusa Windows8-RT -KB2937636 -x86 / quiet
}
Write-Host " 11) Starting Windows Update Services... "
Start-Service -Name BITS
Start-Service -Name wuauserv
Start-Service -Name appidsvc
Start-Service -Name cryptsvc
Write-Host " 12) Forcing discovery... "
wuauclt / resetauthorization / detectnow
Write-Host " Process complete. Please reboot your computer. "
2022-05-10 08:37:41 -05:00
$ButtonType = [ System.Windows.MessageBoxButton ] :: OK
2022-05-10 08:18:13 -05:00
$MessageboxTitle = " Reset Windows Update "
$Messageboxbody = ( " Stock settings loaded. `n Please reboot your computer " )
2022-05-10 08:37:41 -05:00
$MessageIcon = [ System.Windows.MessageBoxImage ] :: Information
2022-05-10 08:18:13 -05:00
2022-05-10 08:37:41 -05:00
[ System.Windows.MessageBox ] :: Show ( $Messageboxbody , $MessageboxTitle , $ButtonType , $MessageIcon )
2022-05-10 08:18:13 -05:00
} )
$WPFUpdatesdisable . Add_Click ( {
# Source: https://github.com/rgl/windows-vagrant/blob/master/disable-windows-updates.ps1
Set-StrictMode -Version Latest
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'
trap {
Write-Host
Write-Host " ERROR: $_ "
Write-Host ( ( $_ . ScriptStackTrace -split '\r?\n' ) -replace '^(.*)$' , 'ERROR: $1' )
Write-Host ( ( $_ . Exception . ToString ( ) -split '\r?\n' ) -replace '^(.*)$' , 'ERROR EXCEPTION: $1' )
Write-Host
Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...'
Start-Sleep -Seconds ( 60 * 60 )
Exit 1
}
# disable automatic updates.
# XXX this does not seem to work anymore.
# see How to configure automatic updates by using Group Policy or registry settings
# at https://support.microsoft.com/en-us/help/328010
function New-Directory($path ) {
$p , $components = $path -split '[\\/]'
$components | ForEach-Object {
$p = " $p \ $_ "
2022-05-17 09:31:18 -05:00
If ( ! ( Test-Path $p ) ) {
2022-05-10 08:18:13 -05:00
New-Item -ItemType Directory $p | Out-Null
}
}
$null
}
$auPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
New-Directory $auPath
# set NoAutoUpdate.
# 0: Automatic Updates is enabled (default).
# 1: Automatic Updates is disabled.
New-ItemProperty `
-Path $auPath `
-Name NoAutoUpdate `
-Value 1 `
-PropertyType DWORD `
-Force `
| Out-Null
# set AUOptions.
# 1: Keep my computer up to date has been disabled in Automatic Updates.
# 2: Notify of download and installation.
# 3: Automatically download and notify of installation.
# 4: Automatically download and scheduled installation.
New-ItemProperty `
-Path $auPath `
-Name AUOptions `
-Value 1 `
-PropertyType DWORD `
-Force `
| Out-Null
# disable Windows Update Delivery Optimization.
# NB this applies to Windows 10.
# 0: Disabled
# 1: PCs on my local network
# 3: PCs on my local network, and PCs on the Internet
$deliveryOptimizationPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config'
2022-05-17 09:31:18 -05:00
If ( Test-Path $deliveryOptimizationPath ) {
2022-05-10 08:18:13 -05:00
New-ItemProperty `
-Path $deliveryOptimizationPath `
-Name DODownloadMode `
-Value 0 `
-PropertyType DWORD `
-Force `
| Out-Null
}
# Service tweaks for Windows Update
$services = @ (
" BITS "
" wuauserv "
)
foreach ( $service in $services ) {
# -ErrorAction SilentlyContinue is so it doesn't write an error to stdout if a service doesn't exist
Write-Host " Setting $service StartupType to Disabled "
Get-Service -Name $service -ErrorAction SilentlyContinue | Set-Service -StartupType Disabled
}
} )
$WPFUpdatessecurity . Add_Click ( {
Write-Host " Disabling driver offering through Windows Update... "
If ( ! ( Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata " -Force | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\Device Metadata " -Name " PreventDeviceMetadataFromNetwork " -Type DWord -Value 1
If ( ! ( Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching " -Force | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching " -Name " DontPromptForWindowsUpdate " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching " -Name " DontSearchWindowsUpdate " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\DriverSearching " -Name " DriverUpdateWizardWuSearchEnabled " -Type DWord -Value 0
If ( ! ( Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate " | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate " -Name " ExcludeWUDriversInQualityUpdate " -Type DWord -Value 1
Write-Host " Disabling Windows Update automatic restart... "
If ( ! ( Test-Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU " ) ) {
New-Item -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU " -Force | Out-Null
}
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU " -Name " NoAutoRebootWithLoggedOnUsers " -Type DWord -Value 1
Set-ItemProperty -Path " HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU " -Name " AUPowerManagement " -Type DWord -Value 0
Write-Host " Disabled driver offering through Windows Update "
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings " -Name " BranchReadinessLevel " -Type DWord -Value 20
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings " -Name " DeferFeatureUpdatesPeriodInDays " -Type DWord -Value 365
Set-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings " -Name " DeferQualityUpdatesPeriodInDays " -Type DWord -Value 4
2022-05-10 08:37:41 -05:00
$ButtonType = [ System.Windows.MessageBoxButton ] :: OK
2022-05-10 08:18:13 -05:00
$MessageboxTitle = " Set Security Updates "
$Messageboxbody = ( " Recommended Update settings loaded " )
2022-05-10 08:37:41 -05:00
$MessageIcon = [ System.Windows.MessageBoxImage ] :: Information
2022-05-10 08:18:13 -05:00
2022-05-10 08:37:41 -05:00
[ System.Windows.MessageBox ] :: Show ( $Messageboxbody , $MessageboxTitle , $ButtonType , $MessageIcon )
2022-05-10 08:18:13 -05:00
} )
2022-04-27 22:42:07 -05:00
#===========================================================================
# Shows the form
#===========================================================================
$Form . ShowDialog ( ) | out-null