diff --git a/NormalizeTextByLength.ps1 b/NormalizeTextByLength.ps1 index 681d38fc..1ba8cf77 100644 --- a/NormalizeTextByLength.ps1 +++ b/NormalizeTextByLength.ps1 @@ -1,16 +1,5 @@ -$string = $null -$sourceText = Get-Content -Path "C:\Tmp\text.txt" -for ($i = 0; $i -lt $sourceText.Count; $i++) { - - if ($i % 2 -eq 0) { - $string += """{0}"","-f $sourceText[$i].Replace("# ","") - } -} - +$text = "" -$text = "Add ""Extract"" to MSI file type context menu","Add ""Run as different user"" from context menu for .exe file type","Add ""Install"" to CAB file type context menu","Remove ""Cast to Device"" from context menu","Remove ""Share"" from context menu","Remove ""Previous Versions"" from file context menu","Remove ""Edit with Paint 3D"" from context menu","Remove ""Include in Library"" from context menu","Remove ""Turn on BitLocker"" from context menu","Remove ""Edit with Photos"" from context menu","Remove ""Create a new video"" from Context Menu","Remove ""Edit"" from Context Menu","Remove ""Print"" from batch and cmd files context menu","Remove ""Compressed (zipped) Folder"" from context menu","Remove ""Rich Text Document"" from context menu","Remove ""Bitmap image"" from context menu","Remove ""Send to"" from folder context menu","Make the ""Open"", ""Print"", ""Edit"" context menu items available, when more than 15 selected","Turn off ""Look for an app in the Microsoft Store"" in ""Open with"" dialog" - -#region Normalize Text by Length $textLength = New-Object System.Collections.ArrayList($null) for ($i = 0; $i -lt $text.Length; $i++) { @@ -20,5 +9,4 @@ for ($i = 0; $i -lt $text.Length; $i++) { ($textLength | Group-Object -Property TextLength | Sort-Object -Property Count -Descending).Group.Text -replace """", """ | ForEach-Object { """{0}""," -f $_ -} -#endregion Normalize Text by Length \ No newline at end of file +} \ No newline at end of file diff --git a/Settings-Defender-Eng.txt b/Settings-Defender-Eng.txt new file mode 100644 index 00000000..abaed98a --- /dev/null +++ b/Settings-Defender-Eng.txt @@ -0,0 +1,7 @@ +Add folder to exclude from Windows Defender Antivirus scan +Turn on Controlled folder access and add protected folders +Hide notification about disabled Smartscreen for Microsoft Edge +Turn on Windows Defender Sandbox +Hide notification about sign in with Microsoft in the Windows Security +Turn on Windows Defender Exploit Guard Network Protection +Turn on Windows Defender PUA Protection \ No newline at end of file diff --git a/Settings-Edge-Eng.txt b/Settings-Edge-Eng.txt new file mode 100644 index 00000000..7c6f0a1f --- /dev/null +++ b/Settings-Edge-Eng.txt @@ -0,0 +1,3 @@ +Do not allow Microsoft Edge to pre-launch at Windows startup, when the system is idle, and each time Microsoft Edge is closed +Do not allow Microsoft Edge to start and load the Start and New Tab page at Windows startup and each time Microsoft Edge is closed +Turn off Windows Defender SmartScreen for Microsoft Edge \ No newline at end of file diff --git a/Settings-Game-Eng.txt b/Settings-Game-Eng.txt new file mode 100644 index 00000000..31fb174d --- /dev/null +++ b/Settings-Game-Eng.txt @@ -0,0 +1,4 @@ +Turn off Game Bar +Turn off Game Mode +Turn off Game Bar tips +Turn off Windows Game Recording and Broadcasting \ No newline at end of file diff --git a/Settings-Menu-Eng.txt b/Settings-Menu-Eng.txt new file mode 100644 index 00000000..74a73573 --- /dev/null +++ b/Settings-Menu-Eng.txt @@ -0,0 +1,19 @@ +Remove "Edit with Paint 3D" from context menu +Remove "Include in Library" from context menu +Remove "Create a new video" from Context Menu +Remove "Rich Text Document" from context menu +Add "Extract" to MSI file type context menu +Add "Install" to CAB file type context menu +Remove "Edit with Photos" from context menu +Remove "Cast to Device" from context menu +Remove "Send to" from folder context menu +Remove "Print" from batch and cmd files context menu +Remove "Compressed (zipped) Folder" from context menu +Turn off "Look for an app in the Microsoft Store" in "Open with" dialog +Make the "Open", "Print", "Edit" context menu items available, when more than 15 selected +Remove "Bitmap image" from context menu +Remove "Share" from context menu +Add "Run as different user" from context menu for .exe file type +Remove "Previous Versions" from file context menu +Remove "Edit" from Context Menu +Remove "Turn on BitLocker" from context menu \ No newline at end of file diff --git a/Settings-Privacy-Eng.txt b/Settings-Privacy-Eng.txt new file mode 100644 index 00000000..3c06a70e --- /dev/null +++ b/Settings-Privacy-Eng.txt @@ -0,0 +1,17 @@ +Change Windows Feedback frequency to "Never" +Turn off "Connected User Experiences and Telemetry" service +Turn off the SQMLogger session at the next computer restart +Do not allow apps to use advertising ID +Do not use sign-in info to automatically finish setting up device after an update or restart +Do not let websites provide locally relevant content by accessing language list +Turn off suggested content in the Settings +Turn off tip, trick, and suggestions as you use Windows +Turn off reserved storage +Turn off automatic installing suggested apps +Do not let apps on other devices open and message apps on this device, and vice versa +Set the operating system diagnostic data level to "Basic" +Turn off the Autologger session at the next computer restart +Turn off per-user services +Do not offer tailored experiences based on the diagnostic data setting +Turn off diagnostics tracking scheduled tasks +Turn off Windows Error Reporting diff --git a/Settings-System-Eng.txt b/Settings-System-Eng.txt new file mode 100644 index 00000000..b99bb17a --- /dev/null +++ b/Settings-System-Eng.txt @@ -0,0 +1,49 @@ +Group svchost.exe processes +Remove Windows capabilities +Turn on Num Lock at startup +Turn on the display of stop error information on the BSoD +Always wait for the network at computer startup and logon +Turn on Storage Sense to automatically free up space +Set the default input method to the English language +Do not allow the computer to turn off the device to save power for desktop +Turn off "The Windows Filtering Platform has blocked a connection" message +Turn off default background apps except +Turn off SmartScreen for apps and files +Turn on .NET 4 runtime for all apps +Launch folder in a separate process +Turn off hibernate +Uninstall OneDrive +Delete temporary files that apps aren't using +Turn on automatic recommended troubleshooting +Delete files in recycle bin if they have been there for over 30 days +Open shortcut to the Command Prompt from Start menu as Administrator +Turn off app suggestions on Start menu +Turn on firewall & network protection +Remove printers +Turn on Windows Sandbox +Turn off sticky Shift key after pressing 5 times +Set power management scheme for desktop and laptop +Turn off Windows Script Host +Set "High performance" in graphics performance preference for apps +Automatically adjust active hours for me based on daily usage +Turn on automatic backup the system registry to the "%WinDir%\System32\Config\RegBack" folder +Set location of the "Desktop", "Documents" "Downloads" "Music", "Pictures" and "Videos" +Use the PrtScn button to open screen snipping +Create old style shortcut for "Devices and Printers" in "%AppData%\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools" +Turn off F1 Help key +Turn on Win32 long paths +Turn on Retpoline patch against Spectre v2 +Do not preserve zone information +Change environment variable for "%Temp%" to "%SystemDrive%\Temp" +Run Storage Sense every month +Never delete files in "Downloads" folder +Turn off location for this device +Turn off Admin Approval Mode for administrators +Turn off Windows features +Turn on updates for other Microsoft products +Enable System Restore +Do not allow Windows 10 to manage default printer +Turn on access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled +Set download mode for delivery optization on "HTTP only" +Turn off Cortana +Turn off IPv6 \ No newline at end of file diff --git a/Settings-Task-Eng.txt b/Settings-Task-Eng.txt new file mode 100644 index 00000000..f7e6ad63 --- /dev/null +++ b/Settings-Task-Eng.txt @@ -0,0 +1,3 @@ +Create scheduled task with the "%TEMP%" folder cleanup in Task Scheduler. The task runs every 62 days +Create task to clean out the "%SystemRoot%\SoftwareDistribution\Download" folder in Task Scheduler. The task runs on Thursdays every 4 weeks +Create scheduled task with the disk cleanup tool in Task Scheduler. The task runs every 90 days \ No newline at end of file diff --git a/Settings-Ui-Eng.txt b/Settings-Ui-Eng.txt new file mode 100644 index 00000000..db686d7c --- /dev/null +++ b/Settings-Ui-Eng.txt @@ -0,0 +1,42 @@ +Set the Control Panel view by large icons +Hide search box or search icon on taskbar +Turn off "New App Installed" notification +Turn off automatically hiding scroll bars +Hide all folders in the navigation pane +Hide "Frequent folders" in Quick access +Choose theme color for default app mode +Show File Name Extensions +Show "This PC" on Desktop +Show Task Manager details +Remove Microsoft Edge shortcut from the Desktop +Import Start menu layout from pre-saved reg file +Show more details in file transfer dialog +Turn off recently added apps on Start Menu +Remove the "Previous Versions" tab from properties context menu +Show more Windows Update restart notifications about restarting +Turn off check boxes to select items +Turn on acrylic taskbar transparency +Always show all icons in the notification area +Hide "Windows Ink Workspace" button in taskbar +Hide Task View button on taskbar +Turn off thumbnail cache removal +Show accent color on the title bars and window borders +Save screenshots by pressing Win+PrtScr to the Desktop +Turn on ribbon in File Explorer +Turn on recycle bin files delete confirmation +Choose theme color for default Windows mode +Turn off user first sign-in animation +Let Windows try to fix apps so they're not blurry +Turn off the "- Shortcut" name extension for new shortcuts +Turn off JPEG desktop wallpaper import quality reduction +Unpin Microsoft Edge and Microsoft Store from taskbar +Show seconds on taskbar clock +Hide People button on the taskbar +Turn off Snap Assist +Show Hidden Files, Folders, and Drives +Show folder merge conflicts +Hide "Recent files" in Quick access +Turn off creation of an Edge shortcut on the desktop for each user profile +Remove 3D Objects folder in "This PC" and in the navigation pane +Turn off app launch tracking to improve Start menu and search results +Set File Explorer to open to This PC by default diff --git a/ToggleButtonsGenerator.ps1 b/ToggleButtonsGenerator.ps1 index d1d99eed..0d35dad8 100644 --- a/ToggleButtonsGenerator.ps1 +++ b/ToggleButtonsGenerator.ps1 @@ -1,213 +1,59 @@ -#region Privacy & Telemetry Normalized Text -$textPrivacy = "Change Windows Feedback frequency to "Never"", -"Turn off automatic installing suggested apps", -"Turn off "Connected User Experiences and Telemetry" service", -"Turn off the SQMLogger session at the next computer restart", -"Do not allow apps to use advertising ID", -"Do not use sign-in info to automatically finish setting up device after an update or restart", "Do not let websites provide locally relevant content by accessing language list", -"Turn off suggested content in the Settings", -"Turn off tip, trick, and suggestions as you use Windows", -"Turn off reserved storage", -"Do not let apps on other devices open and message apps on this device, and vice versa", -"Set the operating system diagnostic data level to "Basic"", -"Turn off the Autologger session at the next computer restart", -"Turn off per-user services", -"Do not offer tailored experiences based on the diagnostic data setting", -"Turn off diagnostics tracking scheduled tasks", -"Turn off Windows Error Reporting" -#endregion Privacy & Telemetry Normalized Text +$currentDir = $MyInvocation.MyCommand.Definition | Split-Path -Parent +$outFile = "{0}\ToggleButtonsGenerator.txt"-f $currentDir -#region UI & Personalization Normalized Text -$textUi = "Set the Control Panel view by large icons", -"Hide search box or search icon on taskbar", -"Turn off "New App Installed" notification", -"Turn off automatically hiding scroll bars", -"Hide all folders in the navigation pane", -"Hide "Frequent folders" in Quick access", -"Choose theme color for default app mode", -"Show File Name Extensions", -"Show "This PC" on Desktop", -"Show Task Manager details", -"Remove Microsoft Edge shortcut from the Desktop", -"Import Start menu layout from pre-saved reg file", -"Show more details in file transfer dialog", -"Turn off recently added apps on Start Menu", -"Remove the "Previous Versions" tab from properties context menu", -"Show more Windows Update restart notifications about restarting", -"Turn off check boxes to select items", -"Turn on acrylic taskbar transparency", -"Always show all icons in the notification area", -"Hide "Windows Ink Workspace" button in taskbar", -"Hide Task View button on taskbar", -"Turn off thumbnail cache removal", -"Show accent color on the title bars and window borders", -"Save screenshots by pressing Win+PrtScr to the Desktop", -"Turn on ribbon in File Explorer", -"Turn on recycle bin files delete confirmation", -"Choose theme color for default Windows mode", -"Turn off user first sign-in animation", -"Let Windows try to fix apps so they're not blurry", -"Turn off the "- Shortcut" name extension for new shortcuts", -"Turn off JPEG desktop wallpaper import quality reduction", -"Unpin Microsoft Edge and Microsoft Store from taskbar", -"Show seconds on taskbar clock", -"Hide People button on the taskbar", -"Turn off Snap Assist", -"Show Hidden Files, Folders, and Drives", -"Show folder merge conflicts", -"Hide "Recent files" in Quick access", -"Turn off creation of an Edge shortcut on the desktop for each user profile", -"Remove 3D Objects folder in "This PC" and in the navigation pane", -"Turn off app launch tracking to improve Start menu and search results", -"Set File Explorer to open to This PC by default" -#endregion UI & Personalization Normalized Text - -#region System Normalized Text -$textSystem = "Group svchost.exe processes", -"Remove Windows capabilities", -"Turn on Num Lock at startup", -"Turn on the display of stop error information on the BSoD", -"Always wait for the network at computer startup and logon", -"Turn on Storage Sense to automatically free up space", -"Set the default input method to the English language", -"Do not allow the computer to turn off the device to save power for desktop", -"Turn off "The Windows Filtering Platform has blocked a connection" message", -"Turn off default background apps except", -"Turn off SmartScreen for apps and files", -"Turn on .NET 4 runtime for all apps", -"Launch folder in a separate process", -"Turn off hibernate", -"Uninstall OneDrive", -"Delete temporary files that apps aren't using", -"Turn on automatic recommended troubleshooting", -"Delete files in recycle bin if they have been there for over 30 days", -"Open shortcut to the Command Prompt from Start menu as Administrator", -"Turn off app suggestions on Start menu", -"Turn on firewall & network protection", -"Remove printers", -"Turn on Windows Sandbox", -"Turn off sticky Shift key after pressing 5 times", -"Set power management scheme for desktop and laptop", -"Turn off Windows Script Host", -"Set "High performance" in graphics performance preference for apps", -"Automatically adjust active hours for me based on daily usage", -"Turn on automatic backup the system registry to the "C:\Windows\System32\config\RegBack" folder", -"Set location of the "Desktop", "Documents" "Downloads" "Music", "Pictures" and "Videos"", -"Use the PrtScn button to open screen snipping", -"Create old style shortcut for "Devices and Printers" in "%AppData%\Roaming\Microsoft\Windows\Start Menu\Programs\System Tools"", -"Turn off F1 Help key", -"Turn on Win32 long paths", -"Turn on Retpoline patch against Spectre v2", -"Do not preserve zone information", -"Change environment variable for "%Temp%" to "%SystemDrive%\Temp"", -"Run Storage Sense every month", -"Never delete files in "Downloads" folder", -"Turn off location for this device", -"Turn off Admin Approval Mode for administrators", -"Turn off Windows features", -"Turn on updates for other Microsoft products", -"Enable System Restore", -"Do not allow Windows 10 to manage default printer", -"Turn on access to mapped drives from app running with elevated permissions with Admin Approval Mode enabled", -"Set download mode for delivery optization on "HTTP only"", -"Turn off Cortana" -#endregion System Normalized Text - -#region Edge Normalized Text -$textEdge = "Do not allow Microsoft Edge to pre-launch at Windows startup, when the system is idle, and each time Microsoft Edge is closed", -"Do not allow Microsoft Edge to start and load the Start and New Tab page at Windows startup and each time Microsoft Edge is closed", -"Turn off Windows Defender SmartScreen for Microsoft Edge" -#endregion Edge Normalized Text - -#region UWP Normalized Text -$textUwp = "Uninstall all UWP apps from all accounts" -#endregion UWP Normalized Text - -#region Windows Game Recording Normalized Text -$textGame = "Turn off Game Bar", "Turn off Game Mode", "Turn off Game Bar tips", "Turn off Windows Game Recording and Broadcasting" -#endregion Windows Game Recording Normalized Text +if (Test-Path -Path $outFile) { + Remove-Item -Path $outFile -Force -Confirm:$false + Write-Warning -Message "File ""ToggleButtonsGenerator.txt"" deleted!" +} -#region Scheduled Tasks Normalized Text -$textTask = "Create scheduled task with the "%TEMP%" folder cleanup in Task Scheduler. The task runs every 62 days", -"Create task to clean out the "%SystemRoot%\SoftwareDistribution\Download" folder in Task Scheduler. The task runs on Thursdays every 4 weeks", -"Create scheduled task with the disk cleanup tool in Task Scheduler. The task runs every 90 days" -#endregion Scheduled Tasks Normalized Text +"Privacy", "Ui", "System", "Edge", "Game", "Task", "Defender", "Menu" | ForEach-Object { + $categoryName = $_ + $categoryFile = "{0}\Settings-{1}-Eng.txt"-f $currentDir, $categoryName -#region Microsoft Defender Normalized Text -$textDefender = "Add folder to exclude from Windows Defender Antivirus scan", -"Turn on Controlled folder access and add protected folders", -"Hide notification about disabled Smartscreen for Microsoft Edge", -"Turn on Windows Defender Sandbox", -"Hide notification about sign in with Microsoft in the Windows Security", -"Turn on Windows Defender Exploit Guard Network Protection", -"Turn on Windows Defender PUA Protection" -#endregion Microsoft Defender Normalized Text + if (Test-Path -Path $categoryFile) { -#region Context Menu Normalized Text -$textMenu = "Remove "Edit with Paint 3D" from context menu", -"Remove "Include in Library" from context menu", -"Remove "Create a new video" from Context Menu", -"Remove "Rich Text Document" from context menu", -"Add "Extract" to MSI file type context menu", -"Add "Install" to CAB file type context menu", -"Remove "Edit with Photos" from context menu", -"Remove "Cast to Device" from context menu", -"Remove "Send to" from folder context menu", -"Remove "Print" from batch and cmd files context menu", -"Remove "Compressed (zipped) Folder" from context menu", -"Turn off "Look for an app in the Microsoft Store" in "Open with" dialog", -"Make the "Open", "Print", "Edit" context menu items available, when more than 15 selected", -"Remove "Bitmap image" from context menu", -"Remove "Share" from context menu", -"Add "Run as different user" from context menu for .exe file type", -"Remove "Previous Versions" from file context menu", -"Remove "Edit" from Context Menu", -"Remove "Turn on BitLocker" from context menu" -#endregion Context Menu Normalized Text +#region Write Header +@" +######################### $categoryName ######################### + + + + + +"@ | Out-File -FilePath $outFile -Append +#endregion Write Header + + $text = Get-Content -Path $categoryFile -#region Toggle Buttons Generator -if (Test-Path -Path "C:\Tmp\toggleButtons.txt") { - Remove-Item -Path "C:\Tmp\toggleButtons.txt" -Force -Confirm:$false -} + for ($i = 0; $i -lt $text.Count; $i++) { + + $string = $text[$i] -$toggleSwitchName = "ToggleSwitchMenu" + if ($string.Contains("""")) { + $string = $text[$i].Replace("""", """) + } -#"ToggleSwitchPrivacy" # For Privacy & Telemetry Settings -#"ToggleSwitchUi" # For UI & Personalization Settings -#"ToggleSwitchSystem" # For System Settings -#"ToggleSwitchEdge" # For Edge Settings -#"ToggleSwitchUwp" # For Uwp Settings -#"ToggleSwitchGame" # For Windows Game Settings -#"ToggleSwitchTasks" # For Scheduled Tasks Settings -#"ToggleSwitchDefender" # For Microsoft Defender Settings -#"ToggleSwitchMenu" # For Context Menu Settings + if ($string.Contains("&")) { + $string = $text[$i].Replace("&", "&") + } -$textBlockName = "TexBlockMenu" -#"TexBlockPrivacy" # For Privacy & Telemetry Settings -#"TexBlockUi" # For UI & Personalization Settings -#"TexBlockSystem" # For System Settings -#"TexBlockEdge" # For Edge Settings -#"TexBlockUwp" # For Uwp Settings -#"TexBlockGame" # For Windows Game Settings -#"TexBlockTasks" # For Scheduled Tasks Settings -#"TexBlockDefender" # For Microsoft Defender Settings -#"TexBlockMenu" # For Context Menu Settings + $toggleName = "ToggleSwitch_{0}_{1}"-f $categoryName, $i + $textBlockName = "TextBlock_{0}_{1}"-f $categoryName, $i -for ($i = 0; $i -lt $text.Length; $i++) { - $content = $text[$i].Replace("""", """) +#region Write Toggle Buttons @" - + - - + + -# -# -# -# -# -# "@ -#endregion GUI with Substrate \ No newline at end of file + else { + Write-Warning -Message "File ""$categoryFile"" not found!" + } +} \ No newline at end of file diff --git a/VS/GUI-7/MainWindow.xaml b/VS/GUI-7/MainWindow.xaml index 6b310a20..e54b2d61 100644 --- a/VS/GUI-7/MainWindow.xaml +++ b/VS/GUI-7/MainWindow.xaml @@ -5,13 +5,46 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Name="Window" - Title="Windows 10 Setup Script" Height="933" Width="969" MinHeight="933" MinWidth="969" - Background="Transparent" + Title="Windows 10 Setup Script" Height="730" Width="900" MinHeight="730" MinWidth="900" + Background="#F1F1F1" FontFamily="Sergio UI" FontSize="16" TextOptions.TextFormattingMode="Display" WindowStartupLocation="CenterScreen" SnapsToDevicePixels="True" WindowStyle="None" ResizeMode="CanResizeWithGrip" AllowsTransparency="True" - ShowInTaskbar="True" Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" + ShowInTaskbar="True" Foreground="#000000" MouseLeftButtonDown="Window_MouseLeftButtonDown"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - + - - - - - + + - + - + - + - + @@ -122,100 +343,3302 @@ + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Win-10-Setup-Script-GUI-2.ps1 b/Win-10-Setup-Script-GUI-2.ps1 deleted file mode 100644 index 86aa0aa3..00000000 --- a/Win-10-Setup-Script-GUI-2.ps1 +++ /dev/null @@ -1,287 +0,0 @@ -Add-Type -AssemblyName "PresentationCore", "PresentationFramework", "WindowsBase" - -[xml]$xamlMarkup = @' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'@ - -$xamlGui = [System.Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $xamlMarkup)) -$xamlMarkup.SelectNodes('//*[@Name]') | ForEach-Object { - New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) - - # if ($_.Name.Contains("ToggleButton")) { - - # $ToggleBtn = $xamlGui.FindName($_.Name) - # [Void]$ToggleButtons.Add($ToggleBtn) - # } - - # else - # { - # New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) - # } -} - -#region Script Functions -function Hide-Console { - <# - .SYNOPSIS - Hide Powershell console before show WPF GUI. - #> - - [CmdletBinding()] - param () - - Add-Type -Name Window -Namespace Console -MemberDefinition ' - [DllImport("Kernel32.dll")] - public static extern IntPtr GetConsoleWindow(); - - [DllImport("user32.dll")] - public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow); -' - [Console.Window]::ShowWindow([Console.Window]::GetConsoleWindow(), 0) -} - -#endregion - -#region Controls Events - -$Window.add_MouseLeftButtonDown( { - $Window.DragMove() - }) - -$ButtonTitleMin.add_MouseLeftButtonDown( { - $Window.WindowState = "Minimized" - }) - -$ButtonTitleMax.add_MouseLeftButtonDown( { - if ($Window.WindowState -eq "Normal") { - $Window.WindowState = "Maximized" - } - - else { - $Window.WindowState = "Normal" - } - }) - -$ButtonTitleClose.add_MouseLeftButtonDown( { - $Window.Close() - }) - -#endregion - -Hide-Console -$xamlGui.ShowDialog() | Out-Null \ No newline at end of file diff --git a/Win-10-Setup-Script-GUI.ps1 b/Win-10-Setup-Script-GUI.ps1 index 99fd12a6..39b03854 100644 --- a/Win-10-Setup-Script-GUI.ps1 +++ b/Win-10-Setup-Script-GUI.ps1 @@ -3,12 +3,12 @@ [xml]$xamlMarkup = @' - + ShowInTaskbar="True" Foreground="#000000"> @@ -42,6 +42,78 @@ + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - + - + - - + + + + - - - + + + + + + + + + + + + + - + - - - + + + + + - - - + + - - + + + + + + + + + + + + + + + - - - - - - + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + - + - + - + - - - - - - + + + - + - + - + - - - - - - + + + - + - + - + + + + + + + - - - - - + + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + @@ -3861,17 +3645,7 @@ $xamlGui = [System.Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $xamlMarkup)) $xamlMarkup.SelectNodes('//*[@Name]') | ForEach-Object { New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) - - # if ($_.Name.Contains("ToggleButton")) { - - # $ToggleBtn = $xamlGui.FindName($_.Name) - # [Void]$ToggleButtons.Add($ToggleBtn) - # } - - # else - # { - # New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) - # } + } #region Script Functions @@ -3898,16 +3672,39 @@ function Hide-Console { #region Controls Events -$xamlGui.add_MouseLeftButtonDown( { - $xamlGui.DragMove() +$Window.add_MouseLeftButtonDown( { + $Window.DragMove() + }) + +$Window.add_SizeChanged( { + if ($Window.ActualWidth -ge 1000) { + $PanelToggle.Orientation = "Horizontal" + $PlaceholderFirstColumn.Visibility = "Visible" + } + + else { + $PanelToggle.Orientation = "Vertical" + $PlaceholderFirstColumn.Visibility = "Collapsed" + } + +}) + +$ButtonTitleMin.add_MouseLeftButtonDown( { + $Window.WindowState = "Minimized" }) -$MinimizeButton.add_MouseLeftButtonDown( { - $xamlGui.WindowState = "Minimized" +$ButtonTitleMax.add_MouseLeftButtonDown( { + if ($Window.WindowState -eq "Normal") { + $Window.WindowState = "Maximized" + } + + else { + $Window.WindowState = "Normal" + } }) -$CloseButton.add_MouseLeftButtonDown( { - $xamlGui.Close() +$ButtonTitleClose.add_MouseLeftButtonDown( { + $Window.Close() }) #endregion