diff --git a/README.md b/README.md index 1d6d4b0..a219aa7 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ Example: `AzAPICall -uri "https://management.azure.com/subscriptions?api-version | body | `string` | Request Body for the API request - [Example](https://docs.microsoft.com/en-us/graph/api/group-post-owners?view=graph-rest-1.0&tabs=http#request-body) | | | caller | `string` | Set the value to `CustomDataCollection` for parallelization to have different font colors for the debug output | | | consistencyLevel | `string` | For several [OData query parameters](https://docs.microsoft.com/en-us/graph/query-parameters) the `consistencyLevel`-header need to be set to `eventual` | | -| listenOn | `string` | Depending to the expected response of the API call the following values are accepted: `Content`, `ContentProperties`, `Headers` or `StatusCode`. 💡 An example for the ARM Subscriptions API: To get _one_ defined subscription you would use `-listenOn Content`, for get/list _all_ subscriptions you would use no `-listenOn`-parameter as the default `listenOn`-value would be `Value`. Think [singular/plural](#example-for-azure-resource-manager) | default is `Value` | +| listenOn | `string` | Depending to the expected response of the API call the following values are accepted: `Value`, `Content`, `ContentProperties`, `Headers`, `StatusCode` or `Raw`. 💡 An example for the ARM Subscriptions API: To get _one_ defined subscription you would use `-listenOn Content`, for get/list _all_ subscriptions you would use no `-listenOn`-parameter as the default `listenOn`-value would be `Value`. Think [singular/plural](#example-for-azure-resource-manager) | default is `Value` | | noPaging | `switch` | If value is `true` paging will be deactivated and you will only get the defined number of `$top` results or [Resource Graph limits any query to returning only `100` records](https://docs.microsoft.com/en-us/azure/governance/resource-graph/concepts/work-with-data). Otherwise, you can use `$top` to increase the result batches from default `100` up to `999` for the `AzAPICall`. Value for `$top` must range from 1 to 999 | | | validateAccess | `switch` | Use this parameter if you only want to validate that the requester has permissions to the enpoint, if authorization is denied AzAPICall returns 'failed'. (Using `-validateAccess` will set `noPaging` to `true`) | | | skipOnErrorCode | `int32[]` | In some cases _(e.g. trying to add a user to a group were the user is already a member of)_ the API responde with an http status code 400. This is an expected error. To not throw an error and exit the script, you can use this parameter and set an expected error status code like `400`. You can also pass multiple errorcodes e.g. `-skipOnErrorCode 400,409` | | diff --git a/pwsh/module/build/AzAPICall.zip b/pwsh/module/build/AzAPICall.zip index 1107be8..28c69a0 100644 Binary files a/pwsh/module/build/AzAPICall.zip and b/pwsh/module/build/AzAPICall.zip differ diff --git a/pwsh/module/build/AzAPICall/AzAPICall.psd1 b/pwsh/module/build/AzAPICall/AzAPICall.psd1 index c2dacaf..fbc099f 100644 --- a/pwsh/module/build/AzAPICall/AzAPICall.psd1 +++ b/pwsh/module/build/AzAPICall/AzAPICall.psd1 @@ -12,7 +12,7 @@ RootModule = 'AzAPICall.psm1' # Version number of this module. - ModuleVersion = '1.1.85' + ModuleVersion = '1.1.86' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/pwsh/module/build/AzAPICall/functions/AzAPICallFunctions.ps1 b/pwsh/module/build/AzAPICall/functions/AzAPICallFunctions.ps1 index 9d82db3..5ad8c8c 100644 --- a/pwsh/module/build/AzAPICall/functions/AzAPICallFunctions.ps1 +++ b/pwsh/module/build/AzAPICall/functions/AzAPICallFunctions.ps1 @@ -69,8 +69,8 @@ function AzAPICall { [Parameter()] [string] - [ValidateSet('StatusCode', 'Headers', 'Content', 'ContentProperties')] - $listenOn, + [ValidateSet('StatusCode', 'Headers', 'Content', 'ContentProperties', 'Raw', 'Value')] + $listenOn = 'Value', [Parameter()] [string] @@ -510,6 +510,10 @@ function AzAPICall { $apiCallResultsCollection.Add($azAPIRequestConvertedFromJson) } } + elseif ($listenOn -eq 'Raw') { + debugAzAPICall -debugMessage "listenOn=Raw ($(($azAPIRequest).count))" + $null = $apiCallResultsCollection.Add($azAPIRequest) + } else { if (($azAPIRequestConvertedFromJson).value) { debugAzAPICall -debugMessage "listenOn=Default(Value) value exists ($((($azAPIRequestConvertedFromJson).value).count))" @@ -1741,7 +1745,7 @@ function getAzAPICallFunctions { function getAzAPICallRuleSet { return $function:AzAPICallErrorHandler.ToString() } -function getAzAPICallVersion { return '1.1.85' } +function getAzAPICallVersion { return '1.1.86' } function getJWTDetails { <# diff --git a/pwsh/module/dev/AzAPICall/AzAPICall.psd1 b/pwsh/module/dev/AzAPICall/AzAPICall.psd1 index c2dacaf..fbc099f 100644 --- a/pwsh/module/dev/AzAPICall/AzAPICall.psd1 +++ b/pwsh/module/dev/AzAPICall/AzAPICall.psd1 @@ -12,7 +12,7 @@ RootModule = 'AzAPICall.psm1' # Version number of this module. - ModuleVersion = '1.1.85' + ModuleVersion = '1.1.86' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/pwsh/module/dev/AzAPICall/functions/AzAPICall.ps1 b/pwsh/module/dev/AzAPICall/functions/AzAPICall.ps1 index 6c6dd7e..bb88fa3 100644 --- a/pwsh/module/dev/AzAPICall/functions/AzAPICall.ps1 +++ b/pwsh/module/dev/AzAPICall/functions/AzAPICall.ps1 @@ -69,8 +69,8 @@ [Parameter()] [string] - [ValidateSet('StatusCode', 'Headers', 'Content', 'ContentProperties')] - $listenOn, + [ValidateSet('StatusCode', 'Headers', 'Content', 'ContentProperties', 'Raw', 'Value')] + $listenOn = 'Value', [Parameter()] [string] @@ -510,6 +510,10 @@ $apiCallResultsCollection.Add($azAPIRequestConvertedFromJson) } } + elseif ($listenOn -eq 'Raw') { + debugAzAPICall -debugMessage "listenOn=Raw ($(($azAPIRequest).count))" + $null = $apiCallResultsCollection.Add($azAPIRequest) + } else { if (($azAPIRequestConvertedFromJson).value) { debugAzAPICall -debugMessage "listenOn=Default(Value) value exists ($((($azAPIRequestConvertedFromJson).value).count))" diff --git a/pwsh/module/dev/AzAPICall/functions/getAzAPICallVersion.ps1 b/pwsh/module/dev/AzAPICall/functions/getAzAPICallVersion.ps1 index ffd519d..7af4993 100644 --- a/pwsh/module/dev/AzAPICall/functions/getAzAPICallVersion.ps1 +++ b/pwsh/module/dev/AzAPICall/functions/getAzAPICallVersion.ps1 @@ -1 +1 @@ -function getAzAPICallVersion { return '1.1.85' } +function getAzAPICallVersion { return '1.1.86' }