Skip to content

Instantly share code, notes, and snippets.

@caphosra
Created August 20, 2021 06:48
Show Gist options
  • Select an option

  • Save caphosra/e15108ad59ba66dc903d1c02ae1cf5e2 to your computer and use it in GitHub Desktop.

Select an option

Save caphosra/e15108ad59ba66dc903d1c02ae1cf5e2 to your computer and use it in GitHub Desktop.
# Use UTF-8 as a charset.
[System.Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("utf-8")
[System.Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("utf-8")
$env:LESSCHARSET = "utf-8"
# Change the theme.
Set-PoshPrompt -Theme powerlevel10k_modern
If ($IsWindows) {
# Create a new command which is equivalent to the "which" keyword in Linux.
function Which-ExecuteFile {
# Just execute "where.exe" with arguments given.
# Why I don't call "where.exe" directly is because the word, "where" is already reserved by default in Powershell.
where.exe $args
}
# Create "which" alias.
Set-Alias -Name which -Value Which-ExecuteFile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment