ConnectedMachine.Autorest/exports/ProxyCmdletDefinitions.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- <# .Synopsis Gets an Extension Metadata based on location, publisher, extensionType and version .Description Gets an Extension Metadata based on location, publisher, extensionType and version .Example Get-AzConnectedExtensionMetadata -ExtensionType 'CustomScriptExtension' -Location 'eastus2euap' -Publisher 'Microsoft.HybridCompute' .Example Get-AzConnectedExtensionMetadata -ExtensionType 'CustomScriptExtension' -Location 'eastus2euap' -Publisher 'Microsoft.HybridCompute' -Version '1.10.10' .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionValue .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/get-azconnectedextensionmetadata #> function Get-AzConnectedExtensionMetadata { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionValue])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The extensionType of the Extension being received. ${ExtensionType}, [Parameter(Mandatory)] [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The location of the Extension being received. ${Location}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The publisher of the Extension being received. ${Publisher}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Get', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The version of the Extension being received. ${Version}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Get = 'Az.ConnectedMachine.private\Get-AzConnectedExtensionMetadata_Get'; List = 'Az.ConnectedMachine.private\Get-AzConnectedExtensionMetadata_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to get the extension. .Description The operation to get the extension. .Example Get-AzConnectedMachineExtension -ResourceGroupName contoso-connected-machines -MachineName winwestus2_2 .Example Get-AzConnectedMachineExtension -ResourceGroupName contoso-connected-machines -MachineName winwestus2_2 -Name dsc .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/get-azconnectedmachineextension #> function Get-AzConnectedMachineExtension { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine containing the extension. ${MachineName}, [Parameter(Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine extension. ${Name}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Query')] [System.String] # The expand expression to apply on the operation. ${Expand}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Get = 'Az.ConnectedMachine.private\Get-AzConnectedMachineExtension_Get'; List = 'Az.ConnectedMachine.private\Get-AzConnectedMachineExtension_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to get a run command. .Description The operation to get a run command. .Example Get-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -MachineName "testmachine" .Example Get-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand2" -MachineName "testmachine" .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/get-azconnectedmachineruncommand #> function Get-AzConnectedMachineRunCommand { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${MachineName}, [Parameter(Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the run command. ${RunCommandName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Query')] [System.String] # The expand expression to apply on the operation. ${Expand}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Get = 'Az.ConnectedMachine.private\Get-AzConnectedMachineRunCommand_Get'; List = 'Az.ConnectedMachine.private\Get-AzConnectedMachineRunCommand_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Retrieves information about the model view or the instance view of a hybrid machine. .Description Retrieves information about the model view or the instance view of a hybrid machine. .Example Get-AzConnectedMachine -SubscriptionId 67379433-5e19-4702-b39a-c0a03ca8d20c .Example Get-AzConnectedMachine -ResourceGroupName contoso-connected-machines .Example Get-AzConnectedMachine -ResourceGroupName contoso-connected-machines -Name winwestus2_1 .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/get-azconnectedmachine #> function Get-AzConnectedMachine { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] [Alias('MachineName')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${Name}, [Parameter(ParameterSetName='Get', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Get')] [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Query')] [System.String] # The expand expression to apply on the operation. ${Expand}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Get = 'Az.ConnectedMachine.private\Get-AzConnectedMachine_Get'; List = 'Az.ConnectedMachine.private\Get-AzConnectedMachine_List'; List1 = 'Az.ConnectedMachine.private\Get-AzConnectedMachine_List1'; } if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Returns a Azure Arc PrivateLinkScope. .Description Returns a Azure Arc PrivateLinkScope. .Example Get-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName .Example Get-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName -ScopeName $scopeName .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/get-azconnectedprivatelinkscope #> function Get-AzConnectedPrivateLinkScope { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] [Parameter(ParameterSetName='List1', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the Azure Arc PrivateLinkScope resource. ${ScopeName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Get = 'Az.ConnectedMachine.private\Get-AzConnectedPrivateLinkScope_Get'; List = 'Az.ConnectedMachine.private\Get-AzConnectedPrivateLinkScope_List'; List1 = 'Az.ConnectedMachine.private\Get-AzConnectedPrivateLinkScope_List1'; } if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to install patches on a hybrid machine identity in Azure. .Description The operation to install patches on a hybrid machine identity in Azure. .Example Install-AzConnectedMachinePatch -ResourceGroupName az-sdk-test -Name testMachine -MaximumDuration 'PT4H' -RebootSetting 'IfRequired' -WindowParameterClassificationsToInclude 'Critical' .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesResult .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/install-azconnectedmachinepatch #> function Install-AzConnectedMachinePatch { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineInstallPatchesResult])] [CmdletBinding(DefaultParameterSetName='InstallExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='InstallExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${Name}, [Parameter(ParameterSetName='InstallExpanded', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. ${ResourceGroupName}, [Parameter(ParameterSetName='InstallExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='InstallViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the maximum amount of time that the operation will run. # It must be an ISO 8601-compliant duration string such as PT4H (4 hours) ${MaximumDuration}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("IfRequired", "Never", "Always")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Defines when it is acceptable to reboot a VM during a software update operation. ${RebootSetting}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Critical", "Security", "Other")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String[]] # The update classifications to select when installing patches for Linux. ${LinuxParameterClassificationsToInclude}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String[]] # packages to exclude in the patch operation. # Format: packageName_packageVersion ${LinuxParameterPackageNameMasksToExclude}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String[]] # packages to include in the patch operation. # Format: packageName_packageVersion ${LinuxParameterPackageNameMasksToInclude}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Critical", "Security", "UpdateRollUp", "FeaturePack", "ServicePack", "Definition", "Tools", "Updates")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String[]] # The update classifications to select when installing patches for Windows. ${WindowParameterClassificationsToInclude}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. ${WindowParameterExcludeKbsRequiringReboot}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String[]] # Kbs to exclude in the patch operation ${WindowParameterKbNumbersToExclude}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String[]] # Kbs to include in the patch operation ${WindowParameterKbNumbersToInclude}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.DateTime] # This is used to install patches that were published on or before this given max published date. ${WindowParameterMaxPatchPublishDate}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ InstallExpanded = 'Az.ConnectedMachine.private\Install-AzConnectedMachinePatch_InstallExpanded'; InstallViaIdentityExpanded = 'Az.ConnectedMachine.private\Install-AzConnectedMachinePatch_InstallViaIdentityExpanded'; } if (('InstallExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to assess patches on a hybrid machine identity in Azure. .Description The operation to assess patches on a hybrid machine identity in Azure. .Example Invoke-AzConnectedAssessMachinePatch -Name testMachine -ResourceGroupName az-sdk-test .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineAssessPatchesResult .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/invoke-azconnectedassessmachinepatch #> function Invoke-AzConnectedAssessMachinePatch { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineAssessPatchesResult])] [CmdletBinding(DefaultParameterSetName='Assess', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Assess', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${Name}, [Parameter(ParameterSetName='Assess', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. ${ResourceGroupName}, [Parameter(ParameterSetName='Assess')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='AssessViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Assess = 'Az.ConnectedMachine.private\Invoke-AzConnectedAssessMachinePatch_Assess'; AssessViaIdentity = 'Az.ConnectedMachine.private\Invoke-AzConnectedAssessMachinePatch_AssessViaIdentity'; } if (('Assess') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to Create the extension. .Description The operation to Create the extension. .Example $Settings = @{ "commandToExecute" = "powershell.exe -c Get-Process" } New-AzConnectedMachineExtension -Name custom -ResourceGroupName ContosoTest -MachineName win-eastus1 -Location eastus -Publisher "Microsoft.Compute" -TypeHandlerVersion 1.10 -Settings $Settings -ExtensionType CustomScriptExtension .Example $otherExtension = Get-AzConnectedMachineExtension -Name custom -ResourceGroupName ContosoTest -MachineName other $otherExtension | New-AzConnectedMachineExtension -Name custom -ResourceGroupName ContosoTest -MachineName important .Example $identity = [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ConnectedMachineIdentity]@{ Id = "/subscriptions/$($SubscriptionId)/resourceGroups/$($ResourceGroupName)/providers/Microsoft.HybridCompute/machines/$MachineName/extensions/$ExtensionName" } $Settings = @{ "commandToExecute" = "powershell.exe -c Get-Process" } $identity | New-AzConnectedMachineExtension -Location eastus -Publisher "Microsoft.Compute" -TypeHandlerVersion 1.10 -Settings $Settings -ExtensionType CustomScriptExtension .Example $ext = Get-AzConnectedMachineExtension -Name custom -ResourceGroupName ContosoTest -MachineName other $ext | New-AzConnectedMachineExtension -ExtensionParameter $ext .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension .Notes COMPLEX PARAMETER PROPERTIES 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. EXTENSIONPARAMETER <IMachineExtension>: Describes a Machine Extension. Location <String>: The geo-location where the resource lives [Tags <ITrackedResourceTags>]: Resource tags. [(Any) <String>]: This indicates any property can be added to this object. [AutoUpgradeMinorVersion <Boolean?>]: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. [EnableAutomaticUpgrade <Boolean?>]: Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. [ForceUpdateTag <String>]: How the extension handler should be forced to update even if the extension configuration has not changed. [InstanceViewName <String>]: The machine extension name. [InstanceViewType <String>]: Specifies the type of the extension; an example is "CustomScriptExtension". [InstanceViewTypeHandlerVersion <String>]: Specifies the version of the script handler. [MachineExtensionType <String>]: Specifies the type of the extension; an example is "CustomScriptExtension". [ProtectedSetting <IMachineExtensionPropertiesProtectedSettings>]: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. [(Any) <Object>]: This indicates any property can be added to this object. [Publisher <String>]: The name of the extension handler publisher. [Setting <IMachineExtensionPropertiesSettings>]: Json formatted public settings for the extension. [(Any) <Object>]: This indicates any property can be added to this object. [StatusCode <String>]: The status code. [StatusDisplayStatus <String>]: The short localizable label for the status. [StatusLevel <String>]: The level code. [StatusMessage <String>]: The detailed status message, including for alerts and error messages. [StatusTime <DateTime?>]: The time of the status. [TypeHandlerVersion <String>]: Specifies the version of the script handler. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. MACHINEINPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedmachineextension #> function New-AzConnectedMachineExtension { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine where the extension should be created or updated. ${MachineName}, [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine extension. ${Name}, [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${MachineInputObject}, [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension] # Describes a Machine Extension. ${ExtensionParameter}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory)] [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether the extension should use a newer minor version if one is available at deployment time. # Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. ${AutoUpgradeMinorVersion}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. ${EnableAutomaticUpgrade}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the type of the extension; an example is "CustomScriptExtension". ${ExtensionType}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # How the extension handler should be forced to update even if the extension configuration has not changed. ${ForceRerun}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The machine extension name. ${InstanceViewName}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the type of the extension; an example is "CustomScriptExtension". ${InstanceViewType}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the version of the script handler. ${InstanceViewTypeHandlerVersion}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Alias('ProtectedSettings')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionPropertiesProtectedSettings]))] [System.Collections.Hashtable] # The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. ${ProtectedSetting}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The name of the extension handler publisher. ${Publisher}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Alias('Settings')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionPropertiesSettings]))] [System.Collections.Hashtable] # Json formatted public settings for the extension. ${Setting}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The status code. ${StatusCode}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The short localizable label for the status. ${StatusDisplayStatus}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Info", "Warning", "Error")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The level code. ${StatusLevel}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The detailed status message, including for alerts and error messages. ${StatusMessage}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.DateTime] # The time of the status. ${StatusTime}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the version of the script handler. ${TypeHandlerVersion}, [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Create operation ${JsonFilePath}, [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Create operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Create = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_Create'; CreateExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateExpanded'; CreateViaIdentity = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateViaIdentityExpanded'; CreateViaIdentityMachine = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateViaIdentityMachine'; CreateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateViaIdentityMachineExpanded'; CreateViaJsonFilePath = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateViaJsonFilePath'; CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedMachineExtension_CreateViaJsonString'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to Create a run command. .Description The operation to Create a run command. .Example New-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -Location "eastus2euap" -SourceScript "Write-Host Hello World!" -RunCommandName "myRunCommand3" -MachineName "testmachine" -SubscriptionId "e6fe6705-4c9c-4b54-81d2-e455780e20b8" .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. MACHINEINPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. PARAMETER <IRunCommandInputParameter[]>: The parameters used by the script. Name <String>: The run command parameter name. Value <String>: The run command parameter value. PROTECTEDPARAMETER <IRunCommandInputParameter[]>: The parameters used by the script. Name <String>: The run command parameter name. Value <String>: The run command parameter value. RUNCOMMANDPROPERTY <IMachineRunCommand>: Describes a Run Command Location <String>: The geo-location where the resource lives [Tags <ITrackedResourceTags>]: Resource tags. [(Any) <String>]: This indicates any property can be added to this object. [AsyncExecution <Boolean?>]: Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. [ErrorBlobManagedIdentityClientId <String>]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. [ErrorBlobManagedIdentityObjectId <String>]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. [ErrorBlobUri <String>]: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. [OutputBlobManagedIdentityClientId <String>]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. [OutputBlobManagedIdentityObjectId <String>]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. [OutputBlobUri <String>]: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. [Parameter <List<IRunCommandInputParameter>>]: The parameters used by the script. Name <String>: The run command parameter name. Value <String>: The run command parameter value. [ProtectedParameter <List<IRunCommandInputParameter>>]: The parameters used by the script. [RunAsPassword <String>]: Specifies the user account password on the machine when executing the run command. [RunAsUser <String>]: Specifies the user account on the machine when executing the run command. [ScriptUriManagedIdentityClientId <String>]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. [ScriptUriManagedIdentityObjectId <String>]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. [SourceCommandId <String>]: Specifies the commandId of predefined built-in script. [SourceScript <String>]: Specifies the script content to be executed on the machine. [SourceScriptUri <String>]: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. [TimeoutInSecond <Int32?>]: The timeout in seconds to execute the run command. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedmachineruncommand #> function New-AzConnectedMachineRunCommand { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${MachineName}, [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the run command. ${RunCommandName}, [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Parameter(ParameterSetName='CreateViaJsonString')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${MachineInputObject}, [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand] # Describes a Run Command ${RunCommandProperty}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded', Mandatory)] [Parameter(ParameterSetName='ScriptLocalPath', Mandatory)] [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Optional. # If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. ${AsyncExecution}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Client Id (GUID value) of the user-assigned managed identity. # ObjectId should not be used if this is provided. ${ErrorBlobManagedIdentityClientId}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Object Id (GUID value) of the user-assigned managed identity. # ClientId should not be used if this is provided. ${ErrorBlobManagedIdentityObjectId}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the Azure storage blob where script error stream will be uploaded. # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. # Refer errorBlobManagedIdentity parameter. ${ErrorBlobUri}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Client Id (GUID value) of the user-assigned managed identity. # ObjectId should not be used if this is provided. ${OutputBlobManagedIdentityClientId}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Object Id (GUID value) of the user-assigned managed identity. # ClientId should not be used if this is provided. ${OutputBlobManagedIdentityObjectId}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the Azure storage blob where script output stream will be uploaded. # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. # Refer outputBlobManagedIdentity parameter. ${OutputBlobUri}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] # The parameters used by the script. ${Parameter}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] # The parameters used by the script. ${ProtectedParameter}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the user account password on the machine when executing the run command. ${RunAsPassword}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the user account on the machine when executing the run command. ${RunAsUser}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Client Id (GUID value) of the user-assigned managed identity. # ObjectId should not be used if this is provided. ${ScriptUriManagedIdentityClientId}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Object Id (GUID value) of the user-assigned managed identity. # ClientId should not be used if this is provided. ${ScriptUriManagedIdentityObjectId}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the commandId of predefined built-in script. ${SourceCommandId}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the script content to be executed on the machine. ${SourceScript}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the script download location. # It can be either SAS URI of an Azure storage blob with read access or public URI. ${SourceScriptUri}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Parameter(ParameterSetName='CreateViaIdentityMachineExpanded')] [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Int32] # The timeout in seconds to execute the run command. ${TimeoutInSecond}, [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Create operation ${JsonFilePath}, [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Create operation ${JsonString}, [Parameter(ParameterSetName='ScriptLocalPath')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] ${ScriptLocalPath}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Create = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_Create'; CreateExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateExpanded'; CreateViaIdentity = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityExpanded'; CreateViaIdentityMachine = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityMachine'; CreateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaIdentityMachineExpanded'; CreateViaJsonFilePath = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaJsonFilePath'; CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedMachineRunCommand_CreateViaJsonString'; ScriptLocalPath = 'Az.ConnectedMachine.custom\New-AzConnectedMachineRunCommand_ScriptLocalPath'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString', 'ScriptLocalPath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Create (or Create) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Description Create (or Create) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example New-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName -ScopeName $scopeName -PublicNetworkAccess "Enabled" -Location $location .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. PARAMETER <IHybridComputePrivateLinkScope>: An Azure Arc PrivateLinkScope definition. Location <String>: Resource location [Tags <IPrivateLinkScopesResourceTags>]: Resource tags [(Any) <String>]: This indicates any property can be added to this object. [PublicNetworkAccess <String>]: Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/new-azconnectedprivatelinkscope #> function New-AzConnectedPrivateLinkScope { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Create', Mandatory)] [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the Azure Arc PrivateLinkScope resource. ${ScopeName}, [Parameter(ParameterSetName='Create')] [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaJsonFilePath')] [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='Create', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='CreateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope] # An Azure Arc PrivateLinkScope definition. ${Parameter}, [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Resource location ${Location}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. ${PublicNetworkAccess}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateLinkScopesResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Create operation ${JsonFilePath}, [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Create operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Create = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_Create'; CreateExpanded = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateExpanded'; CreateViaIdentity = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaIdentityExpanded'; CreateViaJsonFilePath = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaJsonFilePath'; CreateViaJsonString = 'Az.ConnectedMachine.private\New-AzConnectedPrivateLinkScope_CreateViaJsonString'; } if (('Create', 'CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to delete the extension. .Description The operation to delete the extension. .Example Remove-AzConnectedMachineExtension -MachineName myMachine -ResourceGroupName myRG -Name custom .Example Get-AzConnectedMachineExtension -ResourceGroupName contoso-connected-machines -MachineName myMachine | Remove-AzConnectedMachineExtension .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. MACHINEINPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachineextension #> function Remove-AzConnectedMachineExtension { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine where the extension should be deleted. ${MachineName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine extension. ${Name}, [Parameter(ParameterSetName='Delete', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${MachineInputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_Delete'; DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_DeleteViaIdentity'; DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineExtension_DeleteViaIdentityMachine'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to delete a run command. .Description The operation to delete a run command. .Example Remove-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand3" -MachineName "testmachine" .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. MACHINEINPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachineruncommand #> function Remove-AzConnectedMachineRunCommand { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${MachineName}, [Parameter(ParameterSetName='Delete', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the run command. ${RunCommandName}, [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='DeleteViaIdentityMachine', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${MachineInputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_Delete'; DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_DeleteViaIdentity'; DeleteViaIdentityMachine = 'Az.ConnectedMachine.private\Remove-AzConnectedMachineRunCommand_DeleteViaIdentityMachine'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to delete a hybrid machine. .Description The operation to delete a hybrid machine. .Example Remove-AzConnectedMachine -Name myMachine -ResourceGroupName myRG .Example Get-AzConnectedMachine -ResourceGroupName contoso-connected-machines | Remove-AzConnectedMachine .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedmachine #> function Remove-AzConnectedMachine { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] [Alias('MachineName')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${Name}, [Parameter(ParameterSetName='Delete', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedMachine_Delete'; DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedMachine_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Deletes a Azure Arc PrivateLinkScope. .Description Deletes a Azure Arc PrivateLinkScope. .Example Remove-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName -ScopeName $scopeName .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/remove-azconnectedprivatelinkscope #> function Remove-AzConnectedPrivateLinkScope { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the Azure Arc PrivateLinkScope resource. ${ScopeName}, [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Delete = 'Az.ConnectedMachine.private\Remove-AzConnectedPrivateLinkScope_Delete'; DeleteViaIdentity = 'Az.ConnectedMachine.private\Remove-AzConnectedPrivateLinkScope_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to Update the extension. .Description The operation to Update the extension. .Example $Settings = @{ "commandToExecute" = "powershell.exe -c Get-Process" } Set-AzConnectedMachineExtension -Name custom -ResourceGroupName ContosoTest -MachineName win-eastus1 -Location eastus -Publisher "Microsoft.Compute" -TypeHandlerVersion 1.10 -Settings $Settings -ExtensionType CustomScriptExtension .Example $otherExtension = Get-AzConnectedMachineExtension -Name custom -ResourceGroupName ContosoTest -MachineName other $otherExtension | Set-AzConnectedMachineExtension -Name custom -ResourceGroupName ContosoTest -MachineName important .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension .Notes COMPLEX PARAMETER PROPERTIES 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. EXTENSIONPARAMETER <IMachineExtension>: Describes a Machine Extension. Location <String>: The geo-location where the resource lives [Tags <ITrackedResourceTags>]: Resource tags. [(Any) <String>]: This indicates any property can be added to this object. [AutoUpgradeMinorVersion <Boolean?>]: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. [EnableAutomaticUpgrade <Boolean?>]: Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. [ForceUpdateTag <String>]: How the extension handler should be forced to update even if the extension configuration has not changed. [InstanceViewName <String>]: The machine extension name. [InstanceViewType <String>]: Specifies the type of the extension; an example is "CustomScriptExtension". [InstanceViewTypeHandlerVersion <String>]: Specifies the version of the script handler. [MachineExtensionType <String>]: Specifies the type of the extension; an example is "CustomScriptExtension". [ProtectedSetting <IMachineExtensionPropertiesProtectedSettings>]: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. [(Any) <Object>]: This indicates any property can be added to this object. [Publisher <String>]: The name of the extension handler publisher. [Setting <IMachineExtensionPropertiesSettings>]: Json formatted public settings for the extension. [(Any) <Object>]: This indicates any property can be added to this object. [StatusCode <String>]: The status code. [StatusDisplayStatus <String>]: The short localizable label for the status. [StatusLevel <String>]: The level code. [StatusMessage <String>]: The detailed status message, including for alerts and error messages. [StatusTime <DateTime?>]: The time of the status. [TypeHandlerVersion <String>]: Specifies the version of the script handler. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/set-azconnectedmachineextension #> function Set-AzConnectedMachineExtension { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine where the extension should be created or updated. ${MachineName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine extension. ${Name}, [Parameter(Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension] # Describes a Machine Extension. ${ExtensionParameter}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether the extension should use a newer minor version if one is available at deployment time. # Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. ${AutoUpgradeMinorVersion}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. ${EnableAutomaticUpgrade}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the type of the extension; an example is "CustomScriptExtension". ${ExtensionType}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # How the extension handler should be forced to update even if the extension configuration has not changed. ${ForceRerun}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The machine extension name. ${InstanceViewName}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the type of the extension; an example is "CustomScriptExtension". ${InstanceViewType}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the version of the script handler. ${InstanceViewTypeHandlerVersion}, [Parameter(ParameterSetName='UpdateExpanded')] [Alias('ProtectedSettings')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionPropertiesProtectedSettings]))] [System.Collections.Hashtable] # The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. ${ProtectedSetting}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The name of the extension handler publisher. ${Publisher}, [Parameter(ParameterSetName='UpdateExpanded')] [Alias('Settings')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionPropertiesSettings]))] [System.Collections.Hashtable] # Json formatted public settings for the extension. ${Setting}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The status code. ${StatusCode}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The short localizable label for the status. ${StatusDisplayStatus}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Info", "Warning", "Error")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The level code. ${StatusLevel}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The detailed status message, including for alerts and error messages. ${StatusMessage}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.DateTime] # The time of the status. ${StatusTime}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the version of the script handler. ${TypeHandlerVersion}, [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Update operation ${JsonFilePath}, [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Update operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Update = 'Az.ConnectedMachine.private\Set-AzConnectedMachineExtension_Update'; UpdateExpanded = 'Az.ConnectedMachine.private\Set-AzConnectedMachineExtension_UpdateExpanded'; UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Set-AzConnectedMachineExtension_UpdateViaJsonFilePath'; UpdateViaJsonString = 'Az.ConnectedMachine.private\Set-AzConnectedMachineExtension_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Update (or Update) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Description Update (or Update) a Azure Arc PrivateLinkScope. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. .Example Set-AzConnectedPrivateLinkScope -ResourceGroupName $resourceGroupName -ScopeName $scopeName -PublicNetworkAccess "Disabled" -Tag $tags -Location $location .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .Notes COMPLEX PARAMETER PROPERTIES 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. PARAMETER <IHybridComputePrivateLinkScope>: An Azure Arc PrivateLinkScope definition. Location <String>: Resource location [Tags <IPrivateLinkScopesResourceTags>]: Resource tags [(Any) <String>]: This indicates any property can be added to this object. [PublicNetworkAccess <String>]: Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/set-azconnectedprivatelinkscope #> function Set-AzConnectedPrivateLinkScope { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the Azure Arc PrivateLinkScope resource. ${ScopeName}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope] # An Azure Arc PrivateLinkScope definition. ${Parameter}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [ArgumentCompleter({Get-AzLocation | Where-Object Providers -Contains "Microsoft.HybridCompute" | Select-Object -ExpandProperty Location})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Resource location ${Location}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. ${PublicNetworkAccess}, [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IPrivateLinkScopesResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Update operation ${JsonFilePath}, [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Update operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Update = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_Update'; UpdateExpanded = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateExpanded'; UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateViaJsonFilePath'; UpdateViaJsonString = 'Az.ConnectedMachine.private\Set-AzConnectedPrivateLinkScope_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to Upgrade Machine Extensions. .Description The operation to Upgrade Machine Extensions. .Example $target = @{"Microsoft.Compute.CustomScriptExtension" = @{"targetVersion"="1.10.12"}} Update-AzConnectedExtension -ResourceGroupName $env.ResourceGroupName -MachineName $machineName -ExtensionTarget $target .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpgrade .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES 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. EXTENSIONUPGRADEPARAMETER <IMachineExtensionUpgrade>: Describes the Machine Extension Upgrade Properties. [ExtensionTarget <IExtensionTarget>]: Describes the Extension Target Properties. [(Any) <IExtensionTargetProperties>]: This indicates any property can be added to this object. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedextension #> function Update-AzConnectedExtension { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='UpgradeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Upgrade', Mandatory)] [Parameter(ParameterSetName='UpgradeExpanded', Mandatory)] [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${MachineName}, [Parameter(ParameterSetName='Upgrade', Mandatory)] [Parameter(ParameterSetName='UpgradeExpanded', Mandatory)] [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Upgrade')] [Parameter(ParameterSetName='UpgradeExpanded')] [Parameter(ParameterSetName='UpgradeViaJsonFilePath')] [Parameter(ParameterSetName='UpgradeViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='UpgradeViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpgradeViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='Upgrade', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpgradeViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpgrade] # Describes the Machine Extension Upgrade Properties. ${ExtensionUpgradeParameter}, [Parameter(ParameterSetName='UpgradeExpanded')] [Parameter(ParameterSetName='UpgradeViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IExtensionTarget]))] [System.Collections.Hashtable] # Describes the Extension Target Properties. ${ExtensionTarget}, [Parameter(ParameterSetName='UpgradeViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Upgrade operation ${JsonFilePath}, [Parameter(ParameterSetName='UpgradeViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Upgrade operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Upgrade = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_Upgrade'; UpgradeExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeExpanded'; UpgradeViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaIdentity'; UpgradeViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaIdentityExpanded'; UpgradeViaJsonFilePath = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaJsonFilePath'; UpgradeViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedExtension_UpgradeViaJsonString'; } if (('Upgrade', 'UpgradeExpanded', 'UpgradeViaJsonFilePath', 'UpgradeViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to Update the extension. .Description The operation to Update the extension. .Example $splat = @{ ResourceGroupName = "connectedMachines" MachineName = "linux-eastus1_1" Name = "customScript" Settings = @{ commandToExecute = "ls -l" } } Update-AzConnectedMachineExtension @splat .Example $extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript $extToUpdate | Update-AzConnectedMachineExtension -Settings @{ commandToExecute = "ls -l" } .Example $extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript # Update the settings on the object that will be used via the pipeline $extToUpdate.Setting.commandToExecute = "ls -l" $splat = @{ ResourceGroupName = "connectedMachines" MachineName = "linux-eastus1_1" Name = "customScript" } $extToUpdate | Update-AzConnectedMachineExtension @splat .Example $extToUpdate = Get-AzConnectedMachineExtension -ResourceGroupName connectedMachines -MachineName linux-eastus1_1 -Name customScript # Update the settings on the object that will be used via the pipeline $extToUpdate.Setting.commandToExecute = "ls -l" $extToUpdate | Update-AzConnectedMachineExtension -ExtensionParameter $extToUpdate .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension .Notes COMPLEX PARAMETER PROPERTIES 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. EXTENSIONPARAMETER <IMachineExtensionUpdate>: Describes a Machine Extension Update. [Tags <IResourceUpdateTags>]: Resource tags [(Any) <String>]: This indicates any property can be added to this object. [AutoUpgradeMinorVersion <Boolean?>]: Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. [EnableAutomaticUpgrade <Boolean?>]: Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. [ForceUpdateTag <String>]: How the extension handler should be forced to update even if the extension configuration has not changed. [ProtectedSetting <IMachineExtensionUpdatePropertiesProtectedSettings>]: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. [(Any) <Object>]: This indicates any property can be added to this object. [Publisher <String>]: The name of the extension handler publisher. [Setting <IMachineExtensionUpdatePropertiesSettings>]: Json formatted public settings for the extension. [(Any) <Object>]: This indicates any property can be added to this object. [Type <String>]: Specifies the type of the extension; an example is "CustomScriptExtension". [TypeHandlerVersion <String>]: Specifies the version of the script handler. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. MACHINEINPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedmachineextension #> function Update-AzConnectedMachineExtension { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtension])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine where the extension should be created or updated. ${MachineName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory)] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the machine extension. ${Name}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${MachineInputObject}, [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdate] # Describes a Machine Extension Update. ${ExtensionParameter}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether the extension should use a newer minor version if one is available at deployment time. # Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. ${AutoUpgradeMinorVersion}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. ${EnableAutomaticUpgrade}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # How the extension handler should be forced to update even if the extension configuration has not changed. ${ForceRerun}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Alias('ProtectedSettings')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdatePropertiesProtectedSettings]))] [System.Collections.Hashtable] # The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. ${ProtectedSetting}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The name of the extension handler publisher. ${Publisher}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Alias('Settings')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineExtensionUpdatePropertiesSettings]))] [System.Collections.Hashtable] # Json formatted public settings for the extension. ${Setting}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the type of the extension; an example is "CustomScriptExtension". ${Type}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the version of the script handler. ${TypeHandlerVersion}, [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Update operation ${JsonFilePath}, [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Update operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Update = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_Update'; UpdateExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateExpanded'; UpdateViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityExpanded'; UpdateViaIdentityMachine = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityMachine'; UpdateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaIdentityMachineExpanded'; UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaJsonFilePath'; UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedMachineExtension_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to Update a run command. .Description The operation to Update a run command. .Example Update-AzConnectedMachineRunCommand -ResourceGroupName "az-sdk-test" -RunCommandName "myRunCommand3" -MachineName "testmachine" -SubscriptionId "e6fe6705-4c9c-4b54-81d2-e455780e20b8" -Tag @{Tag1="tag1"; Tag2="tag2"} .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. MACHINEINPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. PARAMETER <IRunCommandInputParameter[]>: The parameters used by the script. Name <String>: The run command parameter name. Value <String>: The run command parameter value. PROTECTEDPARAMETER <IRunCommandInputParameter[]>: The parameters used by the script. Name <String>: The run command parameter name. Value <String>: The run command parameter value. RUNCOMMANDPROPERTY <IMachineRunCommand>: Describes a Run Command Location <String>: The geo-location where the resource lives [Tags <ITrackedResourceTags>]: Resource tags. [(Any) <String>]: This indicates any property can be added to this object. [AsyncExecution <Boolean?>]: Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. [ErrorBlobManagedIdentityClientId <String>]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. [ErrorBlobManagedIdentityObjectId <String>]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. [ErrorBlobUri <String>]: Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. [OutputBlobManagedIdentityClientId <String>]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. [OutputBlobManagedIdentityObjectId <String>]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. [OutputBlobUri <String>]: Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. [Parameter <List<IRunCommandInputParameter>>]: The parameters used by the script. Name <String>: The run command parameter name. Value <String>: The run command parameter value. [ProtectedParameter <List<IRunCommandInputParameter>>]: The parameters used by the script. [RunAsPassword <String>]: Specifies the user account password on the machine when executing the run command. [RunAsUser <String>]: Specifies the user account on the machine when executing the run command. [ScriptUriManagedIdentityClientId <String>]: Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. [ScriptUriManagedIdentityObjectId <String>]: Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. [SourceCommandId <String>]: Specifies the commandId of predefined built-in script. [SourceScript <String>]: Specifies the script content to be executed on the machine. [SourceScriptUri <String>]: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. [TimeoutInSecond <Int32?>]: The timeout in seconds to execute the run command. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedmachineruncommand #> function Update-AzConnectedMachineRunCommand { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${MachineName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory)] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the run command. ${RunCommandName}, [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${MachineInputObject}, [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityMachine', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineRunCommand] # Describes a Run Command ${RunCommandProperty}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Optional. # If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. ${AsyncExecution}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Client Id (GUID value) of the user-assigned managed identity. # ObjectId should not be used if this is provided. ${ErrorBlobManagedIdentityClientId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Object Id (GUID value) of the user-assigned managed identity. # ClientId should not be used if this is provided. ${ErrorBlobManagedIdentityObjectId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the Azure storage blob where script error stream will be uploaded. # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. # Refer errorBlobManagedIdentity parameter. ${ErrorBlobUri}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Client Id (GUID value) of the user-assigned managed identity. # ObjectId should not be used if this is provided. ${OutputBlobManagedIdentityClientId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Object Id (GUID value) of the user-assigned managed identity. # ClientId should not be used if this is provided. ${OutputBlobManagedIdentityObjectId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the Azure storage blob where script output stream will be uploaded. # Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. # Refer outputBlobManagedIdentity parameter. ${OutputBlobUri}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] # The parameters used by the script. ${Parameter}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IRunCommandInputParameter[]] # The parameters used by the script. ${ProtectedParameter}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the user account password on the machine when executing the run command. ${RunAsPassword}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the user account on the machine when executing the run command. ${RunAsUser}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Client Id (GUID value) of the user-assigned managed identity. # ObjectId should not be used if this is provided. ${ScriptUriManagedIdentityClientId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Object Id (GUID value) of the user-assigned managed identity. # ClientId should not be used if this is provided. ${ScriptUriManagedIdentityObjectId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the commandId of predefined built-in script. ${SourceCommandId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the script content to be executed on the machine. ${SourceScript}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the script download location. # It can be either SAS URI of an Azure storage blob with read access or public URI. ${SourceScriptUri}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Int32] # The timeout in seconds to execute the run command. ${TimeoutInSecond}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command as a job ${AsJob}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Run the command asynchronously ${NoWait}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Update = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_Update'; UpdateExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateExpanded'; UpdateViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityExpanded'; UpdateViaIdentityMachine = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityMachine'; UpdateViaIdentityMachineExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachineRunCommand_UpdateViaIdentityMachineExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis The operation to Update a hybrid machine. .Description The operation to Update a hybrid machine. .Example Update-AzConnectedMachine -Name surface -ResourceGroupName rg -PrivateLinkScopeResourceId privateLinkScopeId -WindowsConfigurationPatchSettingsAssessmentMode AutomaticByOS -Tag @{"key"="value"} .Example Update-AzConnectedMachine -Name surface -ResourceGroupName rg -PrivateLinkScopeResourceId $null .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. PARAMETER <IMachineUpdate>: Describes a hybrid machine Update. [Tags <IResourceUpdateTags>]: Resource tags [(Any) <String>]: This indicates any property can be added to this object. [AgentUpgradeCorrelationId <String>]: The correlation ID passed in from RSM per upgrade. [AgentUpgradeDesiredVersion <String>]: Specifies the version info w.r.t AgentUpgrade for the machine. [AgentUpgradeEnableAutomaticUpgrade <Boolean?>]: Specifies if RSM should try to upgrade this machine [IdentityType <String>]: The identity type. [Kind <String>]: Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware etc. [LinuxConfigurationPatchSettingsAssessmentMode <String>]: Specifies the assessment mode. [LinuxConfigurationPatchSettingsPatchMode <String>]: Specifies the patch mode. [LocationDataCity <String>]: The city or locality where the resource is located. [LocationDataCountryOrRegion <String>]: The country or region where the resource is located [LocationDataDistrict <String>]: The district, state, or province where the resource is located. [LocationDataName <String>]: A canonical name for the geographic or physical location. [ParentClusterResourceId <String>]: The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. [PrivateLinkScopeResourceId <String>]: The resource id of the private link scope this machine is assigned to, if any. [WindowsConfigurationPatchSettingsAssessmentMode <String>]: Specifies the assessment mode. [WindowsConfigurationPatchSettingsPatchMode <String>]: Specifies the patch mode. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedmachine #> function Update-AzConnectedMachine { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachine])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('MachineName')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the hybrid machine. ${Name}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IMachineUpdate] # Describes a hybrid machine Update. ${Parameter}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The correlation ID passed in from RSM per upgrade. ${AgentUpgradeCorrelationId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the version info w.r.t AgentUpgrade for the machine. ${AgentUpgradeDesiredVersion}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies if RSM should try to upgrade this machine ${AgentUpgradeEnableAutomatic}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("SystemAssigned")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The identity type. ${IdentityType}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("AVS", "HCI", "SCVMM", "VMware", "EPS", "GCP", "AWS")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware etc. ${Kind}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("ImageDefault", "AutomaticByPlatform")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the assessment mode. ${LinuxConfigurationPatchSettingsAssessmentMode}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("ImageDefault", "AutomaticByPlatform", "AutomaticByOS", "Manual")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the patch mode. ${LinuxConfigurationPatchSettingsPatchMode}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The city or locality where the resource is located. ${LocationDataCity}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The country or region where the resource is located ${LocationDataCountryOrRegion}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The district, state, or province where the resource is located. ${LocationDataDistrict}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # A canonical name for the geographic or physical location. ${LocationDataName}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. ${ParentClusterResourceId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The resource id of the private link scope this machine is assigned to, if any. ${PrivateLinkScopeResourceId}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IResourceUpdateTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("ImageDefault", "AutomaticByPlatform")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the assessment mode. ${WindowsConfigurationPatchSettingsAssessmentMode}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.PSArgumentCompleterAttribute("ImageDefault", "AutomaticByPlatform", "AutomaticByOS", "Manual")] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Specifies the patch mode. ${WindowsConfigurationPatchSettingsPatchMode}, [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Update operation ${JsonFilePath}, [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Update operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Update = 'Az.ConnectedMachine.private\Update-AzConnectedMachine_Update'; UpdateExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachine_UpdateExpanded'; UpdateViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedMachine_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedMachine_UpdateViaIdentityExpanded'; UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Update-AzConnectedMachine_UpdateViaJsonFilePath'; UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedMachine_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Update an existing PrivateLinkScope's tags. To Update other fields use the UpdateOrUpdate method. .Description Update an existing PrivateLinkScope's tags. To Update other fields use the UpdateOrUpdate method. .Example $tag = @{ "Tag1" = "Value1" } Update-AzConnectedPrivateLinkScopeTag -ResourceGroupName "az-sdk-test" -ScopeName "scope-test" -Tag $tag .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource .Outputs Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope .Notes COMPLEX PARAMETER PROPERTIES 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. INPUTOBJECT <IConnectedMachineIdentity>: Identity Parameter [ExtensionName <String>]: The name of the machine extension. [ExtensionType <String>]: The extensionType of the Extension being received. [GroupName <String>]: The name of the private link resource. [Id <String>]: Resource identity path [LicenseName <String>]: The name of the license. [LicenseProfileName <String>]: The name of the license profile. [Location <String>]: The location of the Extension being received. [MachineName <String>]: The name of the hybrid machine. [MetadataName <String>]: Name of the HybridIdentityMetadata. [Name <String>]: The name of the hybrid machine. [OSType <String>]: Defines the os type. [PerimeterName <String>]: The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. [PrivateEndpointConnectionName <String>]: The name of the private endpoint connection. [PrivateLinkScopeId <String>]: The id (Guid) of the Azure Arc PrivateLinkScope resource. [Publisher <String>]: The publisher of the Extension being received. [ResourceGroupName <String>]: The name of the resource group. The name is case insensitive. [ResourceUri <String>]: The fully qualified Azure Resource manager identifier of the resource to be connected. [RunCommandName <String>]: The name of the run command. [ScopeName <String>]: The name of the Azure Arc PrivateLinkScope resource. [SubscriptionId <String>]: The ID of the target subscription. [Version <String>]: The version of the Extension being received. PRIVATELINKSCOPETAG <ITagsResource>: A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. [Tags <ITagsResourceTags>]: Resource tags [(Any) <String>]: This indicates any property can be added to this object. .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/update-azconnectedprivatelinkscopetag #> function Update-AzConnectedPrivateLinkScopeTag { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IHybridComputePrivateLinkScope])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [ArgumentCompleter({Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName})] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the Azure Arc PrivateLinkScope resource. ${ScopeName}, [Parameter(ParameterSetName='Update')] [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaJsonFilePath')] [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.IConnectedMachineIdentity] # Identity Parameter ${InputObject}, [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResource] # A container holding only the Tags for a resource, allowing the user to update the tags on a PrivateLinkScope instance. ${PrivateLinkScopeTag}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITagsResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Path of Json file supplied to the Update operation ${JsonFilePath}, [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # Json string supplied to the Update operation ${JsonString}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Update = 'Az.ConnectedMachine.private\Update-AzConnectedPrivateLinkScopeTag_Update'; UpdateExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedPrivateLinkScopeTag_UpdateExpanded'; UpdateViaIdentity = 'Az.ConnectedMachine.private\Update-AzConnectedPrivateLinkScopeTag_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.ConnectedMachine.private\Update-AzConnectedPrivateLinkScopeTag_UpdateViaIdentityExpanded'; UpdateViaJsonFilePath = 'Az.ConnectedMachine.private\Update-AzConnectedPrivateLinkScopeTag_UpdateViaJsonFilePath'; UpdateViaJsonString = 'Az.ConnectedMachine.private\Update-AzConnectedPrivateLinkScopeTag_UpdateViaJsonString'; } if (('Update', 'UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis API to register a new machine and thereby create a tracked resource in ARM .Description API to register a new machine and thereby create a tracked resource in ARM .Example Connect-AzConnectedMachine -ResourceGroupName contoso-connected-machines -Name linux_eastus1_1 -Location eastus .Example $session = Connect-PSSession -ComputerName WINBOX Connect-AzConnectedMachine -ResourceGroupName contoso-rg -Name win_eastus1_1 -Location eastus -PSSession $session .Link https://learn.microsoft.com/powershell/module/az.connectedmachine/connect-azconnectedmachine #> function Connect-AzConnectedMachine { [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Position=0, Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name of the resource group you want to add the machine to. ${ResourceGroupName}, [Parameter(Position=1)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the subscription you want to add the machine to. ${SubscriptionId}, [Parameter(Position=3)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Path')] [System.String] # The name that will be used for this machine. # The hostname is used by default. ${Name}, [Parameter(Position=2, Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.String] # The location for the created ConnectedMachine. ${Location}, [Parameter(Position=5)] [Alias('Session')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [System.Management.Automation.Runspaces.PSSession[]] # When specified, the command that onboards machines to Azure will be run within each PSSession. # NOTE: This only works on Windows for now. ${PSSession}, [Parameter(Position=6)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, [Parameter(Position=4)] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Azure')] [System.Management.Automation.PSObject] # The credentials, account, tenant, and subscription used for communication with Azure. ${DefaultProfile}, [Parameter(Position=7)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(Position=8, DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(Position=9, DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(Position=10, DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ __AllParameterSets = 'Az.ConnectedMachine.custom\Connect-AzConnectedMachine'; } if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } # SIG # Begin signature block # MIInzgYJKoZIhvcNAQcCoIInvzCCJ7sCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCA/3eq93Y8FF/6u # Xn+bR3BPcegVRF1aSSKu9MUKNvxIrKCCDYUwggYDMIID66ADAgECAhMzAAADri01 # UchTj1UdAAAAAAOuMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwODU5WhcNMjQxMTE0MTkwODU5WjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQD0IPymNjfDEKg+YyE6SjDvJwKW1+pieqTjAY0CnOHZ1Nj5irGjNZPMlQ4HfxXG # yAVCZcEWE4x2sZgam872R1s0+TAelOtbqFmoW4suJHAYoTHhkznNVKpscm5fZ899 # QnReZv5WtWwbD8HAFXbPPStW2JKCqPcZ54Y6wbuWV9bKtKPImqbkMcTejTgEAj82 # 6GQc6/Th66Koka8cUIvz59e/IP04DGrh9wkq2jIFvQ8EDegw1B4KyJTIs76+hmpV # M5SwBZjRs3liOQrierkNVo11WuujB3kBf2CbPoP9MlOyyezqkMIbTRj4OHeKlamd # WaSFhwHLJRIQpfc8sLwOSIBBAgMBAAGjggGCMIIBfjAfBgNVHSUEGDAWBgorBgEE # AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUhx/vdKmXhwc4WiWXbsf0I53h8T8w # VAYDVR0RBE0wS6RJMEcxLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh # dGlvbnMgTGltaXRlZDEWMBQGA1UEBRMNMjMwMDEyKzUwMTgzNjAfBgNVHSMEGDAW # gBRIbmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v # d3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIw # MTEtMDctMDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcwAoZFaHR0cDov # L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDEx # XzIwMTEtMDctMDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggIB # AGrJYDUS7s8o0yNprGXRXuAnRcHKxSjFmW4wclcUTYsQZkhnbMwthWM6cAYb/h2W # 5GNKtlmj/y/CThe3y/o0EH2h+jwfU/9eJ0fK1ZO/2WD0xi777qU+a7l8KjMPdwjY # 0tk9bYEGEZfYPRHy1AGPQVuZlG4i5ymJDsMrcIcqV8pxzsw/yk/O4y/nlOjHz4oV # APU0br5t9tgD8E08GSDi3I6H57Ftod9w26h0MlQiOr10Xqhr5iPLS7SlQwj8HW37 # ybqsmjQpKhmWul6xiXSNGGm36GarHy4Q1egYlxhlUnk3ZKSr3QtWIo1GGL03hT57 # xzjL25fKiZQX/q+II8nuG5M0Qmjvl6Egltr4hZ3e3FQRzRHfLoNPq3ELpxbWdH8t # Nuj0j/x9Crnfwbki8n57mJKI5JVWRWTSLmbTcDDLkTZlJLg9V1BIJwXGY3i2kR9i # 5HsADL8YlW0gMWVSlKB1eiSlK6LmFi0rVH16dde+j5T/EaQtFz6qngN7d1lvO7uk # 6rtX+MLKG4LDRsQgBTi6sIYiKntMjoYFHMPvI/OMUip5ljtLitVbkFGfagSqmbxK # 7rJMhC8wiTzHanBg1Rrbff1niBbnFbbV4UDmYumjs1FIpFCazk6AADXxoKCo5TsO # zSHqr9gHgGYQC2hMyX9MGLIpowYCURx3L7kUiGbOiMwaMIIHejCCBWKgAwIBAgIK # YQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNV # BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv # c29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlm # aWNhdGUgQXV0aG9yaXR5IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw # OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE # BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYD # VQQDEx9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDExMIICIjANBgkqhkiG # 9w0BAQEFAAOCAg8AMIICCgKCAgEAq/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+la # UKq4BjgaBEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSHfpRgJGyvnkmc # 6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpgGgXpZnboMlImEi/nqwhQz7NEt13YxC4D # dato88tt8zpcoRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnnDb6gE3e+ # lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD2Xuye4Yb2T6xjF3oiU+EGvKhL1nk # kDstrjNYxbc+/jLTswM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOEy/S6 # A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2z3yxkq4cI6epZuxhH2rhKEmd # X4jiJV3TIUs+UsS1Vz8kA/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL # 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uDjexNSTCnq47f7Fufr/zd # sGbiwZeBe+3W7UvnSSmnEyimp31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3 # T8HhhUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX3p5O9JawvEagbJjS # 4NaIjAsCAwEAAaOCAe0wggHpMBAGCSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRI # bmTlUAXTgqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTAL # BgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBRyLToCMZBD # uRQFTuHqp8cx0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3JsLm1pY3Jv # c29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf # MDNfMjIuY3JsMF4GCCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDovL3d3 # dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXQyMDExXzIwMTFf # MDNfMjIuY3J0MIGfBgNVHSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF # BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9kb2NzL3ByaW1h # cnljcHMuaHRtMEAGCCsGAQUFBwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkA # YwB5AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3DQEBCwUAA4ICAQBn # 8oalmOBUeRou09h0ZyKbC5YR4WOSmUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7 # v0epo/Np22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r4z4HLimb5j0b # pdS1HXeUOeLpZMlEPXh6I/MTfaaQdION9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/ # KmtYSWMfCWluWpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiXmE0OPQvy # CInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ2xWIUUVYODJxJxp/sfQn+N4sOiBp # mLJZiWhub6e3dMNABQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPDXVJi # hsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yHPgZ3BtEGsXUfFL5hYbXw3MYb # BL7fQccOKO7eZS/sl/ahXJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS # oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5GEv/1rMjaHXmr/r8i+sL # gOppO6/8MO0ETI7f33VtY5E90Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtX # cVZOSEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGZ8wghmbAgEBMIGVMH4x # CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt # b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01p # Y3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTECEzMAAAOuLTVRyFOPVR0AAAAA # A64wDQYJYIZIAWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQw # HAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUwLwYJKoZIhvcNAQkEMSIEIA4R # gA3b5GFU3vLQHS6M7fbDMDwSCio3DaupWraDoUZRMEIGCisGAQQBgjcCAQwxNDAy # oBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRwOi8vd3d3Lm1pY3Jvc29mdC5j # b20wDQYJKoZIhvcNAQEBBQAEggEASLpYGAcHF3XV4nJenRUUoqFzjv+TbhIVQUJn # CwvSAxrUzb/N96ebBvVmmx7TqPG1iqAVKsa3wGKjtJzJ1zK1Cs6EJL19GtHfzsOd # FpXFkAs9axMycqyRUdiJS9nCvC0ZuS+2otw3bIede+TL7Xe1EMEqKI9RgiQufBeY # kVGSZom0RsgYrwOYR4+MxYRkapNuma4cI3Ojp9p2jMafknw9Qpqi1dE4+EPcVttW # u9XnLjf9m6Y/qeae7jMfRr/1/GCww3dVCuMHgpPIlnfBSFJ4S+RxzSwVAYIZXap/ # T/tU6BnNVOyoYWM1Vc2aBGPzX87AqcmBVeiy2U/eanYp5oWZgKGCFykwghclBgor # BgEEAYI3AwMBMYIXFTCCFxEGCSqGSIb3DQEHAqCCFwIwghb+AgEDMQ8wDQYJYIZI # AWUDBAIBBQAwggFZBgsqhkiG9w0BCRABBKCCAUgEggFEMIIBQAIBAQYKKwYBBAGE # WQoDATAxMA0GCWCGSAFlAwQCAQUABCCDBdmUPXMuKBAJR8iLGIMQLln7Ix6ca/3g # na4Qz7zTgwIGZh+4i4kOGBMyMDI0MDQyMzEzMTUyMi44MzFaMASAAgH0oIHYpIHV # MIHSMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH # UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQL # EyRNaWNyb3NvZnQgSXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsT # HVRoYWxlcyBUU1MgRVNOOjA4NDItNEJFNi1DMjlBMSUwIwYDVQQDExxNaWNyb3Nv # ZnQgVGltZS1TdGFtcCBTZXJ2aWNloIIReDCCBycwggUPoAMCAQICEzMAAAHajtXJ # WgDREbEAAQAAAdowDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNV # BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv # c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg # UENBIDIwMTAwHhcNMjMxMDEyMTkwNjU5WhcNMjUwMTEwMTkwNjU5WjCB0jELMAkG # A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx # HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9z # b2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMg # VFNTIEVTTjowODQyLTRCRTYtQzI5QTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt # U3RhbXAgU2VydmljZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJOQ # Bgh2tVFR1j8jQA4NDf8bcVrXSN080CNKPSQo7S57sCnPU0FKF47w2L6qHtwm4EnC # lF2cruXFp/l7PpMQg25E7X8xDmvxr8BBE6iASAPCfrTebuvAsZWcJYhy7prgCuBf # 7OidXpgsW1y8p6Vs7sD2aup/0uveYxeXlKtsPjMCplHkk0ba+HgLho0J68Kdji3D # M2K59wHy9xrtsYK+X9erbDGZ2mmX3765aS5Q7/ugDxMVgzyj80yJn6ULnknD9i4k # UQxVhqV1dc/DF6UBeuzfukkMed7trzUEZMRyla7qhvwUeQlgzCQhpZjz+zsQgpXl # PczvGd0iqr7lACwfVGog5plIzdExvt1TA8Jmef819aTKwH1IVEIwYLA6uvS8kRdA # 6RxvMcb//ulNjIuGceyykMAXEynVrLG9VvK4rfrCsGL3j30Lmidug+owrcCjQagY # mrGk1hBykXilo9YB8Qyy5Q1KhGuH65V3zFy8a0kwbKBRs8VR4HtoPYw9z1DdcJfZ # BO2dhzX3yAMipCGm6SmvmvavRsXhy805jiApDyN+s0/b7os2z8iRWGJk6M9uuT24 # 93gFV/9JLGg5YJJCJXI+yxkO/OXnZJsuGt0+zWLdHS4XIXBG17oPu5KsFfRTHREl # oR2dI6GwaaxIyDySHYOtvIydla7u4lfnfCjY/qKTAgMBAAGjggFJMIIBRTAdBgNV # HQ4EFgQUoXyNyVE9ZhOVizEUVwhNgL8PX0UwHwYDVR0jBBgwFoAUn6cVXQBeYl2D # 9OXSZacbUzUZ6XIwXwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3Nv # ZnQuY29tL3BraW9wcy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUy # MDIwMTAoMSkuY3JsMGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDov # L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1l # LVN0YW1wJTIwUENBJTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADAWBgNVHSUB # Af8EDDAKBggrBgEFBQcDCDAOBgNVHQ8BAf8EBAMCB4AwDQYJKoZIhvcNAQELBQAD # ggIBALmDVdTtuI0jAEt41O2OM8CU237TGMyhrGr7FzKCEFaXxtoqk/IObQriq1ca # HVh2vyuQ24nz3TdOBv7rcs/qnPjOxnXFLyZPeaWLsNuARVmUViyVYXjXYB5DwzaW # ZgScY8GKL7yGjyWrh78WJUgh7rE1+5VD5h0/6rs9dBRqAzI9fhZz7spsjt8vnx50 # WExbBSSH7rfabHendpeqbTmW/RfcaT+GFIsT+g2ej7wRKIq/QhnsoF8mpFNPHV1q # /WK/rF/ChovkhJMDvlqtETWi97GolOSKamZC9bYgcPKfz28ed25WJy10VtQ9P5+C # /2dOfDaz1RmeOb27Kbegha0SfPcriTfORVvqPDSa3n9N7dhTY7+49I8evoad9hdZ # 8CfIOPftwt3xTX2RhMZJCVoFlabHcvfb84raFM6cz5EYk+x1aVEiXtgK6R0xn1wj # MXHf0AWlSjqRkzvSnRKzFsZwEl74VahlKVhI+Ci9RT9+6Gc0xWzJ7zQIUFE3Jiix # 5+7KL8ArHfBY9UFLz4snboJ7Qip3IADbkU4ZL0iQ8j8Ixra7aSYfToUefmct3dM6 # 9ff4Eeh2Kh9NsKiiph589Ap/xS1jESlrfjL/g/ZboaS5d9a2fA598mubDvLD5x5P # P37700vm/Y+PIhmp2fTvuS2sndeZBmyTqcUNHRNmCk+njV3nMIIHcTCCBVmgAwIB # AgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UE # BhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc # BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0 # IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1 # WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu # Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv # cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCC # AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIhC3miy9ckeb0O # 1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZn # hUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFcUTE3oAo4bo3t # 1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxq # D89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUoveO0hyTD4MmP # frVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyziYrLNueKNiOSW # rAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv # 231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zb # r17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7XKHYC4jMYcten # IPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiER9vcG9H9stQc # xWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/eKtFtvUeh17a # j54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3FQEEBQIDAQAB # MCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQU # n6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEw # QTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9E # b2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQB # gjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/ # MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJ # oEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01p # Y1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQROMEwwSgYIKwYB # BQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2VydHMvTWljUm9v # Q2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3h # LB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pkbHzQdTltuw8x # 5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gngugnue99qb74p # y27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3lbYoVSfQJL1A # oL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbC # HcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB # 9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNt # yo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3 # rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcV # v7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrpNPgkNWcr4A24 # 5oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHIqzqKOghif9lw # Y1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAtQwggI9AgEBMIIBAKGB2KSB1TCB # 0jELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl # ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMk # TWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1U # aGFsZXMgVFNTIEVTTjowODQyLTRCRTYtQzI5QTElMCMGA1UEAxMcTWljcm9zb2Z0 # IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAQqIfIYljHUbNoY0/ # wjhXRn/sSA2ggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu # Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv # cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN # BgkqhkiG9w0BAQUFAAIFAOnSH4QwIhgPMjAyNDA0MjMxOTUyMzZaGA8yMDI0MDQy # NDE5NTIzNlowdDA6BgorBgEEAYRZCgQBMSwwKjAKAgUA6dIfhAIBADAHAgEAAgIU # 6jAHAgEAAgIRVDAKAgUA6dNxBAIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEE # AYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GB # ACaiRtshc9G8WfVMjQ9xgEYZNyoQzv72BU6LutxlZM2r2C6LuYvcx7q63PWs3Mxk # StXHAb2esRYvBMPDXsgq+NN6fYXSMTKwpnHYRiK/t3Uv3SwtPXjykiR2mqVxj6/P # kN2nsimpupdSo/lnOZCfy706cQscQBC5MafJvRllTUbaMYIEDTCCBAkCAQEwgZMw # fDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl # ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMd # TWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAHajtXJWgDREbEAAQAA # AdowDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRAB # BDAvBgkqhkiG9w0BCQQxIgQgH2/F+UaXP+gsIRt5r3kTzQMpPTCDIG0Z6T15FpcO # vOIwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCAipaNpYsDvnqTe95Dj1C09 # 020I5ljibrW/ndICOxg9xjCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQI # EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv # ZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBD # QSAyMDEwAhMzAAAB2o7VyVoA0RGxAAEAAAHaMCIEIFb/iamaUnR+fesQaHni5azX # dqy22buGhS1oKaTDDm+JMA0GCSqGSIb3DQEBCwUABIICAEOUKWCorxrM7u4+jeFE # XWq7Y6bO+6sljqRLkCZ3zuP9PnBiOGyZ9Jvj99MdLN7UCVvy9XxWWy/BEuD/ZqzT # uic2pyaUQb9O0hnTXgVieynyrieZIAAlVdqcWs9tZJa4JjECwvBzeNBVEt4QOjQt # lQrhk9dMRhOJr9AToyXOE3xIH/1qmrRUNV04HWsl19BTYkzSZG57eALBBUWuqgXb # qvmtVmaNrNGEUAmDGhO8Dd0O/1Hl7b6GJ2XBjfYGVTJ1wjpTa+BSSkBdmhziS9Pn # 0/dR8R0G8v8DY3drGnI4bF00nZOP8IFbhLYHgCHBRxSRmEdE3JZfNaAF5HehZ4Tx # jVrhBcFfdE6PGarEiAjMmZaJy+OIv4QveAe+nNO4kLNXOeZx8f4Rxl7Eg0ISitGC # 14q90VAVXkRaYbCvurrDZt4zoFh1xN1N52v/kUBL0MHIjN5WPHp+HGPx63IXYukI # kKIWoAa+jPI/gEc7bihmhAc5zoDWxQEnE0RdCfLRAjBVuDRbwciJy6hjmlzQNLUa # xAhTKEYhdJVdHEQnzbGPUzngnCxZ25ALPuyMJwmcMFIaGyIiPXAnCJl44DM1gg1+ # TzB69waxxV6vVegXw1RAxWDFdtKzEfZg5FK/ADgsLyjBSggRagxFqmjd4FtaMQeZ # wXrdSj9iaLoEErYWkhJeujRg # SIG # End signature block |