Powershell Functions do not return single element arrays

I came across an interesting problem today that a function I wrote to return all SCCM primary sites worked at work but did not work at home. the difference between 2 SCCM environments is that I only have 1 single SCCM site in my home environment comparing to large multi-tier SCCM infrastructure at work. after some investigation I found out this common issue with Powershell when comes to returning arrays from a function. For example: The first function foo should returns a single element arraylist, and the variable it returned has the same type as the type of the only

Continue reading
%d bloggers like this: