(Another silly question) How do I select a property that has a space in the name?

I want to select a property with a space in the name, but I can’t seem to find the right way to do it.

This is my script:

$tablevalue = $data [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null $Bestelbon = [Microsoft.VisualBasic.Interaction]::InputBox("Enter Bestelbon") $tablevalue | Where{$Bestelbon -match $_.'Bestelbon Nr'} | Out-GridView -OutputMode Single -Title 'select' 

I can’t seem to figure out how to write this correctly:

$_.'Bestelbon Nr' 

I tried a few thing mentioned here, but no luck:

https://communary.net/2014/11/15/quick-tip-dealing-with-special-characters-in-variables-and-property-names/

Thanks for your insight!

submitted by /u/FreshlyBakedMan
[link] [comments]

Leave a Reply