The constructs -ne, -eq, and -gt looks at least strange.
if ($true -eq $true){}
but not
if ($true = $true){}
What is the explanation?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically the answer is that it is how Unix has done it forever. Sure enough, if you write some Bash scripts that’s what you’ll use and it’s actually nice to have your PowerShell syntax knowledge transfer over one for one to Bash.
It is answered in detail in Bruce Payette’s Windows PowerShell in Action, Second Edition (Kindle Location 3391).