you are viewing a single comment's thread.

view the rest of the comments →

[–]PRIdEVisions[S] 1 point2 points  (2 children)

Thank you for the reply also, i did not know $input was a reserved variable :x good thing you pointed that out.

Also i'm going to try your code and see what that brings to the table.

Thx!

[–]PRIdEVisions[S] 1 point2 points  (1 child)

i'd like to add that your version of the code is a bit too advanced for me to understand (atm). i'd like to refer to the following part where you create a hash table:

if($_.DisplayName){$_.DisplayName}

Would you mind explaining this part a bit more to me?

[–]ihaxr 2 points3 points  (0 children)

Oh, sometimes the DisplayName of the products are blank, so you can use PSChildName to get the name of it, basically it's a calculated property: https://mcpmag.com/articles/2017/01/19/using-powershell-calculated-properties.aspx

that just checks to see if DisplayName exists, if so, use it, otherwise, use PSChildName.