Simon Elms
Simon Elms

Reputation: 19728

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

The $host.UI.PromptForCredential() method has an equivalent cmdlet Get-Credential.
Do $host.UI.Prompt() and $host.UI.PromptForChoice() also have equivalent cmdlets?

Upvotes: 0

Views: 283

Answers (1)

mjolinor
mjolinor

Reputation: 68301

The closest thing in native Powershell that I know of is Out-GridView in V3 and later versions:

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

Upvotes: 1

Related Questions