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
1
vote
0 answers

Is there a way to upload a .ovf to the vSphere content library with powercli?

I am writing a script in powershell/powercli that lets you upload files to the vShpere content library from a chosen folder/file location. The script works fine with .iso, .mf, .vmdk, .nvram, but when it gets to a .ovf file it throws this…
wvk0138
  • 11
  • 2
1
vote
0 answers

Need assistance modifying a PowerCLI script

I was wondering if someone could please help with the following query. We are using the following script to enable Virtualization Based Security on a per VM…
messi
  • 11
  • 1
1
vote
0 answers

Powershell Execute exe on VM remotely

I've searched and tried different variations of commands, but none seems to work for me. I believe I have also gone through all the SO references on this. Tried all the ways here:…
Raj
  • 199
  • 1
  • 12
1
vote
2 answers

Delete VMDK file with powershell/powercli command?

I'm a little bit stuck because I would like to delete some VMDK file from vSphere with a PowerShell or PowerCLI command. I know how to do that from the vSphere vCenter GUI but I didn't find how to do that with a command. Do you think that there is a…
TomTom30
  • 35
  • 5
1
vote
1 answer

Offline PowerShell module installation failure (PowerCLI)

I've seen numerous posts on the subject but none that offered a solution to my specific case so trying here. I am trying to install VMWare's PowerCLI module into PowerShell on an offline Windows 10 box (21H1). I already obtained the unpacked…
mmysliwiec
  • 21
  • 4
1
vote
1 answer

How to pass the body using powershell routes.jason

I'm trying to expose an endpoint using RestPS routes in powershell. I was able to expose it and run a custom PS script when an endpoint (http://localhost:8080/scan) is hit. How do we pass body through routes & based on that value I need to execute…
1
vote
1 answer

How to retrieve more than 1 annotation to CSV

I'm trying to create a report using Get-annotations to retrieve some custom values and actually it works fine, but I only can insert 1 value on report on same line, here below is what I do for 1 value only, is there some syntax to use not like this…
1
vote
1 answer

Run Bash command in script PS with Powercli

i try to run this script in powercli V.11 but i have always des mistakes. $vm= "server" $adminGuest="root" $adminGuestPwd="pass" $command = " df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }'" Invoke-VMScript -vm $vm…
oussama_tr
  • 61
  • 7
1
vote
0 answers

list empty port groups in vcenter powercli scripts

Get Unused PortGroups in a Cluster or island get a list of the vPorts used by the Vms and another list from the vPorts of the Cluster. Then i do something just like a procv in Excel and compare both lists, keeping the difference in another list, the…
bince
  • 11
  • 1
1
vote
1 answer

How do I get events associated with Datastores and Datastore Clusters using PowerCLI?

This is a followup to this question I posted but running into an issue with enumerating events on some objects now. When I run the following code (or try any of the solutions in my prior question) to get the events from a datastore or datastore…
codewario
  • 19,553
  • 20
  • 90
  • 159
1
vote
3 answers

How do I get the tasks associated with vCenter objects using PowerCLI?

We are using vSphere 6.7 in our environment. I am writing a script to look for certain tasks associated with specific target resources in our vCenter environment. However, Get-Task only returns recent tasks that show up in the Recent Tasks view in…
codewario
  • 19,553
  • 20
  • 90
  • 159
1
vote
2 answers

PowerShell - Is there a way to create a sort of 'alias' that contains multiple parameter of a validateset?

Good afternoon, I recently created a PowerShell script to automate and test PowerCLI scripts before running them on vCenters/ESXi hosts. At the moment, I use a validate set to let the user chose on which server/cluster they want to execute their…
Dh3va
  • 41
  • 4
1
vote
1 answer

Deploying a new VMware server from a template to a cluster with a different storage policy

This is my first time asking a question on here, so please be gentle... I have an automated process that deploys VMs in VMware from a template (using powercli) and it cannot deploy if the storage policy of the template is not supported by the…
1
vote
1 answer

How can you accept the vcsa EULA via vapp property?

Does anyone know of a way to accept the EULA when deploying a vcenter server appliance via ova using a vapp property? I'm trying to deploy a vcsa 6.7 instance via terraform using the vsphere_virtual_machine resource with the ovf_deploy property to…
1
vote
1 answer

Displaying Column Headers Once in Output Report

I'm writing a script to audit the disk partition types in my company's virtual environment using PowerCLI. I've got this code so far: $report = @() $VMs = (Get-VM).where{$_.PowerState -eq 'PoweredOn' -and $_.Guest.OSFullName -match…
Daniel
  • 476
  • 6
  • 21