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 "IsActivated_InitialValue from Win32_Tpm" of wmi "root\CIMV2\Security\MicrosoftTpm" = true
)
then "Activated" ELSE "Not Activated"
)
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 "IsActivated_InitialValue from Win32_Tpm" of wmi "root\CIMV2\Security\MicrosoftTpm" = true) then "Activated" ELSE "Not Activated") else ERROR "TPM not visible to OS"