Skip to content

Instantly share code, notes, and snippets.

@jwpleow
Last active July 2, 2024 12:51
Show Gist options
  • Select an option

  • Save jwpleow/6c6680b8a74c587d0bc5533fa322338a to your computer and use it in GitHub Desktop.

Select an option

Save jwpleow/6c6680b8a74c587d0bc5533fa322338a to your computer and use it in GitHub Desktop.
Powershell profile
# Place this in `echo $profile.CurrentUserAllHosts` - e.g.
# C:\Users\woelt\Documents\WindowsPowerShell\profile.ps1
# and set Policy in an admin shell: `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned`
# PSReadLine
# https://github.com/PowerShell/PSReadLine
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
function setupsshkey([string]$hostAndIP)
{
Get-Content ~/.ssh/id_ed25519.pub | ssh "$hostAndIP" 'cat >> .ssh/authorized_keys'
Write-Host "Successfully copied ssh key to $hostAndIP" -ForegroundColor Green
}
function cmakewithvcpkg { cmake -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake $args }
Set-Alias cmakevcpkg cmakewithvcpkg
# Install oh-my-posh from microsoft store (SLOW!)
# oh-my-posh font install -> select Meslo
# oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/capr4n.omp.json" | Invoke-Expression

In an admin shell


Install-Module -Name PowerShellGet -Force
Install-Module PSReadLine -Force
# add to profile as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment