Conversation
merill
left a comment
There was a problem hiding this comment.
@komalp2025 In this new logic, if a Header is passed it is not including the ConsistencyLevel in the header collection. We need to include it based on the value provided in the ConsistencyLevel parameter
Hi @merill , this is already taken care of. Also if user has provided consistency level in header, it will also get reset to the value provided in consistency parameter. Please see below code snippet PS C:\GitRepo\zerotrustassessment> $requestHeaders = if ($Headers) { $Headers.Clone() } else { @{} }
PS C:\GitRepo\zerotrustassessment> $requestHeaders
Name Value
---- -----
Content-Type application/json
PS C:\GitRepo\zerotrustassessment> $ConsistencyLevel = 'eventual'
PS C:\GitRepo\zerotrustassessment> $requestHeaders['ConsistencyLevel'] = $ConsistencyLevel
PS C:\GitRepo\zerotrustassessment> $requestHeaders
Name Value
---- -----
Content-Type application/json
ConsistencyLevel eventualPS C:\GitRepo\zerotrustassessment> $headers = @{"Content-Type" = "application/json"
>> "ConsistencyLevel" = 'testvalue'}
PS C:\GitRepo\zerotrustassessment> $requestHeaders = if ($Headers) { $Headers.Clone() } else { @{} }
PS C:\GitRepo\zerotrustassessment> $requestHeaders
Name Value
---- -----
Content-Type application/json
ConsistencyLevel testvalue
PS C:\GitRepo\zerotrustassessment> $requestHeaders['ConsistencyLevel'] = $ConsistencyLevel
PS C:\GitRepo\zerotrustassessment> $requestHeaders
Name Value
---- -----
ConsistencyLevel eventual
Content-Type application/json
|
Adding Header parameter to provide extra headers in Invoke-ZTGraphRequest. Earlier it was hardcoded to Consistency Level only.
PR results are updated at https://github.com/microsoft/ztspecs/issues/314