public override void ExecuteCmdlet() { if (this.IsParameterBound(c => c.ResourceId)) { var resourceIdentifier = new StackEdgeStorageResourceIdentifier(this.ResourceId); this.ResourceGroupName = resourceIdentifier.ResourceGroupName; this.DeviceName = resourceIdentifier.DeviceName; this.EdgeStorageAccountName = resourceIdentifier.EdgeStorageAccountName; this.Name = resourceIdentifier.Name; } if (this.IsParameterBound(c => this.InputObject)) { this.ResourceGroupName = this.InputObject.ResourceGroupName; this.DeviceName = this.InputObject.DeviceName; this.EdgeStorageAccountName = this.InputObject.EdgeStorageAccountName; this.Name = this.InputObject.Name; } if (this.ShouldProcess(this.Name, "Invoking Action")) { var refreshed = RefreshContainer(); if (this.PassThru.IsPresent) { WriteObject(refreshed); } } }
public override void ExecuteCmdlet() { if (this.IsParameterBound(c => c.ResourceId)) { var resourceIdentifier = new StackEdgeStorageResourceIdentifier(this.ResourceId); this.ResourceGroupName = resourceIdentifier.ResourceGroupName; this.DeviceName = resourceIdentifier.DeviceName; this.EdgeStorageAccountName = resourceIdentifier.EdgeStorageAccountName; this.Name = resourceIdentifier.ResourceName; } if (this.IsParameterBound(c => c.InputObject)) { this.ResourceGroupName = this.InputObject.ResourceGroupName; this.DeviceName = this.InputObject.DeviceName; this.EdgeStorageAccountName = this.InputObject.EdgeStorageAccountName; this.Name = this.InputObject.Name; } if (this.ShouldProcess(this.Name, string.Format("Removing '{0}' in device '{1}' with name '{2}'.", HelpMessageEdgeStorageContainer.ObjectName, this.DeviceName, this.Name))) { var removed = Remove(); if (this.PassThru.IsPresent) { WriteObject(removed); } } }
public PSStackEdgeStorageContainer(Container container) { this.EdgeStorageContainer = container ?? throw new ArgumentNullException(nameof(container)); this.Id = container.Id; var resourceIdentifier = new StackEdgeStorageResourceIdentifier(container.Id); this.ResourceGroupName = resourceIdentifier.ResourceGroupName; this.DeviceName = resourceIdentifier.DeviceName; this.EdgeStorageAccountName = resourceIdentifier.EdgeStorageAccountName; this.Name = resourceIdentifier.Name; }
public override void ExecuteCmdlet() { if (this.IsParameterBound(c => c.ResourceId)) { var resourceIdentifier = new StackEdgeStorageResourceIdentifier(this.ResourceId); this.ResourceGroupName = resourceIdentifier.ResourceGroupName; this.DeviceName = resourceIdentifier.DeviceName; this.EdgeStorageAccountName = resourceIdentifier.EdgeStorageAccountName; this.Name = resourceIdentifier.Name; } if (this.IsParameterBound(c => this.EdgeStorageAccountObject)) { this.ResourceGroupName = this.EdgeStorageAccountObject.ResourceGroupName; this.DeviceName = this.EdgeStorageAccountObject.DeviceName; this.EdgeStorageAccountName = this.EdgeStorageAccountObject.Name; } var results = ListPSResource(); WriteObject(results, true); }