0
我有執行PowerShell腳本的.bat文件。他們在Task Scheduler中運行正常,或者在我自己運行批處理文件時運行良好,但是當我從Outlook(無論是從VBA腳本還是使用規則)運行它們時 - 它們只是立即退出而沒有完成。從Outlook啓動時批處理文件失敗
,就像這樣:
* PowerShell的 - 文件C:\用戶\ tenba1 \文檔\腳本\ Account_Recon.ps1 *
我也試過這樣:
* 呼叫PowerShell -file C:\ Users \ tenba1 \ Documents \ Scripts \ Account_Recon.ps1 *
任何想法爲什麼會發生這種情況?
也顯示批次。 – Endoro
抱歉,不確定你的意思。 – user2725402
更新: 通過默認情況下Powershell的執行策略設置爲Restricted,這意味着您無法以批處理模式運行任何腳本。 將批處理文件更改爲此並且它工作: ** Powershell.exe -ExecutionPolicy Bypass -File C:\ Users \ tenba1 \ Documents \ Scripts \ Account_Recon.ps1 ** – user2725402