Hashtables comparison (one has PSObjects the other doesnt)

Welcome Forums Pester Hashtables comparison (one has PSObjects the other doesnt)

Viewing 1 reply thread
  • Author
    Posts
    • #263241
      Participant
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member

      Hello, I am using Pester with the Assert module. I am using the following code, which fails:

      I know the issue is down to 1 of these arrays or hashtable (not sure which), has PSObjects and the other is a string based array. How do I make it so they are both string based so the comparison works?

      My followup question is how do I know when an array is an array and an hashtable is a hastable? Can you have an hashtable with just keys with no values or does that automatically make it an array?

    • #263298
      Senior Moderator
      Topics: 9
      Replies: 1373
      Points: 5,061
      Helping Hand
      Rank: Community MVP

      Just define the variable like below. You have to expand the property get the string type of each.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.