Author Posts

June 26, 2015 at 6:59 am

Hi I am Jiten, Here's my question:
I want to run two commands back to back. Command2 uses object of Command1.
Eg.
Command1: $ptt = Get-WmiObject -namespace "root/cimv2/security/microsofttpm" win32_tpm

Command2: $ptt.IsEnabled()

I am trying to run these command through Python Subprocess module. But problem is that i can run only i command at a time. I tried using Export-Clixml but in that also i have to run Import command first.

Kindly help me on this . I will be really grateful.

Regards,
JB

June 26, 2015 at 7:53 am

I don't know anything about Python, but this can be run as a single command:

 
(Get-WmiObject -namespace "root/cimv2/security/microsofttpm" -Class win32_tpm).IsEnabled()

June 26, 2015 at 8:16 am

Thanks Man !! Its worked. Thanks alot.

Regards,
JB