Questions tagged [powercli]

VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell

VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell, and provides more than 600 cmdlets for managing and automating vSphere, vCloud, vRealize Operations Manager, vSAN, NSX-T, VMware Cloud on AWS, and VMware Horizon environments.

Resource for Downloads and Documentation and Reference

83 questions
1
vote
0 answers

get FULL hardware configuration of a VM from powercli

I want to export the complete hardware configuration of a vm to the console via PowerCLI. Get-VM seems to only have limited information based on a Get-VM xxx | Get-Member check. In vCenter, if you right click on a vm and select "Edit Settings" you…
1
vote
1 answer

VMware Power CLI: how to get custom attributes for a datastore

I am trying to get a custom attribute value for my datastore, but bumping into an issue with type incompatibility. Is there anything I am doing wrong below, and how to fix it? PowerCLI C:\> $ds = Get-Datastore -Name YK PowerCLI C:\> $ds Name …
1
vote
1 answer

VM restarted by HA after powered off from PowerCLI

I am using PowerCLI to "PowerOff" VMs when there is a certain event detected. When this even happens, the only thing we can do is to power off the VM and power it on again. I use Stop-VM -VM xxxx -Kill -Confirm:$false to power off the VM but I…
Root Loop
  • 902
  • 4
  • 24
  • 45
1
vote
0 answers

How to run cmd from PowerCLI Invoke-VMScript starting with an open console

I'm trying to run a exe file in a remote machine from PowerCLI which is launching couple of cmd's. With this command: $executeCommand = "call D:\MyFile.exe Arg1 Arg2"; Invoke-VMScript -VM $vmName -GuestUser $vmUser -GuestPassword $vmPass -ScriptText…
1
vote
0 answers

New-VM cmdlet stalls when create a new VM (works fine in vCenter)

Not sure were the issue is here. I can interactively create a VM in vCenter with exactly the same settings and it creates the VM like instantly. I just tried to do this with New-VM and it stalled at 39% and its been sitting there for like 10…
red888
  • 4,183
  • 18
  • 64
  • 111
1
vote
1 answer

How can I get the VMware view agent version of VMs with powercli?

How can I get the VMware View Agent version running on a VM with powercli or View Powercli?
red888
  • 4,183
  • 18
  • 64
  • 111
1
vote
1 answer

powercli math with vmware - datastore property division arithmetic

basically, I get all 0's returned in the percentage1 column. I need help with what I believe is syntax or incorrect use of Round. Get-Cluster "my_cluster" | Get-VMHost | Get-Datastore | Select…
2legit2quit
  • 171
  • 1
  • 2
  • 10
1
vote
0 answers

PowerCLI - Network nested ESXi

Is there a way to configure the management interface of a nested ESXi Guest over PowerCLI? I'm looking to automate the configuration of a nested ESXi VM for testing customer configurations / clusters. I see that the Get-EsxCli command seems to do…
StackUser_py
  • 283
  • 2
  • 4
  • 14
1
vote
1 answer

unable to get the IP,Mac, and other network info using (Get-VMHost).NetworkInfo

I am using powerCLI verion 5.5, and I wrote the following script:- Get-VMHost |Export-Csv -Path c:\test.csv -NoTypeInformation –UseCulture I got info for the vmhost such as used memory, build, state ,cpu spped, etc. but for the networkinfo section…
John John
  • 379
  • 1
  • 4
  • 12
1
vote
1 answer

Get-VMHost does not show the server Networkinfo and number of processes

I run the following powercli 5.5 command , to get info about a host vm :- Get-VMHost |Export-Csv -Path c:\VM.csv -NoTypeInformation –UseCulture and I got these info :- State ConnectionState PowerState VMSwapfileDatastoreId VMSwapfilePolicy …
John John
  • 379
  • 1
  • 4
  • 12
1
vote
0 answers

Vm counts by folders

I have created a script which collected the VM counts for the selective folders in each Vcenter, This scripts seems working fine but it's not collecting output to the CSV. $output = @() Get-Content -Path C:\capacity_donot_delete\folder.txt | %{ …
suboss87
  • 109
  • 1
  • 2
1
vote
1 answer

Trouble with embedding html email with PowerCLI/Powershell for gmail

I am new to Powershell, I am a junior admin for a VMware environment. I am trying to automate a weekly report for snapshots in PowerCli. I am making the script in Powershell. I have made a simple css, and I had the e-mail send successfully out with…
2legit2quit
  • 171
  • 1
  • 2
  • 10
1
vote
2 answers

Gathering buslogic SCSI hardware and virtual machine operating system

I'm trying to use Powershell to get SCSI hardware from several virtual servers and get the operating system of each specific server. I've managed to get the specific SCSI hardware that I want to find with my code, however I'm unable to figure out…
Valrok
  • 330
  • 3
  • 11
1
vote
1 answer

How do I create an IP Pool using PowerCLI?

Datacenter objects have a tab "IP Pools" to create IP pools for vApps (as I understand it). How can IP pools be created or modified using PowerCLI?
Andrew J. Brehm
  • 1,611
  • 7
  • 37
  • 57
1
vote
2 answers

PowerCLI: How can I find an ESXi host's system memory?

A view of a VM host gives me the field .Config.ConsoleReservation, but ESXi doesn't have the console any more. The vSphere GUI shows total memory and system memory for ESXi hosts. How can I get an ESXI host's system (vmkernel) memory?
Andrew J. Brehm
  • 1,611
  • 7
  • 37
  • 57