Skip to content
Carl C edited this page Jun 4, 2021 · 6 revisions

Welcome to the scripts-pwsh wiki!

This wiki is a work-in-progress. I will use this space to jot down extra information I might not have covered in the actual README.md.

Powershell is a wonderful automation language and shell. There are so many possibilities with this tool.

Every day I learn something new, and it's easy to learn due to the impressive Get-Help system.

Tips and Tricks

If you set $env:PAGER to a unix-like pager (ex. "less"), then Powershell will use it for paging the help command instead of the standard more.com command. The MORE command is only able to page down, but less can page up or down and has nice keybindings!

$env:PAGER = "less"
# Can also use Set-Item or New-Item:
New-Item Env:\PAGER -Value "less"

If you don't have less, you can either install it from it's official git repo or from cli package managers like scoop or choco or possibly Microsoft's own Windows Package Manager Cli winget.

less is a pager like more, but it gives more control, and most importantly, allows you to page UP as well as DOWN.

Links and Resources

  • Powershell Online Docs
  • The get-help command in Powershell
  • The Get-ChildItemColor Powershell module! Check it out! It provides a colored Get-ChildItem command that is similar to Unix's ls --color=auto command. Get-ChildItemColor also comes with a Get-ChildItemColorFormatWide command. I aliased it to lsc.

Modules and Frameworks

  • Oh-My-Posh: This is a really cool prompt-customization framework that evolved over time. It now supports not only Powershell, but Zsh and Bash as well!
  • Posh-Git: This module was recommended by the official Microsoft Windows Terminal docs found here.
    Posh-Git includes git command tab-complete and other niceties.

As with any tab-complete, you can use CTRL-Space to see ALL possible completions when using PSReadline

Thanks

  • Thanks to the Microsoft team and everyone who contributes to the Powershell repo.
  • Thank you Linus Torvalds for git!