简体   繁体   中英

search in array values - powershell

I've an array with 10 values (0 to 9). Each array value output is a multi-liner. Here is what it looks like for example -

C:>arrval[0]
12345
34593433598434
error1
357948557
C:>arrval[1]
238296879234
error1
93454753503
error2

I'm checking to see if we can print only the error portion in an array value.

像这样吗

$arrval -split "`n" |  where {$_ -like "*error*"}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM