Advertisement
Combreal

openFile01.ps1

Jun 9th, 2021
1,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Add-Type -AssemblyName System.Windows.Forms
  2.  
  3. $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
  4.     InitialDirectory = [Environment]::GetFolderPath('Desktop')
  5.     #Filter = 'Documents (*.docx)|*.docx|SpreadSheet (*.xlsx)|*.xlsx'
  6. }
  7. $null = $FileBrowser.ShowDialog()
  8. $FileBrowser.FileName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement