I’m aware that I write for an international audience and I try to use international English in my posts. When I use traditional or colloquial English I usually have a good reason for doing so. Today’s reason is because I like the alliteration that ‘Filter Faffing’ provides. faffing – the act of making…
Month: August 2017
Scripting Tips & Tricks: Dynamic RegEx Queries
Another week of RegEx! I just can’t get enough of it at the moment. A bit like sleep. I said sleep, not sheep! Man, I do like a good sleep. I’m writing this at an airport. It’s way past my bedtime. Anyway… what do I have for you this week? Well, I feel like a…
Scripting Tips & Tricks: RegEx for OU Name & Path
I ‘borrowed’ this RegEx off my esteemed colleague, Mr Raimund Andree, whilst working on site with him. $pattern = ‘(..=)(?<Name>.*?)(?<!\\),(?<Path>.*)’ You can use this pattern to match the ‘Name’ of the OU and its parent ‘Path’ into named groups with those exact same names. $a = “OU=TEST,DC=Halo,DC=net”,”OU=BATCH1,OU=TEST,DC=Halo,DC=net”,”OU=BATCH2,OU=TEST,DC=Halo,DC=net”,”OU=BATCH3,OU=TEST,DC=Halo,DC=net” foreach ($b in $a) {…
Scripting Tips & Tricks: Review Your Comments
I wrote a PowerShell module recently as part of an update to a service we provide to customers. I needed to dump out all of the comments so they could be submitted for review. I wanted to ignore comment based help sections. Here’s how I did it with the aid of RegEx… $a…