internal static AuditConfigurationPolicy NewAuditConfigurationPolicy(Workload workload, OrganizationIdParameter organizationId, out IEnumerable <ErrorRecord> pipelineErrors) { Command command = new Command("New-AuditConfigurationPolicy"); if (organizationId != null) { command.Parameters.Add("Organization", organizationId); } command.Parameters.Add("Workload", workload); return(AuditConfigUtility.InvokeCommand(command, out pipelineErrors) as AuditConfigurationPolicy); }
internal static AuditConfigurationRule NewAuditConfigurationRule(Workload workload, OrganizationIdParameter organizationId, MultiValuedProperty <AuditableOperations> auditOpsToSet, out IEnumerable <ErrorRecord> pipelineErrors) { Command command = new Command("New-AuditConfigurationRule"); if (organizationId != null) { command.Parameters.Add("Organization", organizationId); } command.Parameters.Add("Workload", workload); command.Parameters.Add("AuditOperation", auditOpsToSet); return(AuditConfigUtility.InvokeCommand(command, out pipelineErrors) as AuditConfigurationRule); }
internal static AuditConfigurationPolicy GetAuditConfigurationPolicy(Workload workload, OrganizationIdParameter organizationId, out IEnumerable <ErrorRecord> pipelineErrors) { Guid guid; if (!AuditPolicyUtility.GetPolicyGuidFromWorkload(workload, out guid)) { pipelineErrors = new List <ErrorRecord>(); return(null); } Command command = new Command("Get-AuditConfigurationPolicy"); if (organizationId != null) { command.Parameters.Add("Organization", organizationId); } command.Parameters.Add("Identity", guid.ToString()); return(AuditConfigUtility.InvokeCommand(command, out pipelineErrors) as AuditConfigurationPolicy); }