Hi everyone!!
I am new to powershell.
I am performing following steps :->
1. Telent to windows machine where powercli is installed.
2. Execute following command
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -Command Connect-VIServer -Server "server address" -User "username" -Password "password"
This works fine. It comes out perfectly.
But i need to execute some commands, for example let's say get-vm.
For that, i need to connect to server first.
For this, i try to do :
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -Command Connect-VIServer -Server "server address" -User "username" -Password "password" | get-vm
But this doesn't work.
And remember, telnet to windows machine is must
Pls help.