diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceDetails/SetAzureStorSimpleDevice.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceDetails/SetAzureStorSimpleDevice.cs index ebe881ab5aba..f960cb18d7d6 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceDetails/SetAzureStorSimpleDevice.cs +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/DeviceDetails/SetAzureStorSimpleDevice.cs @@ -135,6 +135,16 @@ public override void ExecuteCmdlet() private bool ProcessParameters() { + // Make sure that atleast one of the settings has been provided. + // Its no use making a request when the user didnt specify any of + // the settings. + if (string.IsNullOrEmpty(NewName) && TimeZone == null && + string.IsNullOrEmpty(SecondaryDnsServer) && + (StorSimpleNetworkConfig == null || StorSimpleNetworkConfig.Count() < 1)) + { + throw new ArgumentException(Resources.SetAzureStorSimpleDeviceNoSettingsProvided); + } + // Make sure that the DeviceId property has the appropriate value irrespective of the parameter set if (ParameterSetName == StorSimpleCmdletParameterSet.IdentifyByName) { diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs index dce6956f6fc5..5e719c371334 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs @@ -1014,6 +1014,15 @@ internal static string SecretsValidationCompleteMessage { } } + /// + /// Looks up a localized string similar to No settings were provided for updating device details.. + /// + internal static string SetAzureStorSimpleDeviceNoSettingsProvided { + get { + return ResourceManager.GetString("SetAzureStorSimpleDeviceNoSettingsProvided", resourceCulture); + } + } + /// /// Looks up a localized string similar to Parameter Skip cannot be <0. /// diff --git a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx index 3a016e9ef77f..f5f51db79f44 100644 --- a/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx +++ b/src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx @@ -513,4 +513,7 @@ Invalid value for Registration Key. CIK provided couldnt be used to decrypt the secrets! The exact exception while decrypting is "{0}"! + + No settings were provided for updating device details. + \ No newline at end of file