From a296b4f7b49f4e3c743c801cc7583af30839fd99 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Wed, 3 Aug 2022 13:57:06 +0200 Subject: [PATCH] Added notes about JMESPath to the KB --- knowledge base/jmespath.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 knowledge base/jmespath.md diff --git a/knowledge base/jmespath.md b/knowledge base/jmespath.md new file mode 100644 index 0000000..39dff19 --- /dev/null +++ b/knowledge base/jmespath.md @@ -0,0 +1,21 @@ +# JMESPath + +## TL;DR + +```sh +# Filter elements in a list. +az devops user list \ + --org https://dv.azure.com/organizationName \ + --query "\ + items[? \ + startsWith(user.principalName, 'yourNameHere') && \ + \! contains(accessLevel.licenseDisplayName, 'Test plans') \ + ].user.displayName" +``` + +## Further readings + +- [Website] + +[specifications]: https://jmespath.org/specification.html +[website]: https://jmespath.org/