是否可以将文本发送到当前提示行?类似于以下内容:
PS[10]> Get-Location
c:/
PS[11]> Write-PromptLine "This text has been written by Powershell"
PS[12]> This text has been written by Powershell|
# | denotes the caret
Run Code Online (Sandbox Code Playgroud)
您可以使用SendKeys.SendWait方法:
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("This text has been written by Powershell")
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
349 次 |
最近记录: |