Quantcast
Channel: OR and AND operator inside ? filter - Stack Overflow
Viewing all articles
Browse latest Browse all 3

OR and AND operator inside ? filter

$
0
0

I have a long program which does as such:

[xml]$data = get-content "c:\somedatafile.xml"$data.PRINTERS.PRINTER `| ? { $_.USERS.USER -eq "$env:username" } `| ForEach-Object{      # install some printer with $_}

I have also some COMPUTERS.COMPUTER to be compared with $env:computername.

How can I install the printer if at least one of the COMPUTERS.COMPUTER -eq "$env:computername"? Or how do I include OR and AND, and possibly () inside the ? filter.

Where can the meaning of the ? filter be found out (Google fails with monocarachter queries)?

Suggestions about code sanity are welcome.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images