2014-09-04 90 views
1

我試圖通過調用cmd shell通過powershell將bitlocker狀態寫入文本文件,但它似乎不起作用。有任何想法嗎?Powershell將BitLocker狀態寫入文本文件

這是我已經試過到目前爲止

#doesn't work 
    cmd /c manage-bde.txt>c:\bitlockerstatus.txt 


    # makes an empty file 
    $oProcess = Start-Process cmd.exe -ArgumentList "manage-bde>c:\bitlockerstatus.txt" -wait -NoNewWindow -PassThru 
    $oProcess.HasExited 
    $oProcess.ExitCode 

    #doesn't work 
    [Diagnostics.Process]::Start("cmd.exe","/c manage-bde>c:\bitlockerstatus.txt") 

回答

0

你爲什麼不直接從PowerShell中使用&操作者調用的exe?

& manage-bde.exe -status > c:\temp\bl.txt