Tags » Powershell-basics

PowerShell Objects Part 1: No More Parsing!

One of the first things to know about PowerShell in order to wield it effectively is its object-based paradigm. If you are trying to parse strings in PowerShell scripts, it’s likely that there is a better way. 720 more words

PowerShell

and finally

If you’re old enough and seen UK TV you’ll recognise the title but this post is about using try – catch blocks.

Using try-catch this is a fairly normal construction… 433 more words

Powershell Basics

Bad practices – making scripts needlessly interactive

the PowerShell community spends a lot of time talking about best practices when using PowerShell. I’m not convinced this approach is working as we keep seeing the same bad practices coming through on forum questions. 568 more words

Powershell Basics

Function parameter validation - other validation options

Some other options you can use for validating your input include:

tests the number of values being passed to the parameter – must be within the range (including end points ) specified… 109 more words

Powershell Basics

Function parameter validation–ValidateScript

Sometimes you need a little bit more than the standard parameter validation options can provide – in that case use ValidateScript – you can write your own validation routine. 442 more words

Powershell Basics

Function parameter validation–NotNullorEmpty

A question on the forum made me realise that there is still a lot of confusion around the advanced function parameter validation options so I thought I’d spend a few posts clearing some of the confusion. 378 more words

Powershell Basics