That ONLY works if the certificate exists in Local Computer Personal folder (LocalMachine\My)
If the certificate is placed in Remote Desktop Certificates then it all fails to update the hash!
PS C:\Windows\system32> $thumbprint = (Get-ChildItem Cert:\ -Recurse | Where-Object { $_.FriendlyName -like 'Remote*' }).Thumbprint
PS C:\Windows\system32> Write-Host $thumbprint
6645D423EC2EB8FA1EF235D34DF32E1DC8D6C1F7
PS C:\Windows\system32> $path = (Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").__path
PS C:\Windows\system32> Write-Host $path
\\SERVERNAME\root\cimv2\terminalservices:Win32_TSGeneralSetting.TerminalName="RDP-Tcp"
PS C:\Windows\system32> Set-WmiInstance -Path $path -argument @{SSLCertificateSHA1Hash = "$thumbprint" }
Set-WmiInstance : Invalid parameter
At line:1 char:1
+ Set-WmiInstance -Path $path -argument @{SSLCertificateSHA1Hash = "$th ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Set-WmiInstance], ManagementException
+ FullyQualifiedErrorId : SetWMIManagementException,Microsoft.PowerShell.Commands.SetWmiInstance