public override void ExecuteCmdlet()
        {
            if (this.IsParameterBound(c => c.WorkspaceObject))
            {
                this.WorkspaceName = this.WorkspaceObject.Name;
            }

            if (this.IsParameterBound(c => c.InputObject))
            {
                this.WorkspaceName = this.InputObject.WorkspaceName;
                this.Name          = this.InputObject.Name;
            }

            ConfirmAction(
                Force.IsPresent,
                string.Format(Resources.RemoveSynapseManagedPrivateEndpoint, this.Name),
                string.Format(Resources.RemovingSynapseManagedPrivateEndpoint, this.Name, this.WorkspaceName),
                Name,
                () =>
            {
                SynapseManagedPrivateEndpointsClient.DeleteManagedPrivateEndpoint(this.Name, this.VirtualNetworkName);
                if (PassThru)
                {
                    WriteObject(true);
                }
            });
        }
Example #2
0
        public override void ExecuteCmdlet()
        {
            if (this.IsParameterBound(c => c.WorkspaceObject))
            {
                this.WorkspaceName = this.WorkspaceObject.Name;
            }

            if (this.ShouldProcess(this.WorkspaceName, String.Format(Resources.SettingSynapseManagedPrivateEndPoint, this.Name, this.WorkspaceName)))
            {
                string rawJsonContent = SynapseManagedPrivateEndpointsClient.ReadJsonFileContent(this.TryResolvePath(DefinitionFile));
                WriteObject(new PSManagedPrivateEndpointResource(SynapseManagedPrivateEndpointsClient.CreateManagedPrivateEndpoint(this.Name, rawJsonContent, this.VirtualNetworkName), this.WorkspaceName));
            }
        }
Example #3
0
 public override void ExecuteCmdlet()
 {
     if (this.IsParameterBound(c => c.WorkspaceObject))
     {
         this.WorkspaceName = this.WorkspaceObject.Name;
     }
     if (this.IsParameterBound(c => this.Name))
     {
         if (!string.IsNullOrEmpty(Name))
         {
             WriteObject(new PSManagedPrivateEndpointResource(SynapseManagedPrivateEndpointsClient.GetManagedPrivateEndpoint(this.Name, this.VirtualNetworkName), this.WorkspaceName));
         }
     }
     else
     {
         var privateEndpoints = SynapseManagedPrivateEndpointsClient.ListManagedPrivateEndpoints(this.VirtualNetworkName)
                                .Select(element => new PSManagedPrivateEndpointResource(element, this.WorkspaceName));
         WriteObject(privateEndpoints, true);
     }
 }