20 March 2017

How do I - Remove duplicates from a Powershell array?

When it becomes necessary to remove duplicates from a Powershell array variable, it can quickly be achieved via the -unique switch.  You can even sort at the same time like this:

$array = @("a", "b", "c", "b", "d", "a"); #Setup the array.
$array = $array | sort -unique; #Sort the array while using only unique values.

Enjoy
C

SharePoint Remote Event Receivers are DEAD!!!

 Well, the time has finally come.  It was evident when Microsoft started pushing everyone to WebHooks, but this FAQ and related announcement...