From 004380d788e2272c2b8e115fc4d684301162cd37 Mon Sep 17 00:00:00 2001 From: Reshmee Auckloo Date: Wed, 28 May 2025 07:14:51 +0100 Subject: [PATCH 1/2] fix for bug #4943 --- src/Commands/Admin/UnregisterHubSite.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/Admin/UnregisterHubSite.cs b/src/Commands/Admin/UnregisterHubSite.cs index ad32a8f4d..efa5f1c5a 100644 --- a/src/Commands/Admin/UnregisterHubSite.cs +++ b/src/Commands/Admin/UnregisterHubSite.cs @@ -26,7 +26,7 @@ protected override void ExecuteCmdlet() } else { - props = hubSitesProperties.Single(h => h.SiteUrl.Equals(Site.Url, StringComparison.OrdinalIgnoreCase)); + props = hubSitesProperties.Single(h => !string.IsNullOrEmpty(h.SiteUrl) && h.SiteUrl.Equals(Site.Url, StringComparison.OrdinalIgnoreCase)); } Tenant.UnregisterHubSiteById(props.ID); AdminContext.ExecuteQueryRetry(); From 86e1f36e083289f9714a09cddc2e1dd17db1392d Mon Sep 17 00:00:00 2001 From: Reshmee Auckloo Date: Wed, 16 Jul 2025 11:49:53 +0100 Subject: [PATCH 2/2] fix for #5018 --- documentation/Remove-PnPTermLabel.md | 9 ++++----- src/Commands/Taxonomy/RemoveTermLabel.cs | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/documentation/Remove-PnPTermLabel.md b/documentation/Remove-PnPTermLabel.md index 41bba1c91..4a94d4df4 100644 --- a/documentation/Remove-PnPTermLabel.md +++ b/documentation/Remove-PnPTermLabel.md @@ -22,7 +22,7 @@ Remove-PnPTermLabel -Lcid [-TermStore ] [-Connection ] - [-Confirm] + [-Force] ``` @@ -36,7 +36,7 @@ Remove-PnPTermLabel -TermGroup [-TermStore ] [-Connection ] - [-Confirm] + [-Force] ``` @@ -60,13 +60,12 @@ Removes the Swedish label from the specified term. ## PARAMETERS -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -Force +Specifying the Force parameter will skip the confirmation question. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf Required: False Position: Named diff --git a/src/Commands/Taxonomy/RemoveTermLabel.cs b/src/Commands/Taxonomy/RemoveTermLabel.cs index 8bcb7ed38..3c9e8d19b 100644 --- a/src/Commands/Taxonomy/RemoveTermLabel.cs +++ b/src/Commands/Taxonomy/RemoveTermLabel.cs @@ -32,6 +32,9 @@ public class RemoveTermLabel : PnPSharePointCmdlet [Parameter(Mandatory = false, ValueFromPipeline = true, ParameterSetName = ParameterAttribute.AllParameterSets)] public TaxonomyTermStorePipeBind TermStore; + [Parameter(Mandatory = false)] + public SwitchParameter Force; + protected override void ExecuteCmdlet() { var taxonomySession = TaxonomySession.GetTaxonomySession(ClientContext); @@ -67,7 +70,7 @@ protected override void ExecuteCmdlet() if (term != null) { term.EnsureProperties(t => t.Name, t => t.Id); - if (ShouldContinue($"Delete label {Label} for language {Lcid} from Term {term.Name} with id {term.Id}", Properties.Resources.Confirm)) + if (Force || ShouldContinue($"Delete label {Label} for language {Lcid} from Term {term.Name} with id {term.Id}", Properties.Resources.Confirm)) { var labels = term.GetAllLabels(Lcid); ClientContext.Load(labels);