This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I'm pulling a xls into a $var with import-excel. Storing a 2-digit column name in var $OSV
This Works: $var | Where-Object -Property $OSV -Match 'Windows'
This Doesn't: $var | Where-Object {$_.OSV -Match 'Windows' }
I've tried using single/double quotes, tried -like, verified the value I'm using shows up when I pipe $var| gm as the correct property name. I've tried little changes in the formatting of that section of the command and everything I do that doesn't generate an error takes the same time to run thru the array it just never outputs anything. The ideal end result will be something like:
$var| Where-Object {$_.OSV -Match -'Windows -and $_.OSV -Notmatch 'Server'}
Update: $var | Where-Object {$_.$OSV -Match 'Windows' }
This Works.
Subreddit
Post Details
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PowerShell/...