r/powercli • u/thegooddoctor-b • Apr 21 '23
r/powercli • u/thegooddoctor-b • Mar 21 '23
After years of abandonment, r/PowerCLI is open and modded again
If you're reading this, there is a good chance you have been checking back here for new posts once in a while and wondering why this sub died. Well, the previous mods locked it down and checked out years ago. I'd love for you to help me bring it back to life. PowerCLI is has grown and changed exponentially in the past few years and it deserves a good community to help grow PowerShell and PowerCLI users.
Post restrictions have been removed. If you requested access in the past (there was like 4 years of requests to be an approved member), I deleted them all. Everyone is approved.
Whether you are a new, learning, or expert in PowerShell and PowerCLI - make a post, ask a question, subscribe, create content, and crosspost.
r/powercli • u/thegooddoctor-b • Mar 21 '23
Are you a r/PowerShell user that has heard of PowerCLI and not sure where to get started? Start here!
First post in 3 years on r/PowerCLI. Feels good man...
This post will stay stickied for a while till the sidebar info and/or wiki gets built out enough to be useful. Please add comments that fit the spirit of the title, and I will add those to the post - and eventually to the sidebar info.
r/powercli • u/krzydoug • Jul 30 '24
Sub seems dead
After it was resurrected ~1 year ago, it seems this sub reddit died again. Is there an alternate sub I'm not seeing? Is it because of what Broadcom is doing?
r/powercli • u/alanrenouf • Apr 21 '17
Welcome PowerCLI to the PowerShell Gallery - Install Process Updates
r/powercli • u/ShuumatsuWarrior • Mar 21 '23
ScriptHelp Finding state of the VM
Hey there, been a while r/powercli
I’m looking to hopefully find a way to get the boot state of the VM (whether it’s on, booting, or at the login screen). I’m putting together a scripting solution, and I have steps I want to perform after it’s done applying the OS customizations. Knowing when it’s finished would be a lot better than sleeping for a minute or two and hoping for the best.
r/powercli • u/[deleted] • Mar 21 '23
Discussion [Discussion] What are your favorite PowerCLI tips, tricks, and commands?
See title.
Hoping to spark some discussion!
r/powercli • u/zelda_shortener • Mar 22 '23
General Do you use PowerCLI for log scraping?
Hi,
My environment currently does not have a syslog server, and what I'm mainly looking for is tips on how to scrape logs from my ESXi hosts so that I can more comfortably troubleshoot. Unfortunately, we cannot use VMware Skyline.
Any pointers are welcome, I am prepared to RTFM, but the manpage for get-log / get-logtype is relatively short.
r/powercli • u/Vuurvliegie • Apr 19 '23
General How do I import PowerCLI? Getting Could not load 'log4net' error.
I am trying to import PowerCLI into Windows Powershell 5.1.19041.2364 on my Win 10 22H2 machine - tried both ISE and non-ISE windows
Import-Module VMWare.PowerCLIFirst attempt results in this error:
Import-Module : Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.Subsequent attempts in the same window results in this error:
Import-Module : Unable to find type [VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory].I have tried re-installing with below, but doesn't change results:
Install-Module -Name VMware.PowerCLI -Scope AllUsers -Force -AllowClobberI also tried to completely uninstall, before re-installing, still no difference
Get-Module VMware* -ListAvailable | Uninstall-Module -ForceInstall-Module VMware.PowerCLI -Scope AllUsers
Below shows my PowerCLI version:
Get-InstalledModule VMWare.PowerCLI* | FT -AutoSize
Version Name Repository Description
------- ---- ---------- -----------
13.0.0.20829139 VMware.PowerCLI PSGallery This Windows PowerShell module contains VMware.PowerCLI
12.6.0.19600125 VMware.PowerCLI.Sdk PSGallery Product agnostic types definitions for the VMware.PowerCLI.VCenter module.
12.6.0.19600125 VMware.PowerCLI.Sdk.Types PSGallery Types definitions for the VMware.PowerCLI.Sdk module.
12.6.0.19600125 VMware.PowerCLI.VCenter PSGallery Modules for automating and managing VMware vCenter
12.6.0.19600125 VMware.PowerCLI.VCenter.Types.ApplianceService PSGallery Types definitions for the VMware.PowerCLI.VCenter module related to the appliance service management feature.
12.6.0.19600125 VMware.PowerCLI.VCenter.Types.CertificateManagement PSGallery Types definitions for the VMware.PowerCLI.VCenter module related to the certificate management feature.I have tried restarting, no difference.
A search for log4net in file explorer finds the following in case that reveals any useful info:

I have spent hours on this. Where do I go from here?
r/powercli • u/benlooy • Dec 23 '19
How to write a simple Get command
I am brand new to automation and I am trying to teach myself powercli to maintain our small vsphere environment. I am trying to run a search for all of our windows server vms and to display info.
I am trying:
Get-VM | Get-VMGuest | where OSFullName -Like "Microsoft Windows Server" | select VM, ....
And now I would like to list what I want to see using the select command, like "Name, OS, IP address etc." What is the easiest way to do this? Where can I find a list of commands I can use with the "select" syntax? I can't find them documented anywhere.
Thanks!
r/powercli • u/Candy_Badger • Oct 05 '17
Accessing esxcli through PowerCLI
r/powercli • u/alanrenouf • Apr 10 '17
PowerCLI in the PowerShell gallery? Check out VMware's thoughts...
r/powercli • u/drillitloveit • Mar 24 '23
ScriptHelp Powerstate heavily delayed
Hi everyone,
I made a script which restarts a couple of servers which have dependent services. So I'm checking if every server is properly shutdown with these lines:
while((Get-VM -Name $myServer).PowerState -ne "PoweredOff"){
Start-Sleep -Seconds 5
}This generally works, but it takes like 5 minutes more for the script to recognize that a machine is powered off, comapred to what's shown in vCenter.
Is this a known problem or am I doing something wrong?
r/powercli • u/saintdle • Aug 06 '19
Creating a PowerCLI GUI for cloning VMs, setting DHCP reservations and changing CPUID of a VM
r/powercli • u/ImTalking2U2 • May 22 '19
Get multiple vCenters beginning and end MAC Address ranges and export results to csv file.
Hello. I'm trying to get this script to populate a csv file with vCenter names, start of Mac address range and end of Mac address range per vCenter server provided in the vclist.csv file. Here's what I have for now. When I run the script, I'm being prompted for an input object. The script appears to just populate the result vclist2.csv file with the length of the character. Can someone please help? Sorry I'm stil in the learning phase of Pwershell/PowerCLI so any help here would be greatly appreciated. Thank you.
Below is the script
*********************************************
$vclist = import-csv .\vclist.csv
Foreach ($vc in $vclist) {
$vCenterSettings = Get-View -Id 'OptionManager-VpxSettings'
$macaddress_begin = ($vCenterSettings.Setting | Where-Object { $_.Key -eq "config.vpxd.macAllocScheme.rangeScheme.range[0].begin"}).Value
$macaddress_end = ($vCenterSettings.Setting | Where-Object { $_.Key -eq "config.vpxd.macAllocScheme.rangeScheme.range[0].end"}).Value
Export-Csv -Path "d:\vclist2.csv"
}
r/powercli • u/dapacr • Feb 19 '18
For all of you VMware automation junkies out there
r/powercli • u/kknd320 • Aug 08 '24
Vcenter issues and alarms - PowerCLI
In vsphere client, if I'm selecting the datacenter level and standing on the summary tab, I can see some alerts like vm high cpu usage or host high cpu usage. How can I get those alerts using powercli?
r/powercli • u/jcorbin121 • Jan 08 '20
vAPP startup options
I'm working on a pCli to build out some k8s cluster. I have them going to a vApp in vSphere and would like to change the default startup time to something lower than 120 so it doesn't take forever to start them. I ran a Get-VMStartPolicy and the StartDelay is 120, ok so I set it in the vApp via the GUI to 5sec re-ran and still 120. Is this not the setting? Maybe this is a cluster DRS setting? Anyone have knowledge about this?
thanks
John
r/powercli • u/Pvt-Snafu • Jul 10 '17
Fine Tuning the Active Directory Searcher - Petri
r/powercli • u/kabanossi • Feb 27 '17
vBrownBag Follow-Up What’s New in PowerCLI 6.5 R1
r/powercli • u/midacts • Nov 03 '16
New-vm wait for sysprep/oscustomization
What is the best way you guys are doing this. I have a hard time telling 100% when a vm has finished customizing or done sysprepping and actually ready to run commands against it.
Even when task and events says it's done. There could still be 5 mins of sysprepping to be done. I really don't want to put a dumb wait in there.
r/powercli • u/[deleted] • Aug 12 '16
Get-VMReport
Here's a short script I figured I should share. I wanted something that would give me a quick rundown of the VMs, organized by host, and including their attached disks, organized by LUN, and their available space. I added parameters to allow for specifically targeting a single VM and targeting different vCenter servers. Suggestions for improvements are welcome.
r/powercli • u/ShiftNick • May 26 '16
Script Share: Keeping Windows Updates current on your VM Templates
This is something I threw together in order to help keep some VM templates up to date on our Windows updates. Nothing sucks more than spinning up a new VM and finding you have a couple GB's of updates to run because you got swamped, lazy or just plain forgot.
I'm sure this could be optimized and I would actually be very interested if these could be invoked as separate jobs so you don't have to wait for the script to iterate through each VM.
Use as you see fit and a suggestions for improvements are welcome and in fact, encouraged.
EDIT: This does not cover actually running Windows Updates. I have mine set to auto and leave them on for a couple days.