-
Notifications
You must be signed in to change notification settings - Fork 179
/
Update-StartMenu.ps1
31 lines (26 loc) · 871 Bytes
/
Update-StartMenu.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
param(
[Parameter()]
[ValidateSet('Light','Dark')]
[string]$theme = 'Dark'
)
Write-Host "Updating PowerShell shortcuts on the Start Menu"
$appdataFolder = $env:APPDATA
$startFolder = resolve-path "$appdataFolder\Microsoft\Windows\Start Menu"
$powerShellFolder = resolve-path "$startFolder\Programs\Windows PowerShell"
Write-Host "Looking in $powerShellFolder"
Write-Host
$powerShellx86 = "$powerShellFolder\Windows PowerShell (x86).lnk"
if (test-path $powerShellx86) {
Write-Host "Updating $powerShellx86"
.\Update-Link.ps1 $powerShellx86 $theme
} else {
Write-Warning "Didn't find $powerShellx86"
}
Write-Host
$powerShell64 = "$powerShellFolder\Windows PowerShell.lnk"
if (test-path $powerShell64) {
Write-Host "Updating $powerShell64"
.\Update-Link.ps1 $powerShell64 $theme
} else {
Write-Warning "Didn't find $powerShell64"
}