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