protected override void ProcessRecord()
        {
            SavedSearch properties = new SavedSearch()
            {
                Category    = this.Category,
                DisplayName = this.DisplayName,
                Query       = this.Query,
                Version     = this.Version
            };

            properties.Tags = SearchCommandHelper.PopulateAndValidateTagsForProperties(this.Tag, properties.Query);
            WriteObject(OperationalInsightsClient.CreateOrUpdateSavedSearch(ResourceGroupName, WorkspaceName, SavedSearchId, properties, Force, ConfirmAction), true);
        }
        protected override void ProcessRecord()
        {
            SavedSearch properties = new SavedSearch()
            {
                Category           = this.Category,
                DisplayName        = this.DisplayName,
                Query              = this.Query,
                Version            = this.Version,
                FunctionAlias      = this.FunctionAlias,
                FunctionParameters = this.FunctionParameter
            };

            bool patch = this.IsParameterBound(c => c.FunctionParameter);

            properties.Tags = SearchCommandHelper.PopulateAndValidateTagsForProperties(this.Tag, properties.Query);
            WriteObject(OperationalInsightsClient.CreateOrUpdateSavedSearch(ResourceGroupName, WorkspaceName, SavedSearchId, properties, patch, true, ConfirmAction, ETag), true);
        }
Exemplo n.º 3
0
        protected override void ProcessRecord()
        {
            SavedSearch properties = new SavedSearch()
            {
                Category    = this.Category,
                DisplayName = this.DisplayName,
                Query       = this.Query,
                Version     = this.Version,
                Tags        = new List <Tag>()
                {
                    new Tag()
                    {
                        Name = "Group", Value = "Computer"
                    }
                }
            };

            WriteObject(OperationalInsightsClient.CreateOrUpdateSavedSearch(ResourceGroupName, WorkspaceName, SavedSearchId, properties, Force, ConfirmAction), true);
        }
Exemplo n.º 4
0
        protected override void ProcessRecord()
        {
            SavedSearchProperties properties = new SavedSearchProperties()
            {
                Category    = this.Category,
                DisplayName = this.DisplayName,
                Query       = this.Query,
                Version     = this.Version,
                Tags        = new List <Tag>()
                {
                    new Tag()
                    {
                        Name = "Group", Value = "Computer"
                    }
                }
            };

            if (!SearchCommandHelper.IsListOfComputers(this.Query))
            {
                throw new PSArgumentException("Query is not a list of computers. Please use aggregations such as: distinct Computer or measure count() by Computer.");
            }

            WriteObject(OperationalInsightsClient.CreateOrUpdateSavedSearch(ResourceGroupName, WorkspaceName, SavedSearchId, properties, Force, ConfirmAction), true);
        }
Exemplo n.º 5
0
 protected override void ProcessRecord()
 {
     WriteObject(OperationalInsightsClient.CreateOrUpdateSavedSearch(ResourceGroupName, WorkspaceName, SavedSearchId, DisplayName, Category, Query, Version, true, ConfirmAction, ETag), true);
 }