I have a Switch statement further on that will do something different with $SelectedItemText, depending on whether $SelectedItemType is a folder or a textfile.
My problem is that $Result returns the type and text together. Also, GridView lists the type column first and the #text column second. What I want returned is the #text# for the row I select.
That looks much more efficient, and I understand it, but when I evaluate $Result in debug mode (breakpoint at line 6) I get an object, but not one with properties I can use:
Hit Line breakpoint on 'C:\Computer\Untitled1.ps1:6'[DBG]: PS C:\Computer>> $result@{Type=folder; Text=C:\Computer}
This is strange: I saved your most recent (re-)post on my computer at home, adjusted the computer id and the path for the configuration file and it worked without a hitch.
I will have to do some more troubleshooting at work on Monday. Thanks for your patience and guidance.
I figured it out! Near the beginning of my script (which was not shown here) I was initializing some variables (a habit of VBA option explicit). My problem was
Open in new window
However, typing $Result. (note the period to prompt for properties), Intellisense only offers Length, Clone, etc.