Skip to content

Instantly share code, notes, and snippets.

@carlosame
Last active November 26, 2024 13:04
Show Gist options
  • Save carlosame/bf574478513ffd27324eb4dc8637d3aa to your computer and use it in GitHub Desktop.
Save carlosame/bf574478513ffd27324eb4dc8637d3aa to your computer and use it in GitHub Desktop.
PowerShell Profile
## Store in Documents/PowerShell
# File hashes
function md5sum { Get-FileHash -Algorithm MD5 $args }
function sha1sum { Get-FileHash -Algorithm SHA1 $args }
function sha256sum { Get-FileHash -Algorithm SHA256 $args }
# Equivalent of bash `ll` alias
function ll { Get-ChildItem -Force @args }
# whereis, which
function whereis { if (-Not ($args)) { throw "Usage: whereis <name>" } Get-Command -All -ErrorAction "SilentlyContinue" $args | Format-Table CommandType, Name, Definition }
function which { if (-Not ($args)) { throw "Usage: which <name>" } (Get-Command -ErrorAction "SilentlyContinue" $args).Definition }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment