Link to home
Start Free TrialLog in
Avatar of SAM2009
SAM2009Flag for Canada

asked on

Add a prompt msg in PowerShell

In this PowerShell code:

-------------------------------------------------------------------------------------------------------------------------------
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
    InitialDirectory = [Environment]::GetFolderPath('Desktop')
    Filter = 'Documents (*.docx)|*.docx|SpreadSheet (*.xlsx)|*.xlsx'
}
$null = $FileBrowser.ShowDialog()
-------------------------------------------------------------------------------------------------------------------------------

How can I add a msg like: "Please choose your userinfo file:"
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SAM2009

ASKER

Thanks! By the way, could you tell me why the last cmd have to be there?:

$null = $FileBrowser.ShowDialog()

Why put it in $null?
the result of the showdialog is either ok or cancel the null removes the ok/cancel message
Avatar of SAM2009

ASKER

Thanks guys!