1
-
1
+ throw " NEVER RUN THIS FILE! "
2
2
# ## New PowerShell 4 stuff:
3
3
4
4
# the undiscoverable foreach
5
5
@ (" any" , " array" , " has" ).foreach ({ $_ })
6
- @ (" any" , " array" , " has" ).foreach { $_ }
6
+ @ (' any' , ' array' , ' has' ).foreach { $_ }
7
7
8
8
# the undiscoverable where
9
9
@ (" any" , " array" , " has" ).where ({ $_.Length -gt 3 })
@@ -25,7 +25,7 @@ Configuration Crazyness {
25
25
26
26
# ## PowerShell 3 and older:
27
27
28
- # st: trimTrailingWhiteSpaceOnSave false
28
+ # st: trimTrailingWhiteSpaceOnSave false
29
29
<#
30
30
Let's see what embedded docs in comments look like...
31
31
TODO: inside here, .<tab> should present list of doc keywords
@@ -134,13 +134,16 @@ string.'
134
134
" Although obviously in a $ ( $subexpression.Length ) it should be!"
135
135
136
136
# TODO: can we highlight this as an error?
137
- if (! ($PSVersionTable.PSVersion -ge ' 3.0' ) {
137
+ if (! ($PSVersionTable.PSVersion -ge ' 3.0' )) {
138
138
# In PowerShell 3, this will cause an ERROR
139
139
" In PowerShell 2 we could $drive : to add a colon"
140
140
}
141
141
142
- " This is deeply nested: $ ( stuff- here | % { why- would { $ ( (" you, do this)) anyway" ) ) } } ) "
143
- " When you call a method: $ ( stuff- here | % { Invoke-Expression $ ( [statictype ]::method(" Like (this" ) ) $var } ) "
142
+ function get-numbers { 1 .. 3 }
143
+ # NOTE: PowerShell can't actually parse this line correctly:
144
+ " This is deeply nested: $ ( get-number | % { invoke-command { $ ((" you, do this)) anyway" )) } } ) "
145
+
146
+ " When you call a method: $ ( get-number | % { invoke-command $ ( [string ]::format(" Like (this{0})" , " what?" ) ) $var } ) "
144
147
# " <-- this stops the string above, until we fix the parenthesis on methods.
145
148
# TODO: Highlight member access
146
149
# TODO: Highlight array access
0 commit comments