|
| 1 | + |
| 2 | +# ---------------------------------------------------------------------------------- |
| 3 | +# |
| 4 | +# Copyright Microsoft Corporation |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# ---------------------------------------------------------------------------------- |
| 15 | + |
| 16 | +<# |
| 17 | +.Synopsis |
| 18 | +Clear a backup location. |
| 19 | +.Description |
| 20 | +Clear a backup location. |
| 21 | +.Example |
| 22 | +PS C:\> {{ Add code here }} |
| 23 | +
|
| 24 | +{{ Add output here }} |
| 25 | +.Example |
| 26 | +PS C:\> {{ Add code here }} |
| 27 | +
|
| 28 | +{{ Add output here }} |
| 29 | +
|
| 30 | +.Inputs |
| 31 | +Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Models.Api20210901.IBackupLocation |
| 32 | +.Outputs |
| 33 | +Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Models.Api20210901.IBackupLocation |
| 34 | +.Notes |
| 35 | +COMPLEX PARAMETER PROPERTIES |
| 36 | +
|
| 37 | +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. |
| 38 | +
|
| 39 | +.Link |
| 40 | +https://docs.microsoft.com/en-us/powershell/module/azs.backup.admin/clear-azsbackupconfiguration |
| 41 | +#> |
| 42 | +function Clear-AzsBackupConfiguration { |
| 43 | +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Models.Api20210901.IBackupLocation])] |
| 44 | +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] |
| 45 | +param( |
| 46 | + [Parameter()] |
| 47 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Path')] |
| 48 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Runtime.DefaultInfo(Script='(Get-AzLocation)[0].Location')] |
| 49 | + [System.String] |
| 50 | + # Name of the backup location. |
| 51 | + ${Location}, |
| 52 | + |
| 53 | + [Parameter()] |
| 54 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Path')] |
| 55 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Runtime.DefaultInfo(Script='"system.$((Get-AzLocation)[0].Location)"')] |
| 56 | + [System.String] |
| 57 | + # Name of the resource group. |
| 58 | + ${ResourceGroupName}, |
| 59 | + |
| 60 | + [Parameter()] |
| 61 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Path')] |
| 62 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] |
| 63 | + [System.String] |
| 64 | + # Subscription credentials that uniquely identify Microsoft Azure subscription. |
| 65 | + # The subscription ID forms part of the URI for every service call. |
| 66 | + ${SubscriptionId}, |
| 67 | + |
| 68 | + [Parameter()] |
| 69 | + [Alias('AzureRMContext', 'AzureCredential')] |
| 70 | + [ValidateNotNull()] |
| 71 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Azure')] |
| 72 | + [System.Management.Automation.PSObject] |
| 73 | + # The credentials, account, tenant, and subscription used for communication with Azure. |
| 74 | + ${DefaultProfile}, |
| 75 | + |
| 76 | + [Parameter()] |
| 77 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Runtime')] |
| 78 | + [System.Management.Automation.SwitchParameter] |
| 79 | + # Run the command as a job |
| 80 | + ${AsJob}, |
| 81 | + |
| 82 | + [Parameter(DontShow)] |
| 83 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Runtime')] |
| 84 | + [System.Management.Automation.SwitchParameter] |
| 85 | + # Wait for .NET debugger to attach |
| 86 | + ${Break}, |
| 87 | + |
| 88 | + [Parameter(DontShow)] |
| 89 | + [ValidateNotNull()] |
| 90 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Runtime')] |
| 91 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Runtime.SendAsyncStep[]] |
| 92 | + # SendAsync Pipeline Steps to be appended to the front of the pipeline |
| 93 | + ${HttpPipelineAppend}, |
| 94 | + |
| 95 | + [Parameter(DontShow)] |
| 96 | + [ValidateNotNull()] |
| 97 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Runtime')] |
| 98 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Runtime.SendAsyncStep[]] |
| 99 | + # SendAsync Pipeline Steps to be prepended to the front of the pipeline |
| 100 | + ${HttpPipelinePrepend}, |
| 101 | + |
| 102 | + [Parameter()] |
| 103 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Runtime')] |
| 104 | + [System.Management.Automation.SwitchParameter] |
| 105 | + # Run the command asynchronously |
| 106 | + ${NoWait}, |
| 107 | + |
| 108 | + [Parameter(DontShow)] |
| 109 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Runtime')] |
| 110 | + [System.Uri] |
| 111 | + # The URI for the proxy server to use |
| 112 | + ${Proxy}, |
| 113 | + |
| 114 | + [Parameter(DontShow)] |
| 115 | + [ValidateNotNull()] |
| 116 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Runtime')] |
| 117 | + [System.Management.Automation.PSCredential] |
| 118 | + # Credentials for a proxy server to use for the remote call |
| 119 | + ${ProxyCredential}, |
| 120 | + |
| 121 | + [Parameter(DontShow)] |
| 122 | + [Microsoft.Azure.PowerShell.Cmdlets.BackupAdmin.Category('Runtime')] |
| 123 | + [System.Management.Automation.SwitchParameter] |
| 124 | + # Use the default credentials for the proxy |
| 125 | + ${ProxyUseDefaultCredentials} |
| 126 | +) |
| 127 | + |
| 128 | +process { |
| 129 | + # Restrict the cmdlet to being a blank PUT operation to clear the backup configuration |
| 130 | + $PSBoundParameters.Add('Location1', $Location) |
| 131 | + $PSBoundParameters.Add('UserName', $null) |
| 132 | + |
| 133 | + Azs.Backup.Admin.internal\Clear-AzsBackupConfiguration @PSBoundParameters |
| 134 | +} |
| 135 | +} |
0 commit comments