You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/experimental/console-command.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ true
94
94
- Bicep console also supports the [`load*()` functions](https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-files). Note: The directory from which the `bicep console` command is run is used as the _current directory_ when evaluating the `load*()` functions
95
95
96
96
97
-
### Piping and standard input redirection
97
+
### Piping and standard input/output redirection
98
98
The console command supports evaluating expressions provided through piping or redirected standard input, i.e.:
99
99
100
100
**Powershell**:
@@ -119,6 +119,11 @@ Multi-line input is also supported, i.e:
119
119
# Output: bar
120
120
```
121
121
122
+
Output redirection is also supported:
123
+
```sh
124
+
"toObject([{name:'Evie', age:4},{name:'Casper', age:3}], x => x.name)"| bicep console > output.json
125
+
```
126
+
122
127
## Limitations
123
128
- No support for expressions requiring Azure context, e.g. `resourceGroup()`
124
129
- No support for for-loop expressions, e.g. `[for i in range(0, x): i]`
privatestaticTask<CliResult>BicepInternal(InvocationSettingssettings,Action<IServiceCollection>?registerAction,InputContext?inputContext,CancellationTokencancellationToken,paramsstring?[]args/*null args are ignored*/)
0 commit comments