SCCM - Querying Device compliance via powershell

Any SCCM experts out there, can help on what I am doing wrong. I am trying (via PowerShell) to get a list of devices that are not compliant. We have a PowerShell script setup which performs the compliance check on the clients. And within the GUI, I can see the list of compliant and non compliant client device names.

I am struggling to get a list of these devices though via powershell. I can see the total number non-compliant, but see no way to export the list of the devices names themselves.

So this works to get the count of devices compliant for example, but how do I get a list of the device names themselves? Am Totally Stumped..

Thread closed.

Same question with same wording posted in many forums.