PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language. Initially, a Windows component only, known as Windows PowerShell, it was made open-source and cross-platform on 18 August 2016 with the introduction of PowerShell Core. The former is built on .NET Framework while the latter on .NET Core.
If you need to automate anything, PowerShell is the way to do it in Windows. It’s not always easy, but it is worth it: automation first!
Some deployment scripts need to check if certain required software is installed on a Windows Machine. You could check if the file is present at a certain location, but there is a better way to check if software is installed: the uninstall database in the Windows Registry. PowerShell makes it really easy to query the registry!
Having a diagram of how your C# projects interlink, can be a big help. I’ve created a small PowerShell script that will produce the diagram based on the .csproj files in a directory. It will generate Yuml.me diagrams based on the dependencies!
MP3s are everywhere and back in 2014 I finally had a phone with enough storage to store a decent amount of them. I use MediaMonkey to add high resolution album covers and to rename the files in a predictable format: Artist – Album – # – Title. The only thing I was missing was a simple way of creating a M3U playlist: PowerShell to the rescue!
PowerShell runs on .NET and uses the .NET regex engine, but PowerShell adds its own string semantics. Two independent failures can break a capture-group replacement: multiline matching and PowerShell interpolating `$1` before it reaches the regex engine.