Beispiel #1
0
        protected override void ProcessRecord()
        {
            PSWorkspacePurgeBody parameters;

            if (this.IsParameterBound(c => c.PurgeBody))
            {
                parameters = PurgeBody;
            }
            else
            {
                var filters = new List <WorkspacePurgeBodyFilters> {
                    new WorkspacePurgeBodyFilters(Column, OperatorProperty, Value, Key)
                };
                parameters = new PSWorkspacePurgeBody(filters, Table);
            }

            if (ShouldProcess(WorkspaceName, $"Purges data in a LogAnalytics workspace: {WorkspaceName}, resource group: {ResourceGroupName}"))
            {
                WriteObject(OperationalInsightsClient.PurgeWorkspace(ResourceGroupName, WorkspaceName, parameters));
            }
        }