I'd like to search for all files that end in .att, but exclude anything that starts with sorted_.
Function Get-AttName($initialDirectory)
{
[System.Reflection.Assembly]::LoadWithPartialName(“System.windows.forms”) |
Out-Null
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$OpenFileDialog.initialDirectory = $initialDirectory
$OpenFileDialog.filter = “All files (*.att)| *.att”
$OpenFileDialog.ShowDialog() | Out-Null
$OpenFileDialog.filename
} #end function Get-FileName
And here are some files:
test.att
sorted_test.att
Nav_HF_New.att
Sorted_Nav_HF_New.att
I want to only be able to select test.att and Nav_HF_New.att. Is there an easy way to do this?
Thanks!