Skip to content

Should exist behaving oddly? #2244

Answered by fflaten
pcgeek86 asked this question in Q&A
Aug 31, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Should -Exists is for testing paths, ex. a filesystem path. See https://pester.dev/docs/assertions/#exist

In your example, you'd probably want to use Should -Not -BeNullOrEmpty, or save the response in a variable and test one or more properties (count, IP, record types etc.) using Should -Be, Should -HaveCount etc.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by pcgeek86
Comment options

You must be logged in to vote
1 reply
@fflaten
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants