public static SdkCustomRule ToSdkCustomRule(this PSCustomRule psRule) { return(new SdkCustomRule { Name = psRule.Name, RateLimitDurationInMinutes = psRule.RateLimitDurationInMinutes, RateLimitThreshold = psRule.RateLimitThreshold, Action = psRule.Action, MatchConditions = psRule.MatchConditions?.Select(x => x.ToSdkMatchCondition()).ToList(), Priority = psRule.Priority, RuleType = psRule.RuleType }); }
public override void ExecuteCmdlet() { var CustomRule = new PSCustomRule { Name = Name, MatchConditions = MatchCondition.ToList(), Priority = Priority, RuleType = RuleType, RateLimitDurationInMinutes = !this.IsParameterBound(c => c.RateLimitDurationInMinutes)? 1 : RateLimitDurationInMinutes, RateLimitThreshold = RateLimitThreshold, Action = Action }; WriteObject(CustomRule); }