Exemple #1
0
        public override void ExecuteCmdlet()
        {
            PSStorageInsightParameters parameters = new PSStorageInsightParameters()
            {
                Name = Name,
                StorageAccountResourceId = StorageAccountResourceId,
                StorageAccountKey        = StorageAccountKey,
                Tables     = Tables?.ToList(),
                Containers = Containers?.ToList(),
                Etag       = ETag,
                Tags       = Tag
            };

            if (ParameterSetName == ByWorkspaceObject)
            {
                parameters.ResourceGroupName = Workspace.ResourceGroupName;
                parameters.WorkspaceName     = Workspace.Name;
            }
            else
            {
                parameters.ResourceGroupName = ResourceGroupName;
                parameters.WorkspaceName     = WorkspaceName;
            }
            if (ShouldProcess(Name, $"Create StorageInsight: {Name}, in workspace: {WorkspaceName}, resource group: {ResourceGroupName}"))
            {
                WriteObject(OperationalInsightsClient.CreatePSStorageInsight(parameters, ConfirmAction, Force.IsPresent));
            }
        }
Exemple #2
0
        public override void ExecuteCmdlet()
        {
            CreatePSStorageInsightParameters parameters = new CreatePSStorageInsightParameters()
            {
                Name = Name,
                StorageAccountResourceId = StorageAccountResourceId,
                StorageAccountKey        = StorageAccountKey,
                Tables = Tables != null?Tables.ToList() : null,
                             Containers                                         = Containers != null?Containers.ToList() : null,
                                                                  Force         = Force.IsPresent,
                                                                  ConfirmAction = ConfirmAction
            };

            if (ParameterSetName == ByWorkspaceObject)
            {
                parameters.ResourceGroupName = Workspace.ResourceGroupName;
                parameters.WorkspaceName     = Workspace.Name;
            }
            else
            {
                parameters.ResourceGroupName = ResourceGroupName;
                parameters.WorkspaceName     = WorkspaceName;
            }

            WriteObject(OperationalInsightsClient.CreatePSStorageInsight(parameters));
        }