• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Clatent

Technology | Fitness | Food

  • About
  • Resources
  • Contact

PowerCLI

One-Liner Wednesday March 8, 2023

March 8, 2023 by ClaytonT Leave a Comment

Are you using VMWare? Ever had to troubleshoot why a VM isn’t working? Or need to know the status of a virtual machine? If you haven’t used PowerCLI before(I know I’ve mentioned it previously), check out this one liner.

 get-vm servername | select-object name, powerstate, usedspacegb, provisionedspacegb

What this does is first finds the server you are looking for with “servername.” Then it shows the server name, whether it is turned on or off, how much storage space is used, and finally how much storage is provisioned. This gives you a very quick overview of the status of the server.

I know, very simple, but it works… and you can expand on this. You could not put a servername in, and it will show all of your virtual machines with the information above.

What about if you have 100s or even 1,000s of servers, you could export to gridview or even better to excel with the importexcel module for filtering.

Hope you found this useful, and if your not already using the PowerCLI module to start using it and make your life easier.

PowerShell Gallery:
PowerCLI

Tagged With: Automation, Documentation, PowerCLI, PowerShell, Reporting, VMWare, Windows Server

Primary Sidebar

Clayton Tyger

Tech enthusiast dad who has lost 100lbs and now sometimes has crazy running/biking ideas. Read More…

Find Me On

  • Email
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

Recent Posts

  • New version of EntraFIDOFinder is out now
  • EntraFIDOFinder now with over 50 new keys!
  • EntraFIDOFinder March Update
  • 02-14-2025 MSOnline and AzureAD PowerShell modules.. One last Valentine’s day card each
  • Custom Maester Tests: Validate Full Addresses Now and Cleaned Up Wording

Categories

  • 365
  • Active Directory
  • AI
  • AzureAD
  • BlueSky
  • Cim
  • Dashboards
  • Documentation
  • Entra
  • Get-WMI
  • Learning
  • Module Monday
  • Nutanix
  • One Liner Wednesday
  • Passwords
  • PDF
  • PowerShell
  • Read-Only Friday
  • Reporting
  • Security
  • Windows
  • WSUS

© 2025 Clatent