Questions tagged [powercli]

VMware vSphere PowerCLI is a set of Windows PowerShell snap-ins that provide cmdlets to automate vSphere and vCloud virtual environments.

VMware vSphere PowerCLI contains snap-ins of cmdlets based on Microsoft PowerShell for automating vSphere and vCloud administration. It provides C# and PowerShell interfaces to VMware vSphere and vCloud APIs.

(VMware vSphere PowerCLI Cmdlets Reference)

PowerCLI provides hundreds of cmdlets "for managing, monitoring, automating, and handling lifecycle operations for vSphere and vCloud Director components" (VMware vSphere PowerCLI User's Guide).

References:

540 questions
4
votes
2 answers

So what is special about Powershell PSC1 files?

On my PowerShell shortcut I have the following: C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -psc "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -noe -c ". \"C:\Program Files (x86)\VMware\Infrastructure\vSphere…
Steven T. Cramer
  • 1,508
  • 1
  • 18
  • 34
4
votes
1 answer

C# code to access VMware vSphere PowerCLI

Are there examples of C# code accessing vSphere API through PowerCLI or otherwise? For test automation, is PowerCLI script or C# code calling vSphere API the better choice? Please advise on docs and examples
Jai
  • 319
  • 2
  • 9
  • 30
4
votes
3 answers

How can I find the 'sub properties' of an object in powershell?

I guess I just don't know the proper name of whatever I'm looking for, but this was probably asked a thousand times before. I started PowerShell not long ago, and I'm struggling to understand where I can find the 'sub properties'(if you can call it…
3
votes
2 answers

Powershell to shut down a VM

I have a small Powershell script that is used to shut down my virtual machines in event of an extended power outage. It takes a specific VM object and forces a shutdown. Function DirtyShutdown {…
Tim Brigham
  • 574
  • 1
  • 6
  • 24
3
votes
1 answer

Booting from an ISO image using PowerCLI scripts

How do I make the following script work? Currently I am able to create a new virtual machine in my server. I wish to also load the Windows ISO image and do an unattended installation in the virtual machine. How shall I edit the script to make this…
3
votes
1 answer

PowerCLI strange behaviour of variable

Trying to collect few properties of VMs, but for some reasons all entries in the output contains the info about the last VM only The $CSV basically contains a couple of VM names: VMName Centos1 Centos2 Here is the code I'm using: $VMdata =…
3
votes
3 answers

Stop connection message coming back for Connect-VIServer

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…
user3520245
  • 1,016
  • 1
  • 8
  • 18
3
votes
1 answer

Where-Object : Cannot bind parameter 'FilterScript'

I have one problem with two questions. I have following powercli cmd: $snapLst = Get-VM vmindev |Get-Snapshot |Select VM, Name, Description, ` @{Name='Created'; Expression={{$_.Created.ToString("yyMMdd")}}, ` @{Name='SizeMB'; Expression={[int]…
ky bof
  • 89
  • 1
  • 5
3
votes
1 answer

PowerCLI to walk through clusters and hosts

Here is what I am trying to do: I have a vSphere setup with multiple clusters, underneath those clusters there are a few hosts. I am trying to write a script that walks through the clusters and inside each cluster, puts the host into maintenance…
Nov2009
  • 313
  • 2
  • 5
  • 12
3
votes
2 answers

Object to hashtable key comparison

I'm looking for some help troubleshooting comparing .key values to objects. Basically what's happening here is I'm connecting to two VMware vCenters and downloading a list of roles and putting those roles into two hash tables, then comparing…
kxf951
  • 155
  • 1
  • 2
  • 11
3
votes
1 answer

Issue Building PowerCLI Mass OVF Export Tool

Background I am creating a script, using PowerCLI, to perform mass OVF exports using VMware's ovftool. The script works by performing the following functions: Through PowerCLI arguments, take in the vCenter address, naming scheme of the VMs to…
Chris Willis
  • 65
  • 10
3
votes
1 answer

Is it possible to remotely run scripts in a guest OS using VCLI?

Using VMware OVF Tool 4.0, I'm deploying/powering on some VMs and would like to execute some scripts inside them. However, I was unable to assign injection properties to a VM, I.e: DNS, Gateway, etc. See OVF Tool documentation page 22 for more…
Gabriel Y.
  • 85
  • 6
3
votes
1 answer

powershell/powershell when ran via jmeter/BSF sampler/beanshell hangs

I am hoping someone has ran into this problem and may give me some tips on what to try next. I am trying to run some powercli scripts (ran in powershell) in jmeter. I am using the BSF sampler in jmeter using beanshell I am using this…
3
votes
2 answers

Running VMWare powerCLI commands with SoapUI

I have a powershell script file with PowerCLI commands like Connect-VIServer etc. I am able to run the script file in PowerGUI after I added the library references to VMWare PowerCLI but I don't know how to run it through SoapUI. I'm guessing it…
dhishkaow
  • 81
  • 1
  • 2
  • 8
2
votes
1 answer

Invoke VmWare PowerCLI from C#

Is there a way to execute the PowerCLI cmdlets from within C#? Basically we have a workflow written using Windows Workflow. At certain stages in the execution of this workflow we need to interact with certain virtual machines and turn them on/off or…
Nikhil
  • 3,304
  • 1
  • 25
  • 42
1
2
3
35 36