PowerShell Pre-and-Post-Increment-and-Decrement


Many people have told me that they find PowerShell’s syntax to be confusing. Reading other people’s scripts can be daunting, whether those scripts were download from someone’s blog, written by one of your colleagues or predecessors, or even something written by your past self.

That head-spinning, queasy, brain-full-like-a-sponge-ready-to-be-squeezed nausea and vertigo can be further compounded, and your efforts potentially confounded, by syntactic descriptions in Backus-Naur Form (BNF) notation examples such as those shown in Get-Command and Get-Help and on various supposedly helpful web sites. But most of all, many people find PowerShell syntax confusing because PowerShell is a technology with a long, twisted, and tangled ancestry. From shells and script processors such as sh, awk, perl, and more, and programming languages such as B, C, C++, Java, and C#, the influences on PowerShell are diverse, and carry with them many decades of legacy. With many RT11, CP/M, DOS, Windows Command Prompt (cmd.exe), and even DEC DCL concepts and syntax interwoven with UNIX shell and command environments, and some newer Microsoft .NET influences comingled together, there are often many ways to do or express the same task.