Skip to content

Instantly share code, notes, and snippets.

@michaeljolley
Created March 1, 2022 18:47
Show Gist options
  • Save michaeljolley/e65a1a46477a85ecff7f660eee02fa25 to your computer and use it in GitHub Desktop.
Save michaeljolley/e65a1a46477a85ecff7f660eee02fa25 to your computer and use it in GitHub Desktop.
Powershell user profile
Invoke-Expression (&starship init powershell)
Import-Module Terminal-Icons
Import-Module devtoolbox
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
function fact {
irm -Uri https://uselessfacts.jsph.pl/random.json?language=en | Select -ExpandProperty text
}
function joke {
irm https://icanhazdadjoke.com/ -Headers @{accept = 'application/json'} | select -ExpandProperty joke
}
function 2C {
param (
[Parameter()]
[Alias('Temp')]
[int]
$Temperature
)
($Temperature - 30) / 2
}
function 2F {
param (
[Parameter()]
[Alias('Temp')]
[int]
$Temperature
)
($Temperature * 2) + 30
}
function update {
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
}
function profile {
code $profile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment