0
我有一個Powershell Commandlet,它根據條件從安全字符串中提示用戶。現在我想自動執行此命令行的測試,爲此我使用Powershell遠程運行空間來調用命令行開關。目前它失敗並出現此錯誤。如何在創建了Host.Ui.prompt命令的代碼創建的powershell shell中執行腳本?
Write-Host : A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows.
我該如何實現自動化?
此cmdlet是您寫的東西嗎?這將有助於看到一些代碼。原則上,所有對函數的輸入都應該通過參數。這使它很容易自動化。 – ojk 2014-10-07 10:24:44