public override void ExecuteCmdlet() { try { if (!ProcessParameters()) { return; } if (string.IsNullOrEmpty(BackupPolicyName)) { BackupPolicyListResponse backupPolicyList = null; backupPolicyList = StorSimpleClient.GetAllBackupPolicies(deviceId); WriteObject(backupPolicyList.BackupPolicies); WriteVerbose(string.Format(Resources.BackupPolicyGet_StatusMessage, backupPolicyList.BackupPolicies.Count, backupPolicyList.BackupPolicies.Count > 1 ? "ies" : "y")); } else { GetBackupPolicyDetailsResponse backupPolicyDetail = null; backupPolicyDetail = StorSimpleClient.GetBackupPolicyByName(deviceId, BackupPolicyName); if (string.IsNullOrEmpty(backupPolicyDetail.BackupPolicyDetails.InstanceId)) { WriteVerbose(string.Format(Resources.NoBackupPolicyWithGivenNameFound, BackupPolicyName, DeviceName)); } else { WriteObject(backupPolicyDetail.BackupPolicyDetails); WriteVerbose(string.Format(Resources.BackupPolicyFound, backupPolicyDetail.BackupPolicyDetails.InstanceId)); } } } catch (Exception exception) { this.HandleException(exception); } }