-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-mini.ps
144 lines (135 loc) · 5.91 KB
/
setup-mini.ps
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Open with browser (IE or Edge):
# https://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/golonac/setup/main/setup-mini.ps
# Windows settings
Disable-UAC
try {
Set-ExecutionPolicy RemoteSigned -Scope LocalMachine
}
catch {}
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# Localization
Set-WinSystemLocale fi-FI
Set-WinUserLanguageList fi
Set-TimeZone "FLE Standard Time"
Set-Culture fi-FI
Set-BoxstarterTaskbarOptions -DisableSearchBox
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableOpenFileExplorerToQuickAccess -EnableShowRecentFilesInQuickAccess -EnableShowFrequentFoldersInQuickAccess -EnableExpandToOpenFolder -EnableShowRibbon -EnableItemCheckBox
Disable-InternetExplorerESC
Disable-GameBarTips
Disable-BingSearch
# Install registry settings
reg import (Join-Path $env:ONEDRIVECONSUMER "Setup/WindowsSettings.reg")
# Disable Telemetry
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
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null
Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null
# Set the current network as Private
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
# Remove Fax
Remove-Printer -Name "Fax" -ErrorAction:SilentlyContinue
Install-Module -Name Terminal-Icons
# ChatGPT PowerShell module
Install-Module PowerShellAIAssistant -AllowClobber
function Add-To-Path($Path) {
$Path = [Environment]::GetEnvironmentVariable("PATH", "Machine") + [IO.Path]::PathSeparator + $Path
[Environment]::SetEnvironmentVariable( "Path", $Path, "Machine" )
}
# Core
choco install powershell-core
choco install nodejs
choco install nvm # Node version manager
choco install yarn
choco install git
choco install gsudo # Run elevated in terminal
choco install python
choco install nuget.commandline
choco install poshgit # Git style
choco install oh-my-posh # Terminal style
choco install grep # Find in files
choco install winfetch # Command-line system information utility
choco install powertoys # Windows PowerToys
choco install bat # A cat clone with wings
choco install zoxide # Smart CD command
choco install altsnap # Alt-drag to move windows
choco install ffmpeg # Video info and editing CLI
choco install fzf # Fuzzy finder for bat etc
choco install less
choco install nssm # Non-sucking service manager
choco install openssl # Generate certificates etc
choco install dotnetfx # .NET Framework
choco install vcredist140
choco install vcredist2015
refreshenv
oh-my-posh font install RobotoMono
# Patch an oh-my-posh theme with a PowerShell compatibility setting
$theme = Get-Content "$env:POSH_THEMES_PATH\cobalt2.omp.json" | ConvertFrom-Json
$theme | Add-Member -Name patch_pwsh_bleed -Value $true -MemberType NoteProperty
Set-Content -Path ("$env:POSH_THEMES_PATH\theme.json") -Value ($theme | ConvertTo-Json -Depth 99) -Encoding utf8
# Create a PowerShell (7) and WindowsPowerShell (legacy) profile which enables oh-my-posh on launch
foreach ($item in "PowerShell", "WindowsPowerShell") {
$path = Join-Path ([Environment]::GetFolderPath("MyDocuments")) $item
If (!(Test-Path $path)) {
New-Item -Path $path -Type Directory -Force
}
$profilePath = Join-Path $path "Microsoft.PowerShell_profile.ps1"
Copy-Item "$env:OneDriveConsumer\Setup\Terminal\Microsoft.PowerShell_profile.ps1" $profilePath
}
# Tools
choco install keepass
choco install keepass-plugin-winhello # WinHello plugin for fingerprint login to KeePass
choco install gh # GitHub CLI
choco install winmerge
Add-To-Path $env:ProgramFiles/Winmerge
choco install tidal
choco install joplin
choco install wiztree
choco install czkawka --ignore-checksums
choco install brave # Browser
choco install czawka # Compare files
choco install docker-cli
choco install docker-compose
choco install docker-desktop
choco install nano # Terminal text editor
choco install nano-win
choco install spotify
choco install tidal
choco install visualstudio2022community
choco install vscode
choco install wiztree # Visualize disk usage
# Dev
choco install postman # Make HTTP requests
choco install putty
choco install fjira # JIRA CLI
choco install slack
choco install sql-server-management-studio
choco install terraform
# NPM & tools
refreshenv
npm config set fund false
# Config files from OneDrive
$roamingItems = @{
(Join-Path (Get-Item $PROFILE).DirectoryName "FileSystem.ps1xml") = (Join-Path "$env:OneDriveConsumer" "Setup/Terminal/FileSystem.ps1xml")
(Join-Path $env:LOCALAPPDATA "Packages/Microsoft.WindowsTerminal_8wekyb3d8bbwe/LocalState/settings.json") = (Join-Path "$env:OneDriveConsumer" "Setup/Terminal/settings.json")
}
foreach ($localItemPath in $roamingItems.Keys) {
if (Test-Path $localItemPath) {
$existingItem = Get-Item $localItemPath
if ($existingItem.LinkType -eq "SymbolicLink") {
Write-Host "Local item '$localItemPath' already redirected to '$($existingItem.Target)'"
}
else {
$roamingItemPath = $roamingItems[$localItemPath]
New-Item -ItemType SymbolicLink -Path $localItemPath -Target $roamingItemPath -Force
}
}
else {
$roamingItemPath = $roamingItems[$localItemPath]
New-Item -ItemType SymbolicLink -Path $localItemPath -Target $roamingItemPath
}
}
Enable-UAC