Skip to content

Commit 6eed978

Browse files
authored
Merge pull request #4523 from reusto/bugfix/consistencyleveleventual
Fixed Invoke-PnPGraphMethod ConsistencyLevelEventual parameter not used properly
2 parents bf8d384 + 1ca1d90 commit 6eed978

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
6666
- Fixed `Get-PnPAzureADAppSitePermission`, `Grant-PnPAzureADAppSitePermission` and `Revoke-PnPAzureADAppSitePermission` cmdlets throwing an error when the site URL is not specified and the app registration used only having Graph permissions [#4421](https://github.com/pnp/powershell/pull/4421)
6767
- Fixed `Get-PnPTerm` cmdlet not working correctly when `-ParentTerm` parameter is specified. [#4454](https://github.com/pnp/powershell/pull/4454)
6868
- Fixed the PnP PowerShell version check to only check nightly version in nightly builds and major version in release builds. [#4453](https://github.com/pnp/powershell/pull/4453)
69+
- Fixed `-ConsistencyLevelEventual` flag on `Invoke-PnPGraphMethod` to work correctly. [#4523](https://github.com/pnp/powershell/pull/4523)
6970
- Fixed `Get-PnPServiceHealthIssue` returning an error when certain service states were active [#4530](https://github.com/pnp/powershell/pull/4530)
7071

7172
### Removed
@@ -79,6 +80,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
7980

8081
### Contributors
8182

83+
- [reusto]
8284
- Fredrik Thorild [fthorild]
8385
- San [sankarkumar23]
8486
- Christian Veenhuis [ChVeen]
@@ -535,7 +537,6 @@ Fixed app registration on Windows
535537
- Kunj Balkrishna Sangani [kunj-sangani]
536538
- Dayana Hristova [makarovv]
537539
- Rodrigo Pinto [ScoutmanPt]
538-
- [reusto]
539540
- Reshmee Auckloo [reshmee011]
540541
- Dan Toft [Tanddant]
541542
- [reusto]

src/Commands/Graph/InvokeGraphMethod.cs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,10 @@ public string Url
6060
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TOSTREAM)]
6161
public string ContentType = "application/json";
6262

63-
6463
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TOFILE)]
6564
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TOCONSOLE)]
6665
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TOSTREAM)]
67-
public GraphAdditionalHeadersPipeBind AdditionalHeaders;
68-
// public IDictionary<string, string> AdditionalHeaders
69-
// {
70-
// get
71-
// {
72-
// if (ConsistencyLevelEventual.IsPresent)
73-
// {
74-
// if (additionalHeaders == null)
75-
// {
76-
// additionalHeaders = new Dictionary<string, string>();
77-
// }
78-
// additionalHeaders.Remove("ConsistencyLevel");
79-
// additionalHeaders.Add("ConsistencyLevel", "eventual");
80-
// }
81-
// return additionalHeaders;
82-
// }
83-
// set
84-
// {
85-
// additionalHeaders = value;
86-
// }
87-
// }
66+
public GraphAdditionalHeadersPipeBind AdditionalHeaders = new(new Dictionary<string, string>());
8867

8968
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TOFILE)]
9069
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_TOCONSOLE)]
@@ -101,7 +80,7 @@ public string Url
10180
public string OutFile;
10281

10382
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_TOSTREAM)]
104-
public SwitchParameter OutStream;
83+
public SwitchParameter OutStream;
10584

10685
protected override void ExecuteCmdlet()
10786
{
@@ -335,6 +314,6 @@ private void HandleResponse(HttpResponseMessage response)
335314
default:
336315
throw new Exception($"Parameter set {ParameterSetName} not supported");
337316
}
338-
}
317+
}
339318
}
340319
}

0 commit comments

Comments
 (0)