From 887d85cc6ea7e7bb9bc100264648edf16aec7cdd Mon Sep 17 00:00:00 2001 From: Ramon Smits Date: Tue, 24 Nov 2020 18:15:47 +0100 Subject: [PATCH] Inspired by #48 and #42 based on https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.1 it seems that to suppress the warning the Cmdlet should be invoked with `-WarningAction SilentlyContinue` or have `$WarningPreference` set to `SilentlyContinue`. --- .../Cmdlets/InstallPlatformLicense.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/NServiceBus.PowerShell/Cmdlets/InstallPlatformLicense.cs b/src/NServiceBus.PowerShell/Cmdlets/InstallPlatformLicense.cs index 9ab7ef6..5b5298d 100644 --- a/src/NServiceBus.PowerShell/Cmdlets/InstallPlatformLicense.cs +++ b/src/NServiceBus.PowerShell/Cmdlets/InstallPlatformLicense.cs @@ -9,6 +9,7 @@ using RegistryView = Helpers.RegistryView; [Cmdlet(VerbsLifecycle.Install, "NServiceBusPlatformLicense", DefaultParameterSetName = "ByLicenseFile")] + [Obsolete(@"The default location for reading license information has changed from the registry to the file system. See https://docs.particular.net/search?q=license. This Cmdlet will be removed in NServiceBus.PowerShell v6.0.0")] public class InstallPlatformLicense : CmdletBase { [Parameter(Mandatory = true, HelpMessage = "Platform license file to import", Position = 0, ParameterSetName = "ByLicenseFile")] @@ -19,6 +20,11 @@ public class InstallPlatformLicense : CmdletBase [ValidateNotNullOrEmpty] public string LicenseString { get; set; } + protected override void BeginProcessing() + { + WriteWarning("Installing license information in the registry has been deprecated as the Particular Platform reads license info from file system. For legacy installations this cmdlet can still be used. Use -Force to suppress this message."); + } + protected override void ProcessRecord() { const string particular = @"Software\ParticularSoftware";