Skip to content

Instantly share code, notes, and snippets.

@blakeNaccarato
Last active January 13, 2024 01:12
Show Gist options
  • Save blakeNaccarato/cc50b9111afbc43ce39d7972770fefc8 to your computer and use it in GitHub Desktop.
Save blakeNaccarato/cc50b9111afbc43ce39d7972770fefc8 to your computer and use it in GitHub Desktop.
One-time setup for Python development on Windows. Installs Python, VSCode, Windows Terminal, PowerShell, and Git.
<#
.SYNOPSIS
One-time setup for Python dev tools on Windows. Installs Python, VSCode, Windows Terminal, PowerShell, and Git.
.DESCRIPTION
Usage:
- Ensure `winget` (Microsoft App Insstaller) is installed from the Windows store or at
https://apps.microsoft.com/store/detail/app-installer/9NBLGGH4NNS1
- Search for "PowerShell" in the start menu, find "Windows PowerShell" (not ISE),
right-click and select "Run as administrator" (may be hidden under "More")
- In the web user interface for this Gist, click "Raw" to get the raw text of this
script, select all (Ctrl+A), copy (Ctrl+C), and paste (Ctrl+V) into the PowerShell
window
- Hit "Enter" to run the pasted lines
- When installation is finished, you will see `PS C:\WINDOWS\system32>` and a blinking
cursor. Close the PowerShell window.
#>
# Install Python
winget install --id 'Python.Python.3.11' --override '/quiet PrependPath=0'
# Install VSCode
winget install --id 'Microsoft.VisualStudioCode'
# Install Windows Terminal
winget install --id 'Microsoft.WindowsTerminal'
# Install PowerShell 7
$PowerShellOverrides = @(
'/quiet'
'ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1'
'ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1'
'ADD_PATH=1'
'ENABLE_MU=1'
'ENABLE_PSREMOTING=1'
'REGISTER_MANIFEST=1'
'USE_MU=1'
)
winget install --id 'Microsoft.PowerShell' --override "$PowerShellOverrides"
# Install git
@'
[Setup]
Lang=default
Dir=C:/Program Files/Git
Group=Git
NoIcons=0
SetupType=default
Components=ext,ext\shellhere,ext\guihere,gitlfs,assoc,assoc_sh,autoupdate,windowsterminal,scalar
Tasks=
EditorOption=VisualStudioCode
CustomEditorPath=
DefaultBranchOption=main
PathOption=Cmd
SSHOption=OpenSSH
TortoiseOption=false
CURLOption=OpenSSL
CRLFOption=CRLFAlways
BashTerminalOption=MinTTY
GitPullBehaviorOption=Merge
UseCredentialManager=Enabled
PerformanceTweaksFSCache=Enabled
EnableSymlinks=Disabled
EnablePseudoConsoleSupport=Disabled
EnableFSMonitor=Enabled
'@ > ($inf = New-TemporaryFile)
winget install --id 'Git.Git' --override "/SILENT /LOADINF=$inf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment