Seriously, this is not a free "write a script for me" community, but a place where community members try to provide answers to questions or specific issues other users might encounter.

At least you could provide some more details on what you are trying to achieve.And even better, come with a concrete question, showing what you already have and where you got stuck.Did you even do a search in this community before posting this?

I was definitely not trying to make fun of you, just of the type of question.We sometimes get some very 'general' questions in here, not specifying any details, which are in fact nothing more than a "do my work for me" kind of request.

Now with your last reply, you asked a practical question.That is something we can try to help you with.

Some things to check/answer:

how did you run the script? From a PS prompt? From a .ps1 file?

are you connected to a vCenter before running the script? Or an ESXi node?

the attached file contains some funny characters, but that might be due to a regional setting on your station. In any case, I start from the edited version below.

do you keep statistical data for at least 30 days in your vCenter? On an ESXi node you don't have historical statistical data.

in the Web Client, under the Performance tab, do you see data for the VMs when you select a 30 day period?