I am trying to create a script which allows me to output the results of the cmdlet "get-vm | get-snapshot | format-list" to a file
I am using a piece of software which allows us to remotely execute scripts either via the Command Prompt or PowerShell
How could I create a single line command which would run the command Connect-VIServer vCenterServerName & then theget-vm | get-snapshot | format-list??
I am adding variables via our software for the username/password & vmware server IP. These variables have to be part of the command, for example:
Connect-VIServer -Server @VMwareHostIP@ -Protocol https -User @Username@ -Password @Password@
Is there a way I could call the PowerCLI from the Windows command prompt?