From 332b0080d8c7715f7217d8403ff97c3235f30f99 Mon Sep 17 00:00:00 2001 From: Brian Baker Date: Mon, 24 Jun 2019 14:30:36 -0400 Subject: [PATCH 1/9] (GH-399) Multi-monitor support in Set-TaskbarOptions --- Boxstarter.WinConfig/Set-TaskbarOptions.ps1 | 48 +++++++++++++++++++-- Web/WinConfig.cshtml | 4 +- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 index bb66cdb5..f6bee252 100644 --- a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 @@ -30,6 +30,18 @@ Turn on always show all icons in the notification area .PARAMETER AlwaysShowIconsOff Turn off always show all icons in the notification area +.PARAMETER MultiMonitorOn +Turn on Show tasbkar on all displays. + +.PARAMETER MultiMonitorOff +Turn off Show taskbar on all displays. + +.PARAMETER MultiMonitorMode +Changes the behavior of the Taskbar when using multiple displays. Valid inputs are All, MainAndOpen, and Open. + +.PARAMETER MultiMonitorCombine +Changes the Taskbar Icon combination style for non-primary displays. Valid inputs are Always, Full, and Never. + #> [CmdletBinding(DefaultParameterSetName='unlock')] param( @@ -55,8 +67,16 @@ Turn off always show all icons in the notification area [ValidateSet('Top','Left','Bottom','Right')] $Dock, [ValidateSet('Always','Full','Never')] - $Combine - ) + $Combine, + [Parameter(ParameterSetName='MultiMonitorOn')] + [switch]$MultiMonitorOn, + [Parameter(ParameterSetName='MultiMonitorOff')] + [switch]$MultiMonitorOff, + [ValidateSet('All', 'MainAndOpen', 'Open')] + $MultiMonitorMode, + [ValidateSet('Always','Full','Never')] + $MultiMonitorCombine + ) $explorerKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer' $key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' @@ -85,7 +105,29 @@ Turn off always show all icons in the notification area "Full" { Set-ItemProperty $key TaskbarGlomLevel 1 } "Never" { Set-ItemProperty $key TaskbarGlomLevel 2 } } - } + + if($MultiMonitorOn) + { + Set-ItemProperty $key MMTaskbarEnabled 1 + } + + if($MultiMonitorOff) + { + Set-ItemProperty $key MMTaskbarEnabled 0 + } + + switch($MultiMonitorMode) { + "All" { Set-ItemProperty $key MMTaskbarMode 0 } + "MainAndOpen" { Set-ItemProperty $key MMTaskbarMode 1 } + "Open" {Set-ItemProperty $key MMTaskbarMode 2 } + } + + switch($MultiMonitorCombine) { + "Always" { Set-ItemProperty $key MMTaskbarGlomLevel 0 } + "Full" { Set-ItemProperty $key MMTaskbarGlomLevel 1 } + "Never" { Set-ItemProperty $key MMTaskbarGlomLevel 2 } + } + } if(Test-Path -Path $settingKey) { $settings = (Get-ItemProperty -Path $settingKey -Name Settings).Settings diff --git a/Web/WinConfig.cshtml b/Web/WinConfig.cshtml index 3ed7ed34..54d27487 100644 --- a/Web/WinConfig.cshtml +++ b/Web/WinConfig.cshtml @@ -78,11 +78,11 @@ Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProt

Sets options on the Windows Taskbar

AlwaysShowIconsOn/AlwaysShowIconsOff allows turning on or off always show all icons in the notification area

-Set-TaskbarOptions -Size Small -Lock -Dock Top -Combine Always -AlwaysShowIconsOn
+Set-TaskbarOptions -Size Small -Lock -Dock Top -Combine Always -AlwaysShowIconsOn -MultiMonitorOn -MultiMonitorMode All -MultiMonitorCombine Always
 

It is also possible to do the converse actions, if required.

-    Set-TaskbarOptions -Size Large -UnLock -Dock Bottom -Combine Never -AlwaysShowIconsOff
+    Set-TaskbarOptions -Size Large -UnLock -Dock Bottom -Combine Never -AlwaysShowIconsOff -MultiMonitorOff -MultiMonitorMode Open -MultiMonitorCombine Never
 

Update-ExecutionPolicy

From 84bd29f37e1f8b4d948ae45f46a4d7a9739275bd Mon Sep 17 00:00:00 2001 From: Brian Baker Date: Tue, 16 Jul 2019 16:41:30 -0400 Subject: [PATCH 2/9] (GH-399) Use ParameterSet for multi monitor params --- Boxstarter.WinConfig/Set-TaskbarOptions.ps1 | 30 +++++++++++---------- Web/WinConfig.cshtml | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 index f6bee252..71785c0d 100644 --- a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 @@ -68,12 +68,14 @@ Changes the Taskbar Icon combination style for non-primary displays. Valid inpu $Dock, [ValidateSet('Always','Full','Never')] $Combine, - [Parameter(ParameterSetName='MultiMonitorOn')] - [switch]$MultiMonitorOn, [Parameter(ParameterSetName='MultiMonitorOff')] [switch]$MultiMonitorOff, + [Parameter(ParameterSetName='MultiMonitorOn')] + [switch]$MultiMonitorOn, + [Parameter(ParameterSetName='MultiMonitorOn')] [ValidateSet('All', 'MainAndOpen', 'Open')] $MultiMonitorMode, + [Parameter(ParameterSetName='MultiMonitorOn')] [ValidateSet('Always','Full','Never')] $MultiMonitorCombine ) @@ -109,24 +111,24 @@ Changes the Taskbar Icon combination style for non-primary displays. Valid inpu if($MultiMonitorOn) { Set-ItemProperty $key MMTaskbarEnabled 1 + + switch($MultiMonitorMode) { + "All" { Set-ItemProperty $key MMTaskbarMode 0 } + "MainAndOpen" { Set-ItemProperty $key MMTaskbarMode 1 } + "Open" {Set-ItemProperty $key MMTaskbarMode 2 } + } + + switch($MultiMonitorCombine) { + "Always" { Set-ItemProperty $key MMTaskbarGlomLevel 0 } + "Full" { Set-ItemProperty $key MMTaskbarGlomLevel 1 } + "Never" { Set-ItemProperty $key MMTaskbarGlomLevel 2 } + } } if($MultiMonitorOff) { Set-ItemProperty $key MMTaskbarEnabled 0 } - - switch($MultiMonitorMode) { - "All" { Set-ItemProperty $key MMTaskbarMode 0 } - "MainAndOpen" { Set-ItemProperty $key MMTaskbarMode 1 } - "Open" {Set-ItemProperty $key MMTaskbarMode 2 } - } - - switch($MultiMonitorCombine) { - "Always" { Set-ItemProperty $key MMTaskbarGlomLevel 0 } - "Full" { Set-ItemProperty $key MMTaskbarGlomLevel 1 } - "Never" { Set-ItemProperty $key MMTaskbarGlomLevel 2 } - } } if(Test-Path -Path $settingKey) { diff --git a/Web/WinConfig.cshtml b/Web/WinConfig.cshtml index 54d27487..a6acfe67 100644 --- a/Web/WinConfig.cshtml +++ b/Web/WinConfig.cshtml @@ -82,7 +82,7 @@ Set-TaskbarOptions -Size Small -Lock -Dock Top -Combine Always -AlwaysShowIconsO

It is also possible to do the converse actions, if required.

-    Set-TaskbarOptions -Size Large -UnLock -Dock Bottom -Combine Never -AlwaysShowIconsOff -MultiMonitorOff -MultiMonitorMode Open -MultiMonitorCombine Never
+    Set-TaskbarOptions -Size Large -UnLock -Dock Bottom -Combine Never -AlwaysShowIconsOff -MultiMonitorOff
 

Update-ExecutionPolicy

From 58a322b934499b434aae09aa12869f7e44e60fc4 Mon Sep 17 00:00:00 2001 From: Brian Baker Date: Tue, 16 Jul 2019 16:48:05 -0400 Subject: [PATCH 3/9] (GH-399) Use named parameters for cmdlet calls --- Boxstarter.WinConfig/Set-TaskbarOptions.ps1 | 52 ++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 index 71785c0d..e2ea97f0 100644 --- a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 @@ -57,17 +57,17 @@ Changes the Taskbar Icon combination style for non-primary displays. Valid inpu [switch]$AutoHide, [Parameter(ParameterSetName='locknohide')] [Parameter(ParameterSetName='unlocknohide')] - [switch]$NoAutoHide, - [Parameter(ParameterSetName='AlwaysShowIconsOn')] - [switch]$AlwaysShowIconsOn, - [Parameter(ParameterSetName='AlwaysShowIconsOff')] - [switch]$AlwaysShowIconsOff, - [ValidateSet('Small','Large')] - $Size, - [ValidateSet('Top','Left','Bottom','Right')] - $Dock, - [ValidateSet('Always','Full','Never')] - $Combine, + [switch]$NoAutoHide, + [Parameter(ParameterSetName='AlwaysShowIconsOn')] + [switch]$AlwaysShowIconsOn, + [Parameter(ParameterSetName='AlwaysShowIconsOff')] + [switch]$AlwaysShowIconsOff, + [ValidateSet('Small','Large')] + $Size, + [ValidateSet('Top','Left','Bottom','Right')] + $Dock, + [ValidateSet('Always','Full','Never')] + $Combine, [Parameter(ParameterSetName='MultiMonitorOff')] [switch]$MultiMonitorOff, [Parameter(ParameterSetName='MultiMonitorOn')] @@ -91,43 +91,43 @@ Changes the Taskbar Icon combination style for non-primary displays. Valid inpu if(Test-Path -Path $key) { if($Lock) { - Set-ItemProperty $key TaskbarSizeMove 0 + Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 0 } if($UnLock){ - Set-ItemProperty $key TaskbarSizeMove 1 + Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 1 } switch ($Size) { - "Small" { Set-ItemProperty $key TaskbarSmallIcons 1 } - "Large" { Set-ItemProperty $key TaskbarSmallIcons 0 } + "Small" { Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 1 } + "Large" { Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 0 } } switch($Combine) { - "Always" { Set-ItemProperty $key TaskbarGlomLevel 0 } - "Full" { Set-ItemProperty $key TaskbarGlomLevel 1 } - "Never" { Set-ItemProperty $key TaskbarGlomLevel 2 } + "Always" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 0 } + "Full" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 1 } + "Never" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 2 } } if($MultiMonitorOn) { - Set-ItemProperty $key MMTaskbarEnabled 1 + Set-ItemProperty -Path $key -Name MMTaskbarEnabled -Value 1 switch($MultiMonitorMode) { - "All" { Set-ItemProperty $key MMTaskbarMode 0 } - "MainAndOpen" { Set-ItemProperty $key MMTaskbarMode 1 } - "Open" {Set-ItemProperty $key MMTaskbarMode 2 } + "All" { Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 0 } + "MainAndOpen" { Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 1 } + "Open" {Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 2 } } switch($MultiMonitorCombine) { - "Always" { Set-ItemProperty $key MMTaskbarGlomLevel 0 } - "Full" { Set-ItemProperty $key MMTaskbarGlomLevel 1 } - "Never" { Set-ItemProperty $key MMTaskbarGlomLevel 2 } + "Always" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 0 } + "Full" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 1 } + "Never" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 2 } } } if($MultiMonitorOff) { - Set-ItemProperty $key MMTaskbarEnabled 0 + Set-ItemProperty -Path $key -Name MMTaskbarEnabled -Value 0 } } From 30e3ef995a86ab3b4f1b76074a6d61a2d6906770 Mon Sep 17 00:00:00 2001 From: Brian Baker Date: Sun, 27 Oct 2019 21:08:25 -0400 Subject: [PATCH 4/9] (GH-399) Update code to conform with style guide --- Boxstarter.WinConfig/Set-TaskbarOptions.ps1 | 160 +++++++++++--------- 1 file changed, 89 insertions(+), 71 deletions(-) diff --git a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 index e2ea97f0..bd91e707 100644 --- a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 @@ -43,119 +43,137 @@ Changes the behavior of the Taskbar when using multiple displays. Valid inputs Changes the Taskbar Icon combination style for non-primary displays. Valid inputs are Always, Full, and Never. #> - [CmdletBinding(DefaultParameterSetName='unlock')] - param( + [CmdletBinding(DefaultParameterSetName='unlock')] + param( [Parameter(ParameterSetName='lockhide')] [Parameter(ParameterSetName='locknohide')] - [switch]$Lock, + [switch] + $Lock, + [Parameter(ParameterSetName='unlock')] [Parameter(ParameterSetName='unlockhide')] [Parameter(ParameterSetName='unlocknohide')] - [switch]$UnLock, + [switch] + $UnLock, + [Parameter(ParameterSetName='lockhide')] [Parameter(ParameterSetName='unlockhide')] - [switch]$AutoHide, + [switch] + $AutoHide, + [Parameter(ParameterSetName='locknohide')] [Parameter(ParameterSetName='unlocknohide')] - [switch]$NoAutoHide, + [switch] + $NoAutoHide, + [Parameter(ParameterSetName='AlwaysShowIconsOn')] - [switch]$AlwaysShowIconsOn, + [switch] + $AlwaysShowIconsOn, + [Parameter(ParameterSetName='AlwaysShowIconsOff')] - [switch]$AlwaysShowIconsOff, + [switch] + $AlwaysShowIconsOff, + [ValidateSet('Small','Large')] $Size, + [ValidateSet('Top','Left','Bottom','Right')] $Dock, + [ValidateSet('Always','Full','Never')] $Combine, + [Parameter(ParameterSetName='MultiMonitorOff')] - [switch]$MultiMonitorOff, + [switch] + $MultiMonitorOff, + [Parameter(ParameterSetName='MultiMonitorOn')] - [switch]$MultiMonitorOn, + [switch] + $MultiMonitorOn, + [Parameter(ParameterSetName='MultiMonitorOn')] [ValidateSet('All', 'MainAndOpen', 'Open')] $MultiMonitorMode, + [Parameter(ParameterSetName='MultiMonitorOn')] [ValidateSet('Always','Full','Never')] $MultiMonitorCombine ) - $explorerKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer' - $key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' - $settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2' - - if(-not (Test-Path -Path $settingKey)) { - $settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3' - } - - if(Test-Path -Path $key) { - if($Lock) - { - Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 0 + $explorerKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer' + $key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' + $settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2' + + if (-not (Test-Path -Path $settingKey)) { + $settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3' + } + + if (Test-Path -Path $key) { + if ($Lock) { + Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 0 + } + if ($UnLock) { + Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 1 + } + + switch ($Size) { + "Small" { Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 1 } + "Large" { Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 0 } } - if($UnLock){ - Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 1 - } - - switch ($Size) { - "Small" { Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 1 } - "Large" { Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 0 } - } - - switch($Combine) { - "Always" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 0 } - "Full" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 1 } - "Never" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 2 } - } - - if($MultiMonitorOn) - { + + switch ($Combine) { + "Always" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 0 } + "Full" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 1 } + "Never" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 2 } + } + + if ($MultiMonitorOn) { Set-ItemProperty -Path $key -Name MMTaskbarEnabled -Value 1 - switch($MultiMonitorMode) { + switch ($MultiMonitorMode) { "All" { Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 0 } "MainAndOpen" { Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 1 } - "Open" {Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 2 } + "Open" { Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 2 } } - switch($MultiMonitorCombine) { + switch ($MultiMonitorCombine) { "Always" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 0 } "Full" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 1 } "Never" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 2 } } } - if($MultiMonitorOff) - { + if ($MultiMonitorOff) { Set-ItemProperty -Path $key -Name MMTaskbarEnabled -Value 0 } } - if(Test-Path -Path $settingKey) { - $settings = (Get-ItemProperty -Path $settingKey -Name Settings).Settings - - switch ($Dock) { - "Top" { $settings[12] = 0x01 } - "Left" { $settings[12] = 0x00 } - "Bottom" { $settings[12] = 0x03 } - "Right" { $settings[12] = 0x02 } - } - - if($AutoHide){ - $settings[8] = $settings[8] -bor 1 - } - - if($NoAutoHide){ - $settings[8] = $settings[8] -band 0 - Set-ItemProperty -Path $settingKey -Name Settings -Value $settings - } - - Set-ItemProperty -Path $settingKey -Name Settings -Value $settings - } - - if(Test-Path -Path $explorerKey) { - if($AlwaysShowIconsOn) { Set-ItemProperty -Path $explorerKey -Name 'EnableAutoTray' -Value 0 } - if($alwaysShowIconsOff) { Set-ItemProperty -Path $explorerKey -Name 'EnableAutoTray' -Value 1 } - } - Restart-Explorer + if (Test-Path -Path $settingKey) { + $settings = (Get-ItemProperty -Path $settingKey -Name Settings).Settings + + switch ($Dock) { + "Top" { $settings[12] = 0x01 } + "Left" { $settings[12] = 0x00 } + "Bottom" { $settings[12] = 0x03 } + "Right" { $settings[12] = 0x02 } + } + + if ($AutoHide) { + $settings[8] = $settings[8] -bor 1 + } + + if ($NoAutoHide) { + $settings[8] = $settings[8] -band 0 + Set-ItemProperty -Path $settingKey -Name Settings -Value $settings + } + + Set-ItemProperty -Path $settingKey -Name Settings -Value $settings + } + + if (Test-Path -Path $explorerKey) { + if ($AlwaysShowIconsOn) { Set-ItemProperty -Path $explorerKey -Name 'EnableAutoTray' -Value 0 } + if ($alwaysShowIconsOff) { Set-ItemProperty -Path $explorerKey -Name 'EnableAutoTray' -Value 1 } + } + + Restart-Explorer } From c33aabdb8ed3796238f4793da3ca93a7fc257094 Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Tue, 28 Jan 2020 17:30:05 +0000 Subject: [PATCH 5/9] (GH-399) Whitespace and formatting --- Boxstarter.WinConfig/Set-TaskbarOptions.ps1 | 366 +++++++++++--------- 1 file changed, 206 insertions(+), 160 deletions(-) diff --git a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 index bd91e707..9c31798b 100644 --- a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 @@ -1,179 +1,225 @@ -function Set-TaskbarOptions { -<# -.SYNOPSIS -Sets options for the Windows Task Bar - -.PARAMETER Lock -Locks the taskbar - -.PARAMETER UnLock -Unlocks the taskbar - -.PARAMETER AutoHide -Autohides the taskbar - -.PARAMETER NoAutoHide -No autohiding on the taskbar - -.PARAMETER Size -Changes the size of the Taskbar Icons. Valid inputs are Small and Large. - -.PARAMETER Dock -Changes the location in which the Taskbar is docked. Valid inputs are Top, Left, Bottom and Right. - -.PARAMETER Combine -Changes the Taskbar Icon combination style. Valid inputs are Always, Full, and Never. - -.PARAMETER AlwaysShowIconsOn -Turn on always show all icons in the notification area - -.PARAMETER AlwaysShowIconsOff -Turn off always show all icons in the notification area - -.PARAMETER MultiMonitorOn -Turn on Show tasbkar on all displays. - -.PARAMETER MultiMonitorOff -Turn off Show taskbar on all displays. - -.PARAMETER MultiMonitorMode -Changes the behavior of the Taskbar when using multiple displays. Valid inputs are All, MainAndOpen, and Open. - -.PARAMETER MultiMonitorCombine -Changes the Taskbar Icon combination style for non-primary displays. Valid inputs are Always, Full, and Never. - -#> - [CmdletBinding(DefaultParameterSetName='unlock')] - param( - [Parameter(ParameterSetName='lockhide')] - [Parameter(ParameterSetName='locknohide')] +function Set-TaskbarOptions { +<# +.SYNOPSIS +Sets options for the Windows Task Bar + +.PARAMETER Lock +Locks the taskbar + +.PARAMETER UnLock +Unlocks the taskbar + +.PARAMETER AutoHide +Autohides the taskbar + +.PARAMETER NoAutoHide +No autohiding on the taskbar + +.PARAMETER Size +Changes the size of the Taskbar Icons. Valid inputs are Small and Large. + +.PARAMETER Dock +Changes the location in which the Taskbar is docked. Valid inputs are Top, Left, Bottom and Right. + +.PARAMETER Combine +Changes the Taskbar Icon combination style. Valid inputs are Always, Full, and Never. + +.PARAMETER AlwaysShowIconsOn +Turn on always show all icons in the notification area + +.PARAMETER AlwaysShowIconsOff +Turn off always show all icons in the notification area + +.PARAMETER MultiMonitorOn +Turn on Show tasbkar on all displays. + +.PARAMETER MultiMonitorOff +Turn off Show taskbar on all displays. + +.PARAMETER MultiMonitorMode +Changes the behavior of the Taskbar when using multiple displays. Valid inputs are All, MainAndOpen, and Open. + +.PARAMETER MultiMonitorCombine +Changes the Taskbar Icon combination style for non-primary displays. Valid inputs are Always, Full, and Never. + +#> + [CmdletBinding(DefaultParameterSetName='unlock')] + param( + [Parameter(ParameterSetName='lockhide')] + [Parameter(ParameterSetName='locknohide')] [switch] $Lock, - - [Parameter(ParameterSetName='unlock')] - [Parameter(ParameterSetName='unlockhide')] - [Parameter(ParameterSetName='unlocknohide')] + + [Parameter(ParameterSetName='unlock')] + [Parameter(ParameterSetName='unlockhide')] + [Parameter(ParameterSetName='unlocknohide')] [switch] $UnLock, - - [Parameter(ParameterSetName='lockhide')] - [Parameter(ParameterSetName='unlockhide')] + + [Parameter(ParameterSetName='lockhide')] + [Parameter(ParameterSetName='unlockhide')] [switch] $AutoHide, - - [Parameter(ParameterSetName='locknohide')] - [Parameter(ParameterSetName='unlocknohide')] + + [Parameter(ParameterSetName='locknohide')] + [Parameter(ParameterSetName='unlocknohide')] [switch] $NoAutoHide, - - [Parameter(ParameterSetName='AlwaysShowIconsOn')] + + [Parameter(ParameterSetName='AlwaysShowIconsOn')] [switch] $AlwaysShowIconsOn, - - [Parameter(ParameterSetName='AlwaysShowIconsOff')] + + [Parameter(ParameterSetName='AlwaysShowIconsOff')] [switch] $AlwaysShowIconsOff, - - [ValidateSet('Small','Large')] - $Size, - [ValidateSet('Top','Left','Bottom','Right')] - $Dock, + [ValidateSet('Small','Large')] + $Size, + + [ValidateSet('Top','Left','Bottom','Right')] + $Dock, - [ValidateSet('Always','Full','Never')] - $Combine, + [ValidateSet('Always','Full','Never')] + $Combine, - [Parameter(ParameterSetName='MultiMonitorOff')] + [Parameter(ParameterSetName='MultiMonitorOff')] [switch] - $MultiMonitorOff, + $MultiMonitorOff, - [Parameter(ParameterSetName='MultiMonitorOn')] + [Parameter(ParameterSetName='MultiMonitorOn')] [switch] - $MultiMonitorOn, - - [Parameter(ParameterSetName='MultiMonitorOn')] - [ValidateSet('All', 'MainAndOpen', 'Open')] - $MultiMonitorMode, - - [Parameter(ParameterSetName='MultiMonitorOn')] - [ValidateSet('Always','Full','Never')] - $MultiMonitorCombine - ) - - $explorerKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer' - $key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' - $settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2' - - if (-not (Test-Path -Path $settingKey)) { - $settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3' - } - - if (Test-Path -Path $key) { - if ($Lock) { - Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 0 - } - if ($UnLock) { - Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 1 - } - - switch ($Size) { - "Small" { Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 1 } - "Large" { Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 0 } - } - - switch ($Combine) { - "Always" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 0 } - "Full" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 1 } - "Never" { Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 2 } - } - - if ($MultiMonitorOn) { - Set-ItemProperty -Path $key -Name MMTaskbarEnabled -Value 1 - - switch ($MultiMonitorMode) { - "All" { Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 0 } - "MainAndOpen" { Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 1 } - "Open" { Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 2 } - } - - switch ($MultiMonitorCombine) { - "Always" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 0 } - "Full" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 1 } - "Never" { Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 2 } - } - } - - if ($MultiMonitorOff) { - Set-ItemProperty -Path $key -Name MMTaskbarEnabled -Value 0 - } - } - - if (Test-Path -Path $settingKey) { - $settings = (Get-ItemProperty -Path $settingKey -Name Settings).Settings - - switch ($Dock) { - "Top" { $settings[12] = 0x01 } - "Left" { $settings[12] = 0x00 } - "Bottom" { $settings[12] = 0x03 } - "Right" { $settings[12] = 0x02 } - } - - if ($AutoHide) { - $settings[8] = $settings[8] -bor 1 - } - - if ($NoAutoHide) { - $settings[8] = $settings[8] -band 0 - Set-ItemProperty -Path $settingKey -Name Settings -Value $settings - } - - Set-ItemProperty -Path $settingKey -Name Settings -Value $settings - } - - if (Test-Path -Path $explorerKey) { - if ($AlwaysShowIconsOn) { Set-ItemProperty -Path $explorerKey -Name 'EnableAutoTray' -Value 0 } - if ($alwaysShowIconsOff) { Set-ItemProperty -Path $explorerKey -Name 'EnableAutoTray' -Value 1 } + $MultiMonitorOn, + + [Parameter(ParameterSetName='MultiMonitorOn')] + [ValidateSet('All', 'MainAndOpen', 'Open')] + $MultiMonitorMode, + + [Parameter(ParameterSetName='MultiMonitorOn')] + [ValidateSet('Always','Full','Never')] + $MultiMonitorCombine + ) + + $explorerKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer' + $key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' + $settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2' + + if (-not (Test-Path -Path $settingKey)) { + $settingKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3' } - - Restart-Explorer -} + + if (Test-Path -Path $key) { + if ($Lock) { + Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 0 + } + + if ($UnLock) { + Set-ItemProperty -Path $key -Name TaskbarSizeMove -Value 1 + } + + switch ($Size) { + "Small" { + Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 1 + } + + "Large" { + Set-ItemProperty -Path $key -Name TaskbarSmallIcons -Value 0 + } + } + + switch ($Combine) { + "Always" { + Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 0 + } + + "Full" { + Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 1 + } + + "Never" { + Set-ItemProperty -Path $key -Name TaskbarGlomLevel -Value 2 + } + } + + if ($MultiMonitorOn) { + Set-ItemProperty -Path $key -Name MMTaskbarEnabled -Value 1 + + switch ($MultiMonitorMode) { + "All" { + Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 0 + } + + "MainAndOpen" { + Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 1 + } + + "Open" { + Set-ItemProperty -Path $key -Name MMTaskbarMode -Value 2 + } + } + + switch ($MultiMonitorCombine) { + "Always" { + Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 0 + } + + "Full" { + Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 1 + } + + "Never" { + Set-ItemProperty -Path $key -Name MMTaskbarGlomLevel -Value 2 + } + } + } + + if ($MultiMonitorOff) { + Set-ItemProperty -Path $key -Name MMTaskbarEnabled -Value 0 + } + } + + if (Test-Path -Path $settingKey) { + $settings = (Get-ItemProperty -Path $settingKey -Name Settings).Settings + + switch ($Dock) { + "Top" { + $settings[12] = 0x01 + } + + "Left" { + $settings[12] = 0x00 + } + + "Bottom" { + $settings[12] = 0x03 + } + + "Right" { + $settings[12] = 0x02 + } + } + + if ($AutoHide) { + $settings[8] = $settings[8] -bor 1 + } + + if ($NoAutoHide) { + $settings[8] = $settings[8] -band 0 + Set-ItemProperty -Path $settingKey -Name Settings -Value $settings + } + + Set-ItemProperty -Path $settingKey -Name Settings -Value $settings + } + + if (Test-Path -Path $explorerKey) { + if ($AlwaysShowIconsOn) { + Set-ItemProperty -Path $explorerKey -Name 'EnableAutoTray' -Value 0 + } + + if ($alwaysShowIconsOff) { + Set-ItemProperty -Path $explorerKey -Name 'EnableAutoTray' -Value 1 + } + } + + Restart-Explorer +} \ No newline at end of file From ac56781e21cf1f58f88f0572cbb7ce5ce4ae434e Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Tue, 28 Jan 2020 17:31:30 +0000 Subject: [PATCH 6/9] (GH-399) Add missing parameter data types --- Boxstarter.WinConfig/Set-TaskbarOptions.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 index 9c31798b..adaec7db 100644 --- a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 @@ -75,12 +75,15 @@ Changes the Taskbar Icon combination style for non-primary displays. Valid inpu $AlwaysShowIconsOff, [ValidateSet('Small','Large')] + [String] $Size, [ValidateSet('Top','Left','Bottom','Right')] + [String] $Dock, [ValidateSet('Always','Full','Never')] + [String] $Combine, [Parameter(ParameterSetName='MultiMonitorOff')] @@ -93,10 +96,12 @@ Changes the Taskbar Icon combination style for non-primary displays. Valid inpu [Parameter(ParameterSetName='MultiMonitorOn')] [ValidateSet('All', 'MainAndOpen', 'Open')] + [String] $MultiMonitorMode, [Parameter(ParameterSetName='MultiMonitorOn')] [ValidateSet('Always','Full','Never')] + [String] $MultiMonitorCombine ) From a598600a75f73cb5934cb789847c7977689a1b63 Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Tue, 28 Jan 2020 17:33:58 +0000 Subject: [PATCH 7/9] (GH-399) Add examples and fixup comments --- Boxstarter.WinConfig/Set-TaskbarOptions.ps1 | 34 +++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 index adaec7db..dd998dce 100644 --- a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 @@ -1,34 +1,34 @@ function Set-TaskbarOptions { <# .SYNOPSIS -Sets options for the Windows Task Bar +Sets options for the Windows Task Bar. .PARAMETER Lock -Locks the taskbar +Locks the taskbar. .PARAMETER UnLock -Unlocks the taskbar +Unlocks the taskbar. .PARAMETER AutoHide -Autohides the taskbar +Autohides the taskbar. .PARAMETER NoAutoHide -No autohiding on the taskbar +No autohiding on the taskbar. .PARAMETER Size -Changes the size of the Taskbar Icons. Valid inputs are Small and Large. +Changes the size of the taskbar icons. Valid inputs are Small and Large. .PARAMETER Dock -Changes the location in which the Taskbar is docked. Valid inputs are Top, Left, Bottom and Right. +Changes the location in which the taskbar is docked. Valid inputs are Top, Left, Bottom and Right. .PARAMETER Combine -Changes the Taskbar Icon combination style. Valid inputs are Always, Full, and Never. +Changes the taskbar icon combination style. Valid inputs are Always, Full, and Never. .PARAMETER AlwaysShowIconsOn -Turn on always show all icons in the notification area +Turn on always show all icons in the notification area. .PARAMETER AlwaysShowIconsOff -Turn off always show all icons in the notification area +Turn off always show all icons in the notification area. .PARAMETER MultiMonitorOn Turn on Show tasbkar on all displays. @@ -37,11 +37,21 @@ Turn on Show tasbkar on all displays. Turn off Show taskbar on all displays. .PARAMETER MultiMonitorMode -Changes the behavior of the Taskbar when using multiple displays. Valid inputs are All, MainAndOpen, and Open. +Changes the behavior of the taskbar when using multiple displays. Valid inputs are All, MainAndOpen, and Open. .PARAMETER MultiMonitorCombine -Changes the Taskbar Icon combination style for non-primary displays. Valid inputs are Always, Full, and Never. +Changes the taskbar icon combination style for non-primary displays. Valid inputs are Always, Full, and Never. +.EXAMPLE +Set-TaskbarOptions -Lock -AutoHide -AlwaysShowIconsOff -MultiMonitorOff + +Locks the taskbar, enabled auto-hiding of the taskbar, turns off showing icons +in the notification area and turns off showing the taskbar on multiple monitors. +.EXAMPLE +Set-TaskbarOptions -Unlock -AlwaysShowIconsOn -Size Large -MultiMonitorOn -MultiMonitorCombine Always + +Unlocks the taskbar and always shows large notification icons. Sets +multi-monitor support and always combine icons on non-primary monitors. #> [CmdletBinding(DefaultParameterSetName='unlock')] param( From 9f81dc609012f78d7407ae7615d43d6b1844e3aa Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Tue, 28 Jan 2020 17:37:24 +0000 Subject: [PATCH 8/9] (GH-399) Rename function and add alias --- ...-TaskbarOptions.ps1 => Set-BoxstarterTaskbarOptions.ps1} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename Boxstarter.WinConfig/{Set-TaskbarOptions.ps1 => Set-BoxstarterTaskbarOptions.ps1} (94%) diff --git a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-BoxstarterTaskbarOptions.ps1 similarity index 94% rename from Boxstarter.WinConfig/Set-TaskbarOptions.ps1 rename to Boxstarter.WinConfig/Set-BoxstarterTaskbarOptions.ps1 index dd998dce..19319b33 100644 --- a/Boxstarter.WinConfig/Set-TaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-BoxstarterTaskbarOptions.ps1 @@ -1,4 +1,4 @@ -function Set-TaskbarOptions { +function Set-BoxstarterTaskbarOptions { <# .SYNOPSIS Sets options for the Windows Task Bar. @@ -237,4 +237,6 @@ multi-monitor support and always combine icons on non-primary monitors. } Restart-Explorer -} \ No newline at end of file +} + +New-Alias -Name Set-TaskbarOptions -Value Set-BoxstarterTaskbarOptions \ No newline at end of file From 6a9d13ff8669d8123401a82cc92eb6aabb609174 Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Tue, 28 Jan 2020 17:40:36 +0000 Subject: [PATCH 9/9] (GH-399) Update new function name --- .../Boxstarter.WinConfig.psm1 | 2 +- .../Boxstarter.WinConfig.pssproj | 2 +- .../Set-BoxstarterTaskbarOptions.ps1 | 4 +- Boxstarter.WinConfig/Set-TaskbarSmall.ps1 | 6 +- Web/WinConfig.cshtml | 182 +++++++++--------- 5 files changed, 98 insertions(+), 98 deletions(-) diff --git a/Boxstarter.WinConfig/Boxstarter.WinConfig.psm1 b/Boxstarter.WinConfig/Boxstarter.WinConfig.psm1 index 77d3004b..84d9e652 100644 --- a/Boxstarter.WinConfig/Boxstarter.WinConfig.psm1 +++ b/Boxstarter.WinConfig/Boxstarter.WinConfig.psm1 @@ -1,4 +1,4 @@ Resolve-Path $PSScriptRoot\*.ps1 | % { . $_.ProviderPath } -Export-ModuleMember Disable-UAC, Enable-UAC, Get-UAC, Disable-InternetExplorerESC, Disable-GameBarTips, Get-ExplorerOptions, Set-TaskbarSmall, Install-WindowsUpdate, Move-LibraryDirectory, Enable-RemoteDesktop, Set-ExplorerOptions, Get-LibraryNames, Update-ExecutionPolicy, Enable-MicrosoftUpdate, Disable-MicrosoftUpdate, Set-StartScreenOptions, Set-CornerNavigationOptions, Set-WindowsExplorerOptions, Set-TaskbarOptions, Disable-BingSearch, Set-BoxstarterPageFile +Export-ModuleMember Disable-UAC, Enable-UAC, Get-UAC, Disable-InternetExplorerESC, Disable-GameBarTips, Get-ExplorerOptions, Set-TaskbarSmall, Install-WindowsUpdate, Move-LibraryDirectory, Enable-RemoteDesktop, Set-ExplorerOptions, Get-LibraryNames, Update-ExecutionPolicy, Enable-MicrosoftUpdate, Disable-MicrosoftUpdate, Set-StartScreenOptions, Set-CornerNavigationOptions, Set-WindowsExplorerOptions, Set-BoxstarterTaskbarOptions, Disable-BingSearch, Set-BoxstarterPageFile diff --git a/Boxstarter.WinConfig/Boxstarter.WinConfig.pssproj b/Boxstarter.WinConfig/Boxstarter.WinConfig.pssproj index 69ba2a4d..90a4ded7 100644 --- a/Boxstarter.WinConfig/Boxstarter.WinConfig.pssproj +++ b/Boxstarter.WinConfig/Boxstarter.WinConfig.pssproj @@ -49,7 +49,7 @@ - + diff --git a/Boxstarter.WinConfig/Set-BoxstarterTaskbarOptions.ps1 b/Boxstarter.WinConfig/Set-BoxstarterTaskbarOptions.ps1 index 19319b33..1a26f338 100644 --- a/Boxstarter.WinConfig/Set-BoxstarterTaskbarOptions.ps1 +++ b/Boxstarter.WinConfig/Set-BoxstarterTaskbarOptions.ps1 @@ -43,12 +43,12 @@ Changes the behavior of the taskbar when using multiple displays. Valid inputs a Changes the taskbar icon combination style for non-primary displays. Valid inputs are Always, Full, and Never. .EXAMPLE -Set-TaskbarOptions -Lock -AutoHide -AlwaysShowIconsOff -MultiMonitorOff +Set-BoxstarterTaskbarOptions -Lock -AutoHide -AlwaysShowIconsOff -MultiMonitorOff Locks the taskbar, enabled auto-hiding of the taskbar, turns off showing icons in the notification area and turns off showing the taskbar on multiple monitors. .EXAMPLE -Set-TaskbarOptions -Unlock -AlwaysShowIconsOn -Size Large -MultiMonitorOn -MultiMonitorCombine Always +Set-BoxstarterTaskbarOptions -Unlock -AlwaysShowIconsOn -Size Large -MultiMonitorOn -MultiMonitorCombine Always Unlocks the taskbar and always shows large notification icons. Sets multi-monitor support and always combine icons on non-primary monitors. diff --git a/Boxstarter.WinConfig/Set-TaskbarSmall.ps1 b/Boxstarter.WinConfig/Set-TaskbarSmall.ps1 index 746e2543..3bdba3a1 100644 --- a/Boxstarter.WinConfig/Set-TaskbarSmall.ps1 +++ b/Boxstarter.WinConfig/Set-TaskbarSmall.ps1 @@ -3,8 +3,8 @@ function Set-TaskbarSmall { .SYNOPSIS Makes the windows task bar skinny #> - Write-Warning "This command is deprecated, use Set-TaskbarOptions instead." - Write-Warning "Your call to this function will now be routed to the Set-TaskbarOptions function." + Write-Warning "This command is deprecated, use Set-BoxstarterTaskbarOptions instead." + Write-Warning "Your call to this function will now be routed to the Set-BoxstarterTaskbarOptions function." - Set-TaskbarOptions -Size Small + Set-BoxstarterTaskbarOptions -Size Small } diff --git a/Web/WinConfig.cshtml b/Web/WinConfig.cshtml index a6acfe67..bb0a6a78 100644 --- a/Web/WinConfig.cshtml +++ b/Web/WinConfig.cshtml @@ -1,91 +1,91 @@ -@{ - Layout = "~/_ContentLayout.cshtml"; -} - -@section headerBody { -

Boxstarter WinConfig Features

-

Boxstarter provides several commands for customizing the Windows experience

-} -

Below are the commands that Boxstarter makes available to all packages run from within Boxstarter:

-

Disable-InternetExplorerESC

-

Turns off Internet Explorer Enhanced Security Configuration that is on by default on Server OS versions.

- -

Disable-GameBarTips

-

Turns off the GameBar Tips of Windows 10 that are shown when a game - or what Windows 10 thinks is a game - is launched.

- -

Disable-MicrosoftUpdate

-

Turns off the Windows Update option to include updates for other Microsoft products installed on the system.

- -

Disable-UAC

-

Disables UAC. Note that Windows 8 and 8.1 can not launch Windows Store applications with UAC disabled.

- -

Disable-BingSearch

-

Disables the Bing Internet Search when searching from the search field in the Taskbar or Start Menu.

- -

Enable-RemoteDesktop

-

Allows Remote Desktop access to machine and enables Remote Desktop firewall rule.

- -

Enable-MicrosoftUpdate

-

Turns on the Windows Update option to include updates for other Microsoft products installed on the system.

- -

Enable-UAC

-

Enables UAC.

- -

Install-WindowsUpdate

-

Finds, downloads and installs all Windows Updates. By default, only critical updates will be searched. However the command takes a -Criteria argument allowing one to pass a custom Windows Update query.

-

For details about the Install-WindowsUpdate command, run:

-
Help Install-WindowsUpdate -Full
- -

Move-LibraryDirectory

-

Libraries are special folders that map to a specific location on disk. These are usually found somewhere under $env:userprofile. This function can be used to redirect the library folder to a new location on disk. If the new location does not already exist, the directory will be created. Any content in the former library directory will be moved to the new location unless the DoNotMoveOldContent switch is used. Use Get-LibraryNames to discover the names of different libraries and their current physical directories.

- -
-Move-LibraryDirectory "Personal" "$env:UserProfile\skydrive\documents"
-
-

This moves the Personal library (aka Documents) to the documents folder off of the default SkyDrive directory.

- -

Set-StartScreenOptions

-

Sets options for the Start Screen in Windows 8/8.1

-
-Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
-
-

It is also possible to do the converse actions, if required.

-
-Set-StartScreenOptions -DisableBootToDesktop -DisableDesktopBackgroundOnStart -DisableShowStartOnActiveScreen -DisableShowAppsViewOnStartScreen -DisableSearchEverywhereInAppsView -DisableListDesktopAppsFirst
-
- -

Set-CornerNavigationOptions

-

Sets options for the Windows Corner Navigation in Windows 8/8.1

-
-Set-CornerNavigationOptions -EnableUpperRightCornerShowCharms -EnableUpperLeftCornerSwitchApps -EnableUsePowerShellOnWinX
-
-

It is also possible to do the converse actions, if required.

-
-Set-CornerNavigationOptions -DisableUpperRightCornerShowCharms -DisableUpperLeftCornerSwitchApps -DisableUsePowerShellOnWinX
-
- -

Set-WindowsExplorerOptions

-

Sets options on the Windows Explorer shell

-
-Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableOpenFileExplorerToQuickAccess -EnableShowRecentFilesInQuickAccess -EnableShowFrequentFoldersInQuickAccess -EnableExpandToOpenFolder -EnableShowRibbon
-
-

It is also possible to do the converse actions, if required.

-
-Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -DisableShowFileExtensions -DisableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -DisableShowRecentFilesInQuickAccess -DisableShowFrequentFoldersInQuickAccess -DisableExpandToOpenFolder -DisableShowRibbon
-
- -

Set-TaskbarOptions

-

Sets options on the Windows Taskbar

-

AlwaysShowIconsOn/AlwaysShowIconsOff allows turning on or off always show all icons in the notification area

-
-Set-TaskbarOptions -Size Small -Lock -Dock Top -Combine Always -AlwaysShowIconsOn -MultiMonitorOn -MultiMonitorMode All -MultiMonitorCombine Always
-
-

It is also possible to do the converse actions, if required.

-
-    Set-TaskbarOptions -Size Large -UnLock -Dock Bottom -Combine Never -AlwaysShowIconsOff -MultiMonitorOff
-
- -

Update-ExecutionPolicy

-

The execution policy is set in a separate elevated PowerShell process. If running in the Chocolatey runner, the current window cannot be used because its execution policy has been explicitly set.

- -

If on a 64 bit machine, the policy will be set for both 64 and 32 bit shells.

+@{ + Layout = "~/_ContentLayout.cshtml"; +} + +@section headerBody { +

Boxstarter WinConfig Features

+

Boxstarter provides several commands for customizing the Windows experience

+} +

Below are the commands that Boxstarter makes available to all packages run from within Boxstarter:

+

Disable-InternetExplorerESC

+

Turns off Internet Explorer Enhanced Security Configuration that is on by default on Server OS versions.

+ +

Disable-GameBarTips

+

Turns off the GameBar Tips of Windows 10 that are shown when a game - or what Windows 10 thinks is a game - is launched.

+ +

Disable-MicrosoftUpdate

+

Turns off the Windows Update option to include updates for other Microsoft products installed on the system.

+ +

Disable-UAC

+

Disables UAC. Note that Windows 8 and 8.1 can not launch Windows Store applications with UAC disabled.

+ +

Disable-BingSearch

+

Disables the Bing Internet Search when searching from the search field in the Taskbar or Start Menu.

+ +

Enable-RemoteDesktop

+

Allows Remote Desktop access to machine and enables Remote Desktop firewall rule.

+ +

Enable-MicrosoftUpdate

+

Turns on the Windows Update option to include updates for other Microsoft products installed on the system.

+ +

Enable-UAC

+

Enables UAC.

+ +

Install-WindowsUpdate

+

Finds, downloads and installs all Windows Updates. By default, only critical updates will be searched. However the command takes a -Criteria argument allowing one to pass a custom Windows Update query.

+

For details about the Install-WindowsUpdate command, run:

+
Help Install-WindowsUpdate -Full
+ +

Move-LibraryDirectory

+

Libraries are special folders that map to a specific location on disk. These are usually found somewhere under $env:userprofile. This function can be used to redirect the library folder to a new location on disk. If the new location does not already exist, the directory will be created. Any content in the former library directory will be moved to the new location unless the DoNotMoveOldContent switch is used. Use Get-LibraryNames to discover the names of different libraries and their current physical directories.

+ +
+Move-LibraryDirectory "Personal" "$env:UserProfile\skydrive\documents"
+
+

This moves the Personal library (aka Documents) to the documents folder off of the default SkyDrive directory.

+ +

Set-StartScreenOptions

+

Sets options for the Start Screen in Windows 8/8.1

+
+Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
+
+

It is also possible to do the converse actions, if required.

+
+Set-StartScreenOptions -DisableBootToDesktop -DisableDesktopBackgroundOnStart -DisableShowStartOnActiveScreen -DisableShowAppsViewOnStartScreen -DisableSearchEverywhereInAppsView -DisableListDesktopAppsFirst
+
+ +

Set-CornerNavigationOptions

+

Sets options for the Windows Corner Navigation in Windows 8/8.1

+
+Set-CornerNavigationOptions -EnableUpperRightCornerShowCharms -EnableUpperLeftCornerSwitchApps -EnableUsePowerShellOnWinX
+
+

It is also possible to do the converse actions, if required.

+
+Set-CornerNavigationOptions -DisableUpperRightCornerShowCharms -DisableUpperLeftCornerSwitchApps -DisableUsePowerShellOnWinX
+
+ +

Set-WindowsExplorerOptions

+

Sets options on the Windows Explorer shell

+
+Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableOpenFileExplorerToQuickAccess -EnableShowRecentFilesInQuickAccess -EnableShowFrequentFoldersInQuickAccess -EnableExpandToOpenFolder -EnableShowRibbon
+
+

It is also possible to do the converse actions, if required.

+
+Set-WindowsExplorerOptions -DisableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -DisableShowFileExtensions -DisableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -DisableShowRecentFilesInQuickAccess -DisableShowFrequentFoldersInQuickAccess -DisableExpandToOpenFolder -DisableShowRibbon
+
+ +

Set-BoxstarterTaskbarOptions

+

Sets options on the Windows Taskbar (formerly called Set-TaskbarOptions)

+

AlwaysShowIconsOn/AlwaysShowIconsOff allows turning on or off always show all icons in the notification area

+
+Set-BoxstarterTaskbarOptions -Size Small -Lock -Dock Top -Combine Always -AlwaysShowIconsOn -MultiMonitorOn -MultiMonitorMode All -MultiMonitorCombine Always
+
+

It is also possible to do the converse actions, if required.

+
+    Set-BoxstarterTaskbarOptions -Size Large -UnLock -Dock Bottom -Combine Never -AlwaysShowIconsOff -MultiMonitorOff
+
+ +

Update-ExecutionPolicy

+

The execution policy is set in a separate elevated PowerShell process. If running in the Chocolatey runner, the current window cannot be used because its execution policy has been explicitly set.

+ +

If on a 64 bit machine, the policy will be set for both 64 and 32 bit shells.