Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Running PowerCLI Connect VIServer & Get-VM as a single command

$
0
0

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?


Viewing all articles
Browse latest Browse all 219257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>