You don’t need semicolons in multi-line hashtable literals.

This is not a world-changing topic, but I thought it was worth sharing.

If you have written hashtable literals on a single line, you’ve seen this before:

[email protected]{Name='Mike';Blog='powershellstation.com'}

Sometimes, it makes more sense to write the hashtable over several lines, especially if it has several items. I’ve always written them like this:

[email protected]{Name='Mike';
        Blog='powershellstation.com';
        Language='PowerShell'
}

I was watching Don Jones’ toolmaking sessions on youtube and what he did was slightly different.

[email protected]{Name='Mike'
        Blog='powershellstation.com'
        Language='PowerShell'
}

I watched and waited for him to get errors, but he’s Don, so he got it right.

I’m not sure how I missed this, but you don’t need semicolons in multi-line hashtable literals.

–Mike