Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress cmdlet output in Powershell

Tags:

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 
like image 883
SQL Novice Avatar asked Oct 18 '25 23:10

SQL Novice


1 Answers

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
like image 198
Alex_P Avatar answered Oct 22 '25 04:10

Alex_P