private void ValidateTask(SecurityTask recommendation) { Assert.NotNull(recommendation); Assert.True(recommendation.CreationTimeUtc.HasValue); Assert.True(recommendation.CreationTimeUtc.Value.ToUniversalTime() < DateTime.UtcNow); }
public static PSSecurityTask ConvertToPSType(this SecurityTask value) { return(new PSSecurityTask() { Id = value.Id, Name = value.Name, ResourceId = value.SecurityTaskParameters.AdditionalProperties["resourceId"].ToString(), RecommendationType = value.SecurityTaskParameters.Name != "GenericSecuirtyTask" ? value.SecurityTaskParameters.Name : value.SecurityTaskParameters.AdditionalProperties["policyName"].ToString() }); }