We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e797e2 commit 3abe008Copy full SHA for 3abe008
Condition-Sequence.md
@@ -3,13 +3,13 @@
3
Now we have some fruit.
4
5
```powershell
6
-$fruit = @('Apples','Oranges','Bananas')
+$fruits = @('Apple','Orange','Banana')
7
```
8
9
-And write a simple method:
+Of course, `Apple` is a fruit. Not `fruits`:
10
11
12
-if ($fruit -eq 'Apples') {
+if ('Apple' -eq $fruits) {
13
echo 'True!'
14
} else {
15
echo 'False!'
@@ -19,13 +19,13 @@ if ($fruit -eq 'Apples') {
19
Which outputs:
20
21
```text
22
-True!
+False!
23
24
25
-But if you invert the condition:
+But is `$fruits` Apple?
26
27
28
-if ('Apples' -eq $fruit) {
+if ($fruits -eq 'Apple') {
29
30
31
@@ -35,7 +35,7 @@ if ('Apples' -eq $fruit) {
35
36
37
38
-False!
+True!
39
40
41
What a strange behavior of PowerShell!
0 commit comments