Last active
September 4, 2024 05:45
-
-
Save dongfg/2808f8388660ef70d96a0618b25ab594 to your computer and use it in GitHub Desktop.
[PowerShell Profile] Save file to $PROFILE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Find-Command($cmdname) { | |
return [bool](Get-Command -Name $cmdname -ErrorAction SilentlyContinue) | |
} | |
# Alias | |
Set-Alias ll Get-ChildItem | |
# Git Alias | |
if (Find-Command git) { | |
function Get-GitStatus { git status } | |
Set-Alias gst Get-GitStatus | |
} | |
# Oh My Posh | |
# https://ohmyposh.dev/ | |
if (Find-Command oh-my-posh) { | |
oh-my-posh init pwsh --config ~/Documents/PowerShell/themes/velvet.omp.json | Invoke-Expression | |
} | |
# Fast Node Manager | |
# https://github.com/Schniz/fnm | |
if (Find-Command fnm) { | |
$Env:NODE_DIST_MIRROR = "https://npmmirror.com/mirrors/node/" | |
fnm env --node-dist-mirror $Env:NODE_DIST_MIRROR --use-on-cd --shell power-shell | Out-String | Invoke-Expression | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment