if
(
exists wmi "root\CIMV2\Security\MicrosoftTpm" and exists selects "* from Win32_Tpm" of wmi "root\CIMV2\Security\MicrosoftTpm"
)
then
(
if
(
boolean value of select "IsEnabled_InitialValue from Win32_Tpm" of wmi "root\CIMV2\Security\MicrosoftTpm" = true
)
then "Enabled" ELSE "Disabled"
)
else ERROR "TPM not visible to OS"
if (exists wmi "root\CIMV2\Security\MicrosoftTpm" and exists selects "* from Win32_Tpm" of wmi "root\CIMV2\Security\MicrosoftTpm") then (if (boolean value of select "IsEnabled_InitialValue from Win32_Tpm" of wmi "root\CIMV2\Security\MicrosoftTpm" = true) then "Enabled" ELSE "Disabled") else ERROR "TPM not visible to OS"