Hello Sara,
Thank you for your question and for reaching out with your question today.
In your code, it seems that you are passing the variable $vipstatus directly to the Get-NSVIPStatus function. However, you need to pass the value of the variable instead of the variable itself.
To achieve this, you can modify your code as follows:
Get-NSVIPStatus -vipstatus $vipstatus
By using the -vipstatus parameter and passing the value stored in the $vipstatus variable, you can ensure that only the specific output based on that parameter is displayed.
Also, please note that in your function, you are using the $vipstatus parameter in the script block. If you want to filter the results based on the value of the $vipstatus parameter, you need to modify your code accordingly within the foreach loop or wherever you intend to apply the filter.
I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.
If the reply was helpful, please don’t forget to upvote or accept as answer.