Stop connection message coming back for Connect-VIServer

Viewed 3514

I have an IIS machine hosting some PHP that calls a Powershell file. After adding the Powercli snap in in my Powershell file, I makes a connection to vSphere.

When it does it produces some output that I don't want as this gets put on to each php output page.

Name Port User ---- ---- ---- myhostaddress.com 443 mynetwork\reporteruser

I have tried to add variables to the end to stop the feedback

Connect-VIServer -server myhostaddress.com -User $logincred.User -Password $logincred.Password  -WarningAction SilentlyContinue -ErrorAction Continue

but no use.

Is there a way to stop it. Or a clever way to call it so the output is dumped somewhere else please?

2 Answers

before executing, run the following code:

Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $false
Related