powershell - Clarification of syntax used -


can explain me syntax? think didn't work, if can me find syntax.

$fichesaenvoyer = @($fiches | {($_.typefiche -eq '2') -and (($_.causes -eq '') -or ($_.causes -eq $null) -or ($_.causes.count -eq 0) -or ($_.actioncorrective -eq '') -or ($_.actioncorrective -eq $null) -or ($_.dateactioncorrective -eq '') -or ($_.dateactioncorrective -eq $null) -or ($_.actionpreventive -eq '') -or ($_.actionpreventive -eq $null) -or ($_.dateactionpreventive -eq '') -or ($_.dateactionpreventive -eq $null) )}) 

i don't understand why there $_ instead of $fiches

$_ variable where cmdlet creates represent current object in pipeline. example, if do:

1,2,3 | {$_ -ge 2} | write-host 

then $_ set 1 followed 2, followed 3.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -