Skip to content

Instantly share code, notes, and snippets.

@sebagomez
Last active June 25, 2019 20:11
Show Gist options
  • Save sebagomez/0ce365570d9c8494442ce5e2a5da074c to your computer and use it in GitHub Desktop.
Save sebagomez/0ce365570d9c8494442ce5e2a5da074c to your computer and use it in GitHub Desktop.
PowerShell Profile
# from https://gist.github.com/jchandra74/5b0c94385175c7a8d1cb39bc5157365e
function ccode { Set-Location c:\code }
# Helper function to set location to the User Profile directory
function cuserprofile { Set-Location ~ }
Set-Alias ~ cuserprofile -Option AllScope
# Ensure posh-git is loaded
Import-Module -Name posh-git
# Ensure oh-my-posh is loaded
Import-Module -Name oh-my-posh
if (-not $?){
Write-Warning "I think you might need to install NuGet and the needed modules. Please run the following commands:"
Write-Host "1) Install-PackageProvider NuGet -MinimumVersion '2.8.5.201' -Force"
Write-Host "2) Set-PSRepository -Name PSGallery -InstallationPolicy Trusted"
Write-Host "3) Install-Module -Name 'posh-git'"
Write-Host "4) Install-Module -Name 'oh-my-posh'"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment