Skip to content

Commit 451772c

Browse files
committedNov 10, 2021
2 parents 87da55b + 0e53ad2 commit 451772c

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed
 

‎Initialize-Machine.ps1

+11
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,13 @@ Begin
346346
Set-ItemProperty $0 -Name 'BingSearchEnabled' -Type DWord -Value 0
347347
Set-ItemProperty $0 -Name 'CortanaConsent' -Type DWord -Value 0
348348

349+
# DisableWidgets
350+
if ($Win11)
351+
{
352+
$0 = 'HKCU:\SOFTWARE\\Microsoft\Windows\CurrentVersion\Dsh'
353+
if (Test-Path $0) { Set-ItemProperty $0 -Name 'IsPrelaunchEnabled' -Type DWord -Value 0 }
354+
}
355+
349356
# DisableCortana
350357
Write-Verbose "Disabling Cortana..."
351358
$0 = 'HKCU:\SOFTWARE\Microsoft\Personalization\Settings'
@@ -705,6 +712,10 @@ Process
705712

706713
if ($stage -eq 1)
707714
{
715+
# running Windows 11?
716+
$0 = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
717+
$script:Win11 = [int](get-itempropertyvalue -path $0 -name CurrentBuild) -ge 22000
718+
708719
# choco, git, 7zip, chrome
709720
InstallTools
710721

‎Install-Programs.ps1

+15-4
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ Begin
630630
3. Manually pin that wt.lnk shortcut to taskbar
631631
#>
632632

633+
## winget install --id=Microsoft.WindowsTerminal -e --source winget
634+
633635
$parentId = (gwmi win32_process -Filter "processid='$pid'").parentprocessid
634636
if ((gwmi win32_process -Filter "processid='$parentId'").Name -eq 'WindowsTerminal.exe')
635637
{
@@ -640,7 +642,11 @@ Begin
640642
Chocolatize 'microsoft-windows-terminal'
641643

642644
ConfigureTerminalSettings
643-
ConfigureTerminalShortcut
645+
646+
if (!$Win11)
647+
{
648+
ConfigureTerminalShortcut
649+
}
644650

645651
$reminder = 'Windows Terminal', `
646652
" 0. Pin C:\Tools\wt.lnk to Taskbar", `
@@ -822,7 +828,7 @@ Begin
822828
$root = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
823829
$installer = "$root\Common7\IDE\vsixinstaller.exe"
824830

825-
# TODO: update these versions very now and then...
831+
# TODO: update these versions every now and then...
826832

827833
InstallVsix $installer 'EditorGuidelines' 'PaulHarrington/vsextensions/EditorGuidelines/2.2.5/vspackage'
828834
InstallVsix $installer 'InstallerProjects' 'VisualStudioClient/vsextensions/MicrosoftVisualStudio2017InstallerProjects/1.0.0/vspackage'
@@ -992,6 +998,8 @@ Process
992998
return
993999
}
9941000

1001+
$script:Win11 = [int](get-itempropertyvalue -path $0 -name CurrentBuild) -ge 22000
1002+
9951003
if ($AccessKey -and $SecretKey)
9961004
{
9971005
# harmless to do this even before AWS is installed
@@ -1036,7 +1044,8 @@ Process
10361044
DisableCFG
10371045

10381046
InstallThings
1039-
InstallTerminal
1047+
1048+
if (!$Win11) { InstallTerminal }
10401049

10411050
InstallMacrium
10421051

@@ -1061,7 +1070,9 @@ Process
10611070
Chocolatize 'paint.net'
10621071
Chocolatize 'treesizefree'
10631072
Chocolatize 'vlc'
1064-
InstallDateInTray
1073+
1074+
if (!$Win11) { InstallDateInTray }
1075+
10651076
InstallWiLMa
10661077
InstallWmiExplorer
10671078
}

0 commit comments

Comments
 (0)
Please sign in to comment.