Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- This Function creates a dialogue to return a File
- #>
- function Get-FileName($initialDirectory)
- {
- [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
- $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
- $OpenFileDialog.initialDirectory = $initialDirectory
- $OpenFileDialog.FileName = "Select User List Input File"
- #can be set to filter file types
- param([switch] $filtercsv)
- if($filtercsv){$OpenFileDialog.filter = "CSV (*.csv)| *.csv"}
- $OpenFileDialog.ShowDialog() | Out-Null
- Return $OpenFileDialog.FileName
- }
- Export-ModuleMember -Function 'Get-*'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement