From 521b1086aa9229b790fac640918a2478b08e008a Mon Sep 17 00:00:00 2001 From: ryannewington Date: Fri, 21 Apr 2017 00:13:09 +1000 Subject: [PATCH] Adds -Force switch for Disconnect-CSObject cmdlet --- src/Lithnet.Miiserver.Automation/Disconnect-CSObject.cs | 7 +++++-- .../LithnetMIISAutomation.Help.pshproj | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Lithnet.Miiserver.Automation/Disconnect-CSObject.cs b/src/Lithnet.Miiserver.Automation/Disconnect-CSObject.cs index 87115ee..eba1232 100644 --- a/src/Lithnet.Miiserver.Automation/Disconnect-CSObject.cs +++ b/src/Lithnet.Miiserver.Automation/Disconnect-CSObject.cs @@ -9,7 +9,7 @@ namespace Lithnet.Miiserver.Automation { [Cmdlet(VerbsCommunications.Disconnect, "CSObject")] - public class DisconnectCSObject : Cmdlet + public class DisconnectCSObject : PSCmdlet { [Parameter(Mandatory = true, Position = 1, ValueFromPipeline =true), ValidateNotNullOrEmpty] public CSObject CSObject { get; set; } @@ -17,6 +17,9 @@ public class DisconnectCSObject : Cmdlet [Parameter(Mandatory = false, Position = 2)] public SwitchParameter Explicit {get;set;} + [Parameter(Mandatory = false, Position = 3)] + public SwitchParameter Force { get; set; } + private bool yesToAll; private bool noToAll; @@ -32,7 +35,7 @@ protected override void ProcessRecord() return; } - if (this.yesToAll || this.ShouldContinue("This action will result in the metaverse object being deleted. Continue", "Confirm disconnection", ref this.yesToAll, ref this.noToAll)) + if (this.Force || this.yesToAll || this.ShouldContinue("This action will result in the metaverse object being deleted. Continue", "Confirm disconnection", ref this.yesToAll, ref this.noToAll)) { this.prompted = true; this.CSObject.Disconnect(this.Explicit.IsPresent); diff --git a/src/Lithnet.Miiserver.Automation/LithnetMIISAutomation.Help.pshproj b/src/Lithnet.Miiserver.Automation/LithnetMIISAutomation.Help.pshproj index c9319a4..f3ef7d6 100644 --- a/src/Lithnet.Miiserver.Automation/LithnetMIISAutomation.Help.pshproj +++ b/src/Lithnet.Miiserver.Automation/LithnetMIISAutomation.Help.pshproj @@ -1,7 +1,7 @@ LithnetMIISAutomation - 1.0.6236.18578 + 1.0.6320.366 Lithnet PowerShell Module for FIM Synchronization Service true