Hashtables comparison (one has PSObjects the other doesnt)

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

Viewing 3 reply threads
  • Author
    Posts
    • #263241
      Participant
      Topics: 2
      Replies: 3
      Points: 31
      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: 1450
      Points: 5,434
      Helping Hand
      Rank: Community MVP

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

    • #272344
      Participant
      Topics: 2
      Replies: 3
      Points: 31
      Rank: Member

      I forgot to also reply to this thread. This has been also solved. Thnx again 🙂

    • #272545
      Senior Moderator
      Topics: 9
      Replies: 1450
      Points: 5,434
      Helping Hand
      Rank: Community MVP

      Thanks for letting us know.

Viewing 3 reply threads
  • The topic ‘Hashtables comparison (one has PSObjects the other doesnt)’ is closed to new replies.