File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed
Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ EqualityComparison
3+ ------------------
4+ ### Synopsis
5+ Allows equality comparison.
6+
7+ ---
8+ ### Description
9+
10+ Allows most equality comparison using double equals (==).
11+
12+ Many languages support this syntax. PowerShell does not.
13+
14+ This transpiler enables equality comparison with ==.
15+
16+ ---
17+ ### Examples
18+ #### EXAMPLE 1
19+ ``` PowerShell
20+ Invoke-PipeScript -ScriptBlock {
21+ $a = 1
22+ if ($a == 1 ) {
23+ "A is $a"
24+ }
25+ }
26+ ```
27+
28+ #### EXAMPLE 2
29+ ``` PowerShell
30+ {
31+ $a == "b"
32+ } | .>PipeScript
33+ ```
34+
35+ ---
36+ ### Parameters
37+ #### ** AssignmentStatementAST**
38+
39+ The original assignment statement.
40+
41+
42+
43+ | Type | Requried| Postion| PipelineInput |
44+ | ------------------------------| --------| -------| --------------|
45+ | ``` [AssignmentStatementAst] ``` | true | 1 | true (ByValue)|
46+ ---
47+ ### Syntax
48+ ``` PowerShell
49+ EqualityComparison [-AssignmentStatementAST] <AssignmentStatementAst> [<CommonParameters>]
50+ ```
51+ ---
52+ ### Notes
53+ This will not work if there is a constant on both sides of the expression
54+
55+
56+ if ($null == $null) { "this will work"}
57+ if ('' == '') { "this will not"}
58+
59+
60+
You can’t perform that action at this time.
0 commit comments