The following function will query one or more vSphere servers for overall status, configuration status as well as any configuration issues. It can also filter on Name, if you just want to get a quick status of one or more named resources.
It returns an object for ease of further processing, such as piping out to CSV etc.