====== PowerShell Setup ======
===== Setup PowerShell Gallery =====
- Run ''Get-PSRepository'' to verify if PowerShell Gallery is set up properly. If it isn't, you probably need to [[powershell_cheat_sheet#get_install-module_working_behind_a_webproxy|set up the web proxy settings]].
- If ''https://www.powershellgallery.com/api/v2'' is untrusted, run this ''Set-PSRepository -Name PSGallery -InstallationPolicy Trusted''.
- Run ''Find-Module BurntToast'' to verify that modules can be installed. If you get 'Unable to resolve package source...' you will need to [[powershell_manual_module_installation|install it manually]] (don't bother trying to fix it).
===== Install Stuff =====
- Run ''Install-Module -Name BurntToast -Repository PSGallery''.
- Run ''Install-Module -Name Terminal-Icons -Repository PSGallery''.
- Run ''Install-Module posh-git -Scope CurrentUser''.
Older stuff that probably doesn't need to be installed anymore.
- Run ''winget install JanDeDobbeleer.OhMyPosh -s winget''.
===== Setup Profile =====
- Find your profile: ''$PROFILE | Format-List -Force''
- Test if it exists: ''Test-Path $profile''
- Create if it doesn't exist: ''New-Item -path $profile -type file –force''
- Edit it: ''code $profile''
- Put just this in it:
. 'D:\Bin\Manuka\General Scripts\PowerShell startup.ps1'
===== Picking a Theme =====
Current favorites: **pure** (minimalist) or **iterm2**.
* Open Windows Terminal.
* Spit it with two PowerShell terminals.
* In both, switch to an interesting directory, e.g. ''cd C:\Dev\Common\Auto Hot Key\''
* In one terminal, type ''Get-PoshThemes''.
* In the other, type ''Set-PoshPrompt -Theme whatever'' to play with it.
===== Screw it, use my own =====
Run this:
oh-my-posh init pwsh --config 'D:\Bin\Common\Settings\Oh-my-posh themes\tallguy.omp.json' | Invoke-Expression
{{tag>setup powershell}}