|
| 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 | +.Synopsis |
| 17 | +Get an instance of update run using the ID. |
| 18 | +.Description |
| 19 | +Get an instance of update run using the ID. |
| 20 | +.Example |
| 21 | +To view examples, please use the -Online parameter with Get-Help or navigate to: https://docs.microsoft.com/en-us/powershell/module/azs.update.admin/get-azsupdaterun |
| 22 | +.Inputs |
| 23 | +Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Models.IUpdateAdminIdentity |
| 24 | +.Outputs |
| 25 | +Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Models.Api20160501.IUpdateRun |
| 26 | +.Notes |
| 27 | +COMPLEX PARAMETER PROPERTIES |
| 28 | +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. |
| 29 | +
|
| 30 | +INPUTOBJECT <IUpdateAdminIdentity>: Identity Parameter |
| 31 | + [Id <String>]: Resource identity path |
| 32 | + [ResourceGroupName <String>]: Resource group name. |
| 33 | + [RunName <String>]: Update run identifier. |
| 34 | + [SubscriptionId <String>]: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
| 35 | + [UpdateLocation <String>]: The name of the update location. |
| 36 | + [UpdateName <String>]: Name of the update. |
| 37 | +.Link |
| 38 | +https://docs.microsoft.com/en-us/powershell/module/azs.update.admin/get-azsupdaterun |
| 39 | +#> |
| 40 | +function Get-AzsUpdateRun { |
| 41 | +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Models.Api20160501.IUpdateRun])] |
| 42 | +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] |
| 43 | +param( |
| 44 | + [Parameter(ParameterSetName='Get')] |
| 45 | + [Parameter(ParameterSetName='List')] |
| 46 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Path')] |
| 47 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Runtime.DefaultInfo(Script='(Get-AzLocation)[0].Location')] |
| 48 | + [System.String] |
| 49 | + # The name of the update location. |
| 50 | + ${Location}, |
| 51 | + |
| 52 | + [Parameter(ParameterSetName='Get', Mandatory)] |
| 53 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Path')] |
| 54 | + [System.String] |
| 55 | + # Update run identifier. |
| 56 | + ${Name}, |
| 57 | + |
| 58 | + [Parameter(ParameterSetName='Get')] |
| 59 | + [Parameter(ParameterSetName='List')] |
| 60 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Path')] |
| 61 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Location)')] |
| 62 | + [System.String] |
| 63 | + # Resource group name. |
| 64 | + ${ResourceGroupName}, |
| 65 | + |
| 66 | + [Parameter(ParameterSetName='Get')] |
| 67 | + [Parameter(ParameterSetName='List')] |
| 68 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Path')] |
| 69 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] |
| 70 | + [System.String[]] |
| 71 | + # Subscription credentials which uniquely identify Microsoft Azure subscription. |
| 72 | + # The subscription ID forms part of the URI for every service call. |
| 73 | + ${SubscriptionId}, |
| 74 | + |
| 75 | + [Parameter(ParameterSetName='Get', Mandatory)] |
| 76 | + [Parameter(ParameterSetName='List', Mandatory)] |
| 77 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Path')] |
| 78 | + [System.String] |
| 79 | + # Name of the update. |
| 80 | + ${UpdateName}, |
| 81 | + |
| 82 | + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] |
| 83 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Path')] |
| 84 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Models.IUpdateAdminIdentity] |
| 85 | + # Identity Parameter |
| 86 | + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. |
| 87 | + ${InputObject}, |
| 88 | + |
| 89 | + [Parameter()] |
| 90 | + [Alias('AzureRMContext', 'AzureCredential')] |
| 91 | + [ValidateNotNull()] |
| 92 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Azure')] |
| 93 | + [System.Management.Automation.PSObject] |
| 94 | + # The credentials, account, tenant, and subscription used for communication with Azure. |
| 95 | + ${DefaultProfile}, |
| 96 | + |
| 97 | + [Parameter(DontShow)] |
| 98 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Runtime')] |
| 99 | + [System.Management.Automation.SwitchParameter] |
| 100 | + # Wait for .NET debugger to attach |
| 101 | + ${Break}, |
| 102 | + |
| 103 | + [Parameter(DontShow)] |
| 104 | + [ValidateNotNull()] |
| 105 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Runtime')] |
| 106 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Runtime.SendAsyncStep[]] |
| 107 | + # SendAsync Pipeline Steps to be appended to the front of the pipeline |
| 108 | + ${HttpPipelineAppend}, |
| 109 | + |
| 110 | + [Parameter(DontShow)] |
| 111 | + [ValidateNotNull()] |
| 112 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Runtime')] |
| 113 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Runtime.SendAsyncStep[]] |
| 114 | + # SendAsync Pipeline Steps to be prepended to the front of the pipeline |
| 115 | + ${HttpPipelinePrepend}, |
| 116 | + |
| 117 | + [Parameter(DontShow)] |
| 118 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Runtime')] |
| 119 | + [System.Uri] |
| 120 | + # The URI for the proxy server to use |
| 121 | + ${Proxy}, |
| 122 | + |
| 123 | + [Parameter(DontShow)] |
| 124 | + [ValidateNotNull()] |
| 125 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Runtime')] |
| 126 | + [System.Management.Automation.PSCredential] |
| 127 | + # Credentials for a proxy server to use for the remote call |
| 128 | + ${ProxyCredential}, |
| 129 | + |
| 130 | + [Parameter(DontShow)] |
| 131 | + [Microsoft.Azure.PowerShell.Cmdlets.UpdateAdmin.Category('Runtime')] |
| 132 | + [System.Management.Automation.SwitchParameter] |
| 133 | + # Use the default credentials for the proxy |
| 134 | + ${ProxyUseDefaultCredentials} |
| 135 | +) |
| 136 | + |
| 137 | +process { |
| 138 | + # Generated SDK does not support {location}/{updateName} for nested resource updateName, so extract the {updateName} part here |
| 139 | + if ($PSBoundParameters.ContainsKey(('UpdateName'))) |
| 140 | + { |
| 141 | + $UpdateName = $PSBoundParameters['UpdateName'] |
| 142 | + if ($null -ne $UpdateName -and $UpdateName.Contains('/')) |
| 143 | + { |
| 144 | + $PSBoundParameters['UpdateName'] = $UpdateName.Split("/")[-1] |
| 145 | + } |
| 146 | + } |
| 147 | + |
| 148 | + # Generated SDK does not support {location}/{updateName}/{name} for nested resource name, so extract the {name} part here |
| 149 | + if ($PSBoundParameters.ContainsKey(('Name'))) |
| 150 | + { |
| 151 | + $Name = $PSBoundParameters['Name'] |
| 152 | + if ($null -ne $Name -and $Name.Contains('/')) |
| 153 | + { |
| 154 | + $PSBoundParameters['Name'] = $Name.Split("/")[-1] |
| 155 | + } |
| 156 | + } |
| 157 | + |
| 158 | + Azs.Update.Admin.internal\Get-AzsUpdateRun @PSBoundParameters |
| 159 | +} |
| 160 | + |
| 161 | +} |
0 commit comments