Complete Guide to PowerShell Punctuation
Quick as you can, can you explain what each of these different parentheses-, brace-, and bracket-laden expressions does?
${save-items} ${C:tmp.txt} $($x=1;$y=2;$x;$y) (1,2,3 -join '*') (8 + 4)/2 $hashTable.ContainsKey($x) @(1) @{abc='hello'} {param($color="red"); "color=$color"} $hash['blue'] [Regex]::Escape($x) [int]"5.2" When you’re reading someone else’s PowerShell code, you will come across many of these constructs, and more. And you know how challenging it can be to search for punctuation on the web (symbolhound.com not withstanding) !
That is why I put together a reference chart containing all of PowerShell’s symbology on one page. making it much easier when you need to look up a PowerShell symbol as you read code–or to browse for the right construct when you are writing code.![]()
Download the Complete Guide to PowerShell Punctuation wallchart from here.
Related Articles
Convert VBA Macros To PowerShell for Microsoft Office Automation
There is a lot of documentation out there for interacting with Microsoft Office including Outlook, Excel, Word, etc with Visual Basic for Applications (VBA). A lot of time you may only be able to find VBA examples. VBA’s require template files to be sent to the desktop and are a real hassle when trying to automate across multiple machines. There are not many A to B examples of translating VBA to PowerShell so I took a problem I had solved in the past and presented the before and after.
ICYMI: PowerShell Week of 02-April-2021
Topics include help sections, Approved Verbs, Identity Management and more…
Iron Scripter: Learn PowerShell through code challenges
Hello, friends! Today I want to talk about the Iron Scripter code challenges and the accompanying website. The challenges are excellent for practicing challenging concepts. What’s that you say? Not familiar with Iron Scripter? Let’s get you up to speed. Iron Scripter: A brief history lesson The Iron Scripter website is part of the PowerShell.org family and provides material for the Iron Scripter challenge that takes place at PowerShell Summit each year.