PowerShell

PowerShell

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!

PowerShell snippet: check if software is installed
PowerShell snippet: check if software is installed
Automation, PowerShell, Windows

PowerShell snippet: check if software is installed

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!

Regex Replacement Problem PowerShell: $1?
Regex Replacement Problem PowerShell: $1?
PowerShell, Regular Expression

Regex Replacement Problem PowerShell: $1?

Madre mia! I’ve been trying to edit an HTML file using PowerShell. I only wanted to eliminate all the spans and paragraphs using regular expressions (would make sense)… and how hard can that be?
Well, it turned out to be pretty hard if you’re used to the replacement syntax of regular .Net expressions! After searching for hours I’ve discovered that $1 can’t be used in the same way as in .Net. Just use ${1}. Ouch!