简体   繁体   English

是否有等效于$ Host.UI.Prompt()和$ Host.UI.PromptForChoice()的Cmdlet?

[英]Are there Cmdlets equivalent to $Host.UI.Prompt() and $Host.UI.PromptForChoice()?

The $host.UI.PromptForCredential() method has an equivalent cmdlet Get-Credential. $host.UI.PromptForCredential()方法具有等效的cmdlet Get-Credential。
Do $host.UI.Prompt() and $host.UI.PromptForChoice() also have equivalent cmdlets? $host.UI.Prompt()$host.UI.PromptForChoice()也具有等效的cmdlet?

The closest thing in native Powershell that I know of is Out-GridView in V3 and later versions: 我所知道的本机Powershell中最接近的东西是V3和更高版本中的Out-GridView

Get-Childitem *.txt | select -ExpandProperty FullName |
Out-GridView -Title 'Select file(s) to open.' -OutputMode Multiple |
foreach {& Notepad $_ }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM