mocking Get-Date

Welcome Forums Pester mocking Get-Date

Viewing 2 reply threads
  • Author
    Posts
    • #193198
      Participant
      Topics: 1
      Replies: 1
      Points: -5
      Rank: Member

      Hi,

      I how can I mock Get-Date? below code does not work but if I change the mock commandname to Get-Test it works.

      Should the below code work?

      Thanks.

    • #196298
      Senior Moderator
      Topics: 9
      Replies: 1370
      Points: 5,048
      Helping Hand
      Rank: Community MVP

      Can you change the $Date variable to some other name and try ?

    • #196562
      Participant
      Topics: 1
      Replies: 1
      Points: -5
      Rank: Member

      Thank you.  works now.  Not sure why it didn’t like $Date variable name.

Viewing 2 reply threads
  • The topic ‘mocking Get-Date’ is closed to new replies.