mirror of
https://github.com/KiTTYsh/dotfiles.git
synced 2025-12-10 13:19:15 -05:00
add powershell config
This commit is contained in:
16
pwsh/Microsoft.PowerShell_profile.ps1
Normal file
16
pwsh/Microsoft.PowerShell_profile.ps1
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Automatically install oh-my-posh
|
||||||
|
if (-not (Test-Path "$env:LOCALAPPDATA\Programs\oh-my-posh\bin\oh-my-posh.exe")) {
|
||||||
|
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||||
|
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
|
||||||
|
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") # https://stackoverflow.com/a/31845512
|
||||||
|
$env:POSH_INSTALLER = "manual"
|
||||||
|
$env:POSH_THEMES_PATH = "$env:LOCALAPPDATA\Programs\oh-my-posh\themes"
|
||||||
|
}
|
||||||
|
|
||||||
|
# oh-my-posh initialization
|
||||||
|
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/agnoster.minimal.omp.json" | Invoke-Expression
|
||||||
|
|
||||||
|
# Shortcut to edit the hosts file
|
||||||
|
function hosts {
|
||||||
|
Start-Process "notepad.exe" -Args "C:\Windows\system32\drivers\etc\hosts" -Verb runAs
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user