PowerShell SnippetRace 25-28/2022

cat, PSReadLine, Set-PSBreakpoint, Meta programming

Events

  • Expertslive Cafe 14. September 2022 – details coming soon

Snippets

Get-Content – the PowerShell „cat“ command

cat is a powerfull command in Linux. In PowerShell Get-Content is aliased to cat by default. Learn about the powerfull possibilities of Get-Content in this blog by Edem Afenyo.

PSReadline 2.2.6

Cursor up, cursor down, type and get a prediction on the next command. All this is done by PSReadline. The newest version predicts commands by default. Give it a try and read the blog on the PowerShell engineering site.

Set-PSBreakpoint

Troubleshooting a script can be time-consuming. Learn (again) how to use Set-PSBreakpoint to debug scripts from Patrick Grünauers blog.

Meta programming example

Jeffrey Hicks wrote a nice article on writing a converter for different conversions. But instead of creating a function for each conversion, he is meta-writing a one-for-all function for any kind of conversions. Great idea and good to learn.

Until next time / R.

Photo by Frank Leuderalbert on Unsplash