From 7d07649c9b028c107c4a70ceee78367e31747833 Mon Sep 17 00:00:00 2001 From: Koen Zomers Date: Sun, 3 Sep 2023 01:46:54 +0200 Subject: [PATCH] Code cleanup --- src/Commands/Taxonomy/SetTerm.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Commands/Taxonomy/SetTerm.cs b/src/Commands/Taxonomy/SetTerm.cs index eab4f0422..27b3a9541 100644 --- a/src/Commands/Taxonomy/SetTerm.cs +++ b/src/Commands/Taxonomy/SetTerm.cs @@ -54,7 +54,7 @@ public class SetTerm : PnPRetrievalsCmdlet public bool Deprecated; [Parameter(Mandatory = false)] - public bool AvailableForTagging; + public bool? AvailableForTagging; protected override void ExecuteCmdlet() { @@ -134,9 +134,9 @@ protected override void ExecuteCmdlet() term.Deprecate(Deprecated); } - if (ParameterSpecified(nameof(AvailableForTagging))) + if (ParameterSpecified(nameof(AvailableForTagging)) && AvailableForTagging.HasValue) { - term.IsAvailableForTagging = AvailableForTagging; + term.IsAvailableForTagging = AvailableForTagging.Value; } ClientContext.Load(term); @@ -145,5 +145,4 @@ protected override void ExecuteCmdlet() WriteObject(term); } } -} - +} \ No newline at end of file