I'm having trouble running TpmVscMgr.exe from a PowerShell script that runs in 64-bit mode on Windows 10. I gather that TpmVscMgr.exe is a 32-bit utility, as witnessed by the fact that it resides in C:\Windows\System32. Trying to run it straight-up from my script leads to an exception saying that the cmdlet cannot be found. I have also tried this method just to destroy a TPM slot for starters:
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show('Test')
try
{
$32bitPSCode =
{
$tpmVscMgrFullyQualified = (Join-Path ([System.Environment]::SystemDirectory) "TpmVscMgr.exe")
$cmdLine = "$tpmVscMgrFullyQualified destroy /instance ROOT\SMARTCARDREADER\0000"
Invoke-Expression $cmdLine
}
Invoke-Command -ScriptBlock $32bitPSCode -ConfigurationName microsoft.powershell32 -ComputerName .
}
catch
{
[System.Windows.MessageBox]::Show($_)
}
This does not even seem to lead to an exception. The script seems to get into some kind of hang, followed by terminating with a console message that says,
[...] Connecting to remote server ... failed with the following error message : The client cannot connect to the destination specified in the
request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service
running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and
configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (...:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : CannotConnect,PSSessionStateBroke