SQL Novice
SQL Novice

Reputation: 323

Suppress cmdlet output in Powershell

I am running the below cmdlet which I need to use in a script.

Connect-Pfa2Array -Endpoint 10.10.10.10 -Username pureapiuser -Password $psw -IgnoreCertificateError

I get the below output which I am trying to suppress. I just need for the cmdlet to make the connection. Is there a way this can be done? I checked the cmdlet and did not see an option to do a silent connection.

ArrayName    ApiVersion
---------    ----------
10.100.24.50 2.2 

Upvotes: 3

Views: 1993

Answers (1)

Alex_P
Alex_P

Reputation: 2950

As Santiago Squarzon mentioned, there are a couple of options you can use:

[void](Connect-Pfa2Array ... )

or

Connect-Pfa2Array | Out-Null

or

Connect-Pfa2Array > $null

or

$null = Connect-Pfa2Array

Upvotes: 5

Related Questions