Created
August 12, 2022 10:12
-
-
Save jamiechalmerzlp/dc7e184b109957ad32e86af004b43f53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$TPMPRESENT = (Get-Tpm).TpmPresent | |
$TPMENABLED = (Get-Tpm).TpmEnabled | |
$TPMREADY = (Get-Tpm).TpmReady | |
$tpmVersion = Get-WmiObject -Class Win32_Tpm -Namespace root\CIMV2\Security\MicrosoftTpm | Select-Object -Property SpecVersion | |
$tpmVersionOut = $tpmVersion.SpecVersion.Split(",")[0] -as [string] | |
Write-Host "TPM Present: ${TPMPRESENT}, TPM Enabled: ${TPMENABLED}, TPM Ready ${TPMREADY}, TPM Version: ${tpmVersionOut}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$Customfield="Custom14"
function Write-CustomField {
param([string]$Value,[string]$Field)
Set-ItemProperty -Path HKLM:\SOFTWARE\CentraStage -Name $Field -Value $Value
}
$TPMPRESENT = (Get-Tpm).TpmPresent
$TPMENABLED = (Get-Tpm).TpmEnabled
$TPMREADY = (Get-Tpm).TpmReady
$tpmVersion = Get-WmiObject -Class Win32_Tpm -Namespace root\CIMV2\Security\MicrosoftTpm | Select-Object -Property SpecVersion
$tpmVersionOut = $tpmVersion.SpecVersion.Split(",")[0] -as [string]
Write-Host "TPM Present: ${TPMPRESENT}, TPM Enabled: ${TPMENABLED}, TPM Ready ${TPMREADY}, TPM Version: ${tpmVersionOut}"
Write-CustomField -Value "$output" -Field $Customfield