Selectors vs Functions #2521
-
In something like Azure.Template.Rule.ps1 there are functions defined (e.g IsParameterFile) which is then used with -If ... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@paulmccrady When writing PowerShell rules you can use either. When using YAML/ JSON rules you are only able to use a Selector. In general, selectors ( We prefer use of Selectors over script pre-conditions because we are making efforts to optimize this use case. However, currently not all expressions or use cases can be supported using the YAML/ JSON syntax supported by selectors today. |
Beta Was this translation helpful? Give feedback.
@paulmccrady When writing PowerShell rules you can use either. When using YAML/ JSON rules you are only able to use a Selector.
In general, selectors (
-With
) and script pre-conditions (-If
) can be used interchangeably.We prefer use of Selectors over script pre-conditions because we are making efforts to optimize this use case. However, currently not all expressions or use cases can be supported using the YAML/ JSON syntax supported by selectors today.