Drawing battleships with PowerShell block and multi line comment literals

by Klaus Graefensteiner 1. December 2010 22:20

The literals used for PowerShell block and multi-line comments are difficult to remember. Googling for multi-line comment doesn’t return the right results and only after I remembered to search for block comments was I successful.

Now its time to take care of it once and for ever by making the literals searchable (this blog post) and unforgettable using the battleship mnemonic device.

 image

Figure 1: PowerShell multi line comments are firing

The following code snippet shows multi-line aka block comments in action.

<# Battle Ship #>

<#
This
is
a
block / multi-line
comment
#>


# One line comment

<# Battle Ship #>

That's it. No more guessing!

Tags: , , , ,

PowerShell | Tips & Tricks | How To

About Klaus Graefensteiner

I like the programming of machines.

Add to Google Reader or Homepage

LinkedIn FacebookTwitter View Klaus Graefensteiner's profile on Technorati
Klaus Graefensteiner

Klaus Graefensteiner
works as Developer In Test and is founder of the PowerShell Unit Testing Framework PSUnit. More...

Open Source Projects

PSUnit is a Unit Testing framwork for PowerShell. It is designed for simplicity and hosted by Codeplex.
BlogShell is The tool for lazy developers who like to automate the composition of blog content during the writing of a blog post. It is hosted by CodePlex.

Administration

About

Powered by:
BlogEngine.Net
Version: 1.6.1.0

License:
Creative Commons License

Copyright:
© Copyright 2014, Klaus Graefensteiner.

Disclaimer:
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design:
This blog theme was designed and is copyrighted 2014 by Klaus Graefensteiner

Rendertime:
Page rendered at 4/18/2014 4:48:47 PM (PST Pacific Standard Time UTC DST -7)