Filter Opendialog Textbox - Browse for File Output

I have created a Textbox - Browse for File function on my form. The output from the Files selected will be displayed. I will then use ‘openfiledialog.filenames’ to be used in CMDlet that references the file names that were selected. This works perfectly. However the end result needs to be changed. The only way I can do this is by making sure that a file that will always contain 195 in the filename be selected first. The openfiledialog and the textbox will always sort alphabetically. I would like to be specfic about what file it uses first or in order of my desire. I tried adding a -contains switch after openfiledialog.filenames but it did not work or the most likely scenario that this isnt what I need or I am simply using the switch wrong.

If someone could help me sort this. I will be forever thankful. I have spent much time on this project and this last detail feels like a brick wall for me right now. Thanks again.

Steven, welcome to Powershell.org. Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.

When you crosspost the same question at the same time to different forums you should at least post links to the other forums along with your question to avoid people willing to you help making their work twice or more.

https://social.technet.microsoft.com/Forums/en-US/ae6dd53c-d38c-406b-960e-e6f21b5ff7d2/filter-opendialog-textbox-browse-for-file-output?forum=winserverpowershell

It might be helpful for people willing to help you to actually see your code and see what data you’re dealing with.

When you post code or error messages or sample data or console output format it as code, please.
In the “Text” view you can use the code tags “PRE”, in the “Visual” view you can use the format template “Preformatted”. You can go back edit your post and fix the formatting - you don’t have to create a new one.
Thanks in advance.

Thanks for the information. I have solved the problem myself. However I do apologize for the poor execution of my post. I have learned through another post of how to better approach this. Moving forward, if I post again. I will make it clear and concise as possible. Thanks for your time.

You might share your solution anyway to help others in the future having the same or a similar problem. :wink:

Olaf if the question posed is not readable or up to forum standards. I doubt the solution to the issue will make much sense. Since you as one the top contributor, I would not want to offend you by posting a solution. I would want to fix up the original post which would take more time than I have. I also feel like crap after posting as you and the person from Technet jumped all over me for not following the guidelines set by both communities. Which I assume is now the gold standard. Thanks for all your help! Once again the internet is a fair and concise place to communicate with people of similar interests or goals. Please keep up the great work. The rank of Community MVP must of taken a lot of time! Thank you very much for the time you dedicated to helping other people improve their PowerShell skills.