I want to check CPU utilization , disk usage and RAM capacity in ESXi though powerCLI pwershell cmdlet throgh script.
Have a look at the Get-Stat cmdlet.
I published some blogpost on statistics and PowerCLI, have a look.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i want to check the performance of bare metal machine in which ESXi is running not on VM.
Then you should do the Get-Stat for the ESXi node entities.
A simple example
$esx = Get-VMHost
Get-Stat -Entity $esx
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
HOw to get disk space capacity of VMhost .
That depends on which type of storage you want to see.
Datastores can be monitored with the Get-Stat cmdet (see for example Datastore usage statistics).
For storage used the by the ESXi itself there is afaik no statistical data captured and stored.
You can see the current utilisation through an SSH session to the ESXi and then a du or a df command.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference