In my PowerShell script, I'd like to use the output of a tool like git.
For example, the command line
git status
returns
# On branch master nothing to commit (working directory clean)
Now I tried to use this output in the following pipeline command:
git status | $_.Contains("nothing to commit")
But I get the error
Expressions are only allowed as the first element of a pipeline.
What am I doing wrong?