Following powershell command returns the state of Secure Boot:
powershell.exe -noprofile -executionpolicy bypass -Command Confirm-SecureBootUEFI
It returns True, False or "Confirm-SecureBootUEFI : Cmdlet not supported on this platform: 0xC0000002" if Secure Boot is not supported.
Following powershell command returns the state of Credential Guard state :
powershell.exe -noprofile -executionpolicy bypass -Command "(Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard).SecurityServicesRunning"
it returns 0 or 1 :
0 : Credential Guard is disabled (not running)
1 : Credential Guard is enabled (running)