|
1 | | -All.psx.ps1 [[-InputObject] <Object>] [[-Where] <Object>] [[-For] <Object>] -CommandAst <CommandAst> [-Functions] [-Commands] [-Cmdlets] [-Aliases] [-Applications] [-Variables] [-Things] [<CommonParameters>] |
| 1 | + |
| 2 | +All |
| 3 | +--- |
| 4 | +### Synopsis |
| 5 | +all keyword |
| 6 | + |
| 7 | +--- |
| 8 | +### Description |
| 9 | + |
| 10 | +The all keyword is a powerful way to accomplish several useful scenarios with a very natural syntax. |
| 11 | + |
| 12 | +`all` can get all of a set of things that match a criteria and run one or more post-conditions. |
| 13 | + |
| 14 | +--- |
| 15 | +### Examples |
| 16 | +#### EXAMPLE 1 |
| 17 | +```PowerShell |
| 18 | +& { |
| 19 | +$glitters = @{glitters=$true} |
| 20 | +all that glitters |
| 21 | +}.Transpile() |
| 22 | +``` |
| 23 | + |
| 24 | +#### EXAMPLE 2 |
| 25 | +```PowerShell |
| 26 | +function mallard([switch]$Quack) { $Quack } |
| 27 | +Get-Command mallard | Get-Member | Select-Object -ExpandProperty TypeName -Unique |
| 28 | +. {all functions that quack are ducks}.Transpile() |
| 29 | +Get-Command mallard | Get-Member | Select-Object -ExpandProperty TypeName -Unique |
| 30 | +``` |
| 31 | + |
| 32 | +#### EXAMPLE 3 |
| 33 | +```PowerShell |
| 34 | +. { |
| 35 | + $numbers = 1..100 |
| 36 | + $null = all $numbers where { ($_ % 2) -eq 1 } are odd |
| 37 | + $null = all $numbers where { ($_ % 2) -eq 0 } are even |
| 38 | +}.Transpile() |
| 39 | +``` |
| 40 | +@( |
| 41 | + . { all even $numbers }.Transpile() |
| 42 | +).Length |
| 43 | + |
| 44 | +@( |
| 45 | + . { all odd $numbers }.Transpile() |
| 46 | +).Length |
| 47 | +--- |
| 48 | +### Parameters |
| 49 | +#### **Functions** |
| 50 | + |
| 51 | +If set, include all functions in the input. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +> **Type**: ```[Switch]``` |
| 56 | +
|
| 57 | +> **Required**: false |
| 58 | +
|
| 59 | +> **Position**: named |
| 60 | +
|
| 61 | +> **PipelineInput**:false |
| 62 | +
|
| 63 | + |
| 64 | + |
| 65 | +--- |
| 66 | +#### **Commands** |
| 67 | + |
| 68 | +If set, include all commands in the input. |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +> **Type**: ```[Switch]``` |
| 73 | +
|
| 74 | +> **Required**: false |
| 75 | +
|
| 76 | +> **Position**: named |
| 77 | +
|
| 78 | +> **PipelineInput**:false |
| 79 | +
|
| 80 | + |
| 81 | + |
| 82 | +--- |
| 83 | +#### **Cmdlets** |
| 84 | + |
| 85 | +If set, include all cmdlets in the input |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | +> **Type**: ```[Switch]``` |
| 90 | +
|
| 91 | +> **Required**: false |
| 92 | +
|
| 93 | +> **Position**: named |
| 94 | +
|
| 95 | +> **PipelineInput**:false |
| 96 | +
|
| 97 | + |
| 98 | + |
| 99 | +--- |
| 100 | +#### **Aliases** |
| 101 | + |
| 102 | +If set, include all aliases in the input |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +> **Type**: ```[Switch]``` |
| 107 | +
|
| 108 | +> **Required**: false |
| 109 | +
|
| 110 | +> **Position**: named |
| 111 | +
|
| 112 | +> **PipelineInput**:false |
| 113 | +
|
| 114 | + |
| 115 | + |
| 116 | +--- |
| 117 | +#### **Applications** |
| 118 | + |
| 119 | +If set, include all applications in the input |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +> **Type**: ```[Switch]``` |
| 124 | +
|
| 125 | +> **Required**: false |
| 126 | +
|
| 127 | +> **Position**: named |
| 128 | +
|
| 129 | +> **PipelineInput**:false |
| 130 | +
|
| 131 | + |
| 132 | + |
| 133 | +--- |
| 134 | +#### **Variables** |
| 135 | + |
| 136 | +If set, include all variables in the inputObject. |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | +> **Type**: ```[Switch]``` |
| 141 | +
|
| 142 | +> **Required**: false |
| 143 | +
|
| 144 | +> **Position**: named |
| 145 | +
|
| 146 | +> **PipelineInput**:false |
| 147 | +
|
| 148 | + |
| 149 | + |
| 150 | +--- |
| 151 | +#### **Things** |
| 152 | + |
| 153 | +If set, will include all of the variables, aliases, functions, and scripts in the current directory. |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | +> **Type**: ```[Switch]``` |
| 158 | +
|
| 159 | +> **Required**: false |
| 160 | +
|
| 161 | +> **Position**: named |
| 162 | +
|
| 163 | +> **PipelineInput**:false |
| 164 | +
|
| 165 | + |
| 166 | + |
| 167 | +--- |
| 168 | +#### **InputObject** |
| 169 | + |
| 170 | +The input to be searched. |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | +> **Type**: ```[Object]``` |
| 175 | +
|
| 176 | +> **Required**: false |
| 177 | +
|
| 178 | +> **Position**: 1 |
| 179 | +
|
| 180 | +> **PipelineInput**:true (ByPropertyName) |
| 181 | +
|
| 182 | + |
| 183 | + |
| 184 | +--- |
| 185 | +#### **Where** |
| 186 | + |
| 187 | +An optional condition |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | +> **Type**: ```[Object]``` |
| 192 | +
|
| 193 | +> **Required**: false |
| 194 | +
|
| 195 | +> **Position**: 2 |
| 196 | +
|
| 197 | +> **PipelineInput**:true (ByPropertyName) |
| 198 | +
|
| 199 | + |
| 200 | + |
| 201 | +--- |
| 202 | +#### **For** |
| 203 | + |
| 204 | +The action that will be run |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | +> **Type**: ```[Object]``` |
| 209 | +
|
| 210 | +> **Required**: false |
| 211 | +
|
| 212 | +> **Position**: 3 |
| 213 | +
|
| 214 | +> **PipelineInput**:true (ByPropertyName) |
| 215 | +
|
| 216 | + |
| 217 | + |
| 218 | +--- |
| 219 | +#### **Sort** |
| 220 | + |
| 221 | +The way to sort data before it is outputted. |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | +> **Type**: ```[Object]``` |
| 226 | +
|
| 227 | +> **Required**: false |
| 228 | +
|
| 229 | +> **Position**: 4 |
| 230 | +
|
| 231 | +> **PipelineInput**:true (ByPropertyName) |
| 232 | +
|
| 233 | + |
| 234 | + |
| 235 | +--- |
| 236 | +#### **Descending** |
| 237 | + |
| 238 | +If output should be sorted in descending order. |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | +> **Type**: ```[Switch]``` |
| 243 | +
|
| 244 | +> **Required**: false |
| 245 | +
|
| 246 | +> **Position**: named |
| 247 | +
|
| 248 | +> **PipelineInput**:true (ByPropertyName) |
| 249 | +
|
| 250 | + |
| 251 | + |
| 252 | +--- |
| 253 | +#### **CommandAst** |
| 254 | + |
| 255 | +The Command AST |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | +> **Type**: ```[CommandAst]``` |
| 260 | +
|
| 261 | +> **Required**: true |
| 262 | +
|
| 263 | +> **Position**: named |
| 264 | +
|
| 265 | +> **PipelineInput**:true (ByValue) |
| 266 | +
|
| 267 | + |
| 268 | + |
| 269 | +--- |
| 270 | +### Syntax |
| 271 | +```PowerShell |
| 272 | +All [-Functions] [-Commands] [-Cmdlets] [-Aliases] [-Applications] [-Variables] [-Things] [[-InputObject] <Object>] [[-Where] <Object>] [[-For] <Object>] [[-Sort] <Object>] [-Descending] -CommandAst <CommandAst> [<CommonParameters>] |
| 273 | +``` |
| 274 | +--- |
2 | 275 |
|
3 | 276 |
|
4 | 277 |
|
0 commit comments