From 9ab0f0c16f9136d9184edc08614b7b55ba6f055c Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Mon, 18 Apr 2022 15:03:07 +0000 Subject: [PATCH 1/4] Move ContainerInstance to main --- .../Az.ContainerInstance.psd1 | 6 +- .../Az.ContainerInstance.psm1 | 14 +- src/ContainerInstance/ContainerInstance.sln | 156 +- src/ContainerInstance/README.md | 13 +- src/ContainerInstance/check-dependencies.ps1 | 2 +- .../create-model-cmdlets.ps1 | 6 +- .../custom/New-AzContainerGroup.ps1 | 2 +- .../New-AzContainerGroupVolumeObject.ps1 | 70 +- .../SpecialHandlerToRemoveDefaultValue.cs | 11 +- .../examples/Add-AzContainerInstanceOutput.md | 7 +- .../examples/Get-AzContainerGroup.md | 17 +- .../Get-AzContainerInstanceCachedImage.md | 4 +- .../Get-AzContainerInstanceCapability.md | 4 +- ...rGroupOutboundNetworkDependencyEndpoint.md | 4 +- .../examples/Get-AzContainerInstanceLog.md | 8 +- .../examples/Get-AzContainerInstanceUsage.md | 4 +- .../Invoke-AzContainerInstanceCommand.md | 4 +- .../examples/New-AzContainerGroup.md | 56 +- ...ainerGroupImageRegistryCredentialObject.md | 5 +- .../New-AzContainerGroupPortObject.md | 4 +- .../New-AzContainerGroupVolumeObject.md | 30 +- ...tainerInstanceEnvironmentVariableObject.md | 8 +- ...New-AzContainerInstanceHttpHeaderObject.md | 4 +- ...AzContainerInstanceInitDefinitionObject.md | 4 +- .../examples/New-AzContainerInstanceObject.md | 14 +- .../New-AzContainerInstancePortObject.md | 4 +- ...ew-AzContainerInstanceVolumeMountObject.md | 4 +- .../examples/Remove-AzContainerGroup.md | 8 +- .../examples/Restart-AzContainerGroup.md | 4 +- .../examples/Start-AzContainerGroup.md | 5 +- .../examples/Stop-AzContainerGroup.md | 4 +- .../examples/Update-AzContainerGroup.md | 12 +- .../exports/Add-AzContainerInstanceOutput.ps1 | 47 +- .../exports/Get-AzContainerGroup.ps1 | 112 +- .../Get-AzContainerInstanceCachedImage.ps1 | 49 +- .../Get-AzContainerInstanceCapability.ps1 | 53 +- ...GroupOutboundNetworkDependencyEndpoint.ps1 | 44 +- .../exports/Get-AzContainerInstanceLog.ps1 | 56 +- .../exports/Get-AzContainerInstanceUsage.ps1 | 52 +- .../Invoke-AzContainerInstanceCommand.ps1 | 44 +- .../exports/New-AzContainerGroup.ps1 | 113 +- ...inerGroupImageRegistryCredentialObject.ps1 | 47 +- .../New-AzContainerGroupPortObject.ps1 | 46 +- .../New-AzContainerGroupVolumeObject.ps1 | 80 +- ...ainerInstanceEnvironmentVariableObject.ps1 | 52 +- ...ew-AzContainerInstanceHttpHeaderObject.ps1 | 46 +- ...zContainerInstanceInitDefinitionObject.ps1 | 46 +- .../exports/New-AzContainerInstanceObject.ps1 | 60 +- .../New-AzContainerInstancePortObject.ps1 | 46 +- ...w-AzContainerInstanceVolumeMountObject.ps1 | 46 +- .../exports/ProxyCmdletDefinitions.ps1 | 1282 +++++++++++++---- .../exports/Remove-AzContainerGroup.ps1 | 52 +- .../exports/Restart-AzContainerGroup.ps1 | 44 +- .../exports/Start-AzContainerGroup.ps1 | 45 +- .../exports/Stop-AzContainerGroup.ps1 | 44 +- .../exports/Update-AzContainerGroup.ps1 | 58 +- src/ContainerInstance/generate-info.json | 10 +- src/ContainerInstance/generated/Module.cs | 8 + .../Models/Api20210901/Volume.PowerShell.cs | 4 +- .../api/Models/Api20210901/Volume.cs | 10 +- .../api/Models/Api20210901/Volume.json.cs | 2 +- .../Api20210901/VolumeEmptyDir.PowerShell.cs | 158 ++ .../VolumeEmptyDir.TypeConverter.cs | 147 ++ .../api/Models/Api20210901/VolumeEmptyDir.cs | 35 + .../Api20210901/VolumeEmptyDir.dictionary.cs | 75 + .../Models/Api20210901/VolumeEmptyDir.json.cs | 107 ++ .../AddAzContainerInstanceOutput_Attach.cs | 8 +- .../cmdlets/GetAzContainerGroup_Get.cs | 8 +- .../GetAzContainerGroup_GetViaIdentity.cs | 8 +- .../cmdlets/GetAzContainerGroup_List.cs | 8 +- .../cmdlets/GetAzContainerGroup_List1.cs | 8 +- .../GetAzContainerInstanceCachedImage_List.cs | 8 +- .../GetAzContainerInstanceCapability_List.cs | 8 +- ...upOutboundNetworkDependencyEndpoint_Get.cs | 8 +- ...etworkDependencyEndpoint_GetViaIdentity.cs | 8 +- .../cmdlets/GetAzContainerInstanceLog_List.cs | 8 +- .../GetAzContainerInstanceOperation_List.cs | 8 +- .../GetAzContainerInstanceUsage_List.cs | 8 +- ...ontainerInstanceCommand_ExecuteExpanded.cs | 8 +- .../NewAzContainerGroup_CreateExpanded.cs | 8 +- .../cmdlets/RemoveAzContainerGroup_Delete.cs | 8 +- ...emoveAzContainerGroup_DeleteViaIdentity.cs | 8 +- .../RestartAzContainerGroup_Restart.cs | 8 +- ...tartAzContainerGroup_RestartViaIdentity.cs | 8 +- .../cmdlets/StartAzContainerGroup_Start.cs | 8 +- .../StartAzContainerGroup_StartViaIdentity.cs | 8 +- .../cmdlets/StopAzContainerGroup_Stop.cs | 8 +- .../StopAzContainerGroup_StopViaIdentity.cs | 8 +- .../UpdateAzContainerGroup_UpdateExpanded.cs | 8 +- ...ontainerGroup_UpdateViaIdentityExpanded.cs | 8 +- .../BuildTime/Models/PsHelpMarkdownOutputs.cs | 42 +- .../runtime/BuildTime/Models/PsHelpTypes.cs | 3 + .../BuildTime/Models/PsMarkdownTypes.cs | 19 +- .../BuildTime/Models/PsProxyOutputs.cs | 96 +- .../help/Az.ContainerInstance.md | 2 +- .../help/New-AzContainerGroup.md | 8 +- .../help/New-AzContainerGroupVolumeObject.md | 75 +- .../Get-AzContainerInstanceOperation.ps1 | 17 +- .../Invoke-AzContainerInstanceCommand.ps1 | 13 +- .../internal/New-AzContainerGroup.ps1 | 82 +- .../internal/ProxyCmdletDefinitions.ps1 | 112 +- src/ContainerInstance/internal/README.md | 4 +- ...-AzContainerInstanceVolumeObject.Tests.ps1 | 21 + 103 files changed, 3257 insertions(+), 1047 deletions(-) create mode 100644 src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.PowerShell.cs create mode 100644 src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.TypeConverter.cs create mode 100644 src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.cs create mode 100644 src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.dictionary.cs create mode 100644 src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.json.cs create mode 100644 src/ContainerInstance/test/New-AzContainerInstanceVolumeObject.Tests.ps1 diff --git a/src/ContainerInstance/Az.ContainerInstance.psd1 b/src/ContainerInstance/Az.ContainerInstance.psd1 index 8281a9839c90..3683f46fe0f7 100644 --- a/src/ContainerInstance/Az.ContainerInstance.psd1 +++ b/src/ContainerInstance/Az.ContainerInstance.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2/24/2022 +# Generated on: 4/18/2022 # @{ @@ -95,7 +95,7 @@ CmdletsToExport = @() # VariablesToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. -AliasesToExport = 'Get-AzContainerGroupOutboundNetworkDependencyEndpoint' +AliasesToExport = 'Get-AzContainerGroupOutboundNetworkDependencyEndpoint', '*' # DSC resources to export from this module # DscResourcesToExport = @() @@ -124,7 +124,7 @@ PrivateData = @{ # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = '* Fixed Identity Bug in ImageRegistryCredential' + # ReleaseNotes = '' # Prerelease string of this module # Prerelease = '' diff --git a/src/ContainerInstance/Az.ContainerInstance.psm1 b/src/ContainerInstance/Az.ContainerInstance.psm1 index f27a333091b0..512fc12aebb9 100644 --- a/src/ContainerInstance/Az.ContainerInstance.psm1 +++ b/src/ContainerInstance/Az.ContainerInstance.psm1 @@ -25,17 +25,17 @@ } } if(-not $accountsModule) { - $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0 + $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0 if($hasAdequateVersion) { - $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru } } } if(-not $accountsModule) { - Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop - } elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) { - Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop + } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop } Write-Information "Loaded Module '$($accountsModule.Name)'" @@ -50,6 +50,10 @@ # Tweaks the pipeline on module load $instance.OnModuleLoad = $VTable.OnModuleLoad + + # Following two delegates are added for telemetry + $instance.GetTelemetryId = $VTable.GetTelemetryId + $instance.Telemetry = $VTable.Telemetry # Tweaks the pipeline per call diff --git a/src/ContainerInstance/ContainerInstance.sln b/src/ContainerInstance/ContainerInstance.sln index 82dd301e11be..e98de1a6b2b8 100644 --- a/src/ContainerInstance/ContainerInstance.sln +++ b/src/ContainerInstance/ContainerInstance.sln @@ -3,17 +3,17 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30114.105 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{EEC77869-F43C-492F-A203-89FB51902D5A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{5E36A58C-9179-4197-803B-876929202A3B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{C3346A13-2B6E-4B20-8102-2C0009520994}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{F47B96CE-C45D-476D-86D3-3E54860BD161}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{D5760413-37FA-4938-8894-B8975648D03F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{910BDC36-DAE5-42F2-8289-D02536741ACE}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{81D91039-447D-4C7C-9837-4EB84A4629B1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{9DEAD20A-4771-43D3-BCB9-BE3347089E62}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{71CDE8A5-660C-4665-AD7A-763A070B5BC0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{29825CB6-7123-417D-8420-6F63B42E048B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ContainerInstance", "Az.ContainerInstance.csproj", "{D167293D-4BD8-4506-BCEA-1EB00096F50F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.ContainerInstance", "Az.ContainerInstance.csproj", "{B205CE86-4CD8-464C-90D9-42DFD1766B70}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -28,77 +28,77 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EEC77869-F43C-492F-A203-89FB51902D5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Debug|x64.ActiveCfg = Debug|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Debug|x64.Build.0 = Debug|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Debug|x86.ActiveCfg = Debug|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Debug|x86.Build.0 = Debug|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Release|Any CPU.Build.0 = Release|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Release|x64.ActiveCfg = Release|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Release|x64.Build.0 = Release|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Release|x86.ActiveCfg = Release|Any CPU - {EEC77869-F43C-492F-A203-89FB51902D5A}.Release|x86.Build.0 = Release|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Debug|x64.ActiveCfg = Debug|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Debug|x64.Build.0 = Debug|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Debug|x86.ActiveCfg = Debug|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Debug|x86.Build.0 = Debug|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Release|Any CPU.Build.0 = Release|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Release|x64.ActiveCfg = Release|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Release|x64.Build.0 = Release|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Release|x86.ActiveCfg = Release|Any CPU - {C3346A13-2B6E-4B20-8102-2C0009520994}.Release|x86.Build.0 = Release|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Debug|x64.ActiveCfg = Debug|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Debug|x64.Build.0 = Debug|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Debug|x86.ActiveCfg = Debug|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Debug|x86.Build.0 = Debug|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Release|Any CPU.Build.0 = Release|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Release|x64.ActiveCfg = Release|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Release|x64.Build.0 = Release|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Release|x86.ActiveCfg = Release|Any CPU - {D5760413-37FA-4938-8894-B8975648D03F}.Release|x86.Build.0 = Release|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Debug|x64.ActiveCfg = Debug|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Debug|x64.Build.0 = Debug|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Debug|x86.ActiveCfg = Debug|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Debug|x86.Build.0 = Debug|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Release|Any CPU.Build.0 = Release|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Release|x64.ActiveCfg = Release|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Release|x64.Build.0 = Release|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Release|x86.ActiveCfg = Release|Any CPU - {81D91039-447D-4C7C-9837-4EB84A4629B1}.Release|x86.Build.0 = Release|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Debug|x64.ActiveCfg = Debug|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Debug|x64.Build.0 = Debug|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Debug|x86.ActiveCfg = Debug|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Debug|x86.Build.0 = Debug|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Release|Any CPU.Build.0 = Release|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Release|x64.ActiveCfg = Release|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Release|x64.Build.0 = Release|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Release|x86.ActiveCfg = Release|Any CPU - {71CDE8A5-660C-4665-AD7A-763A070B5BC0}.Release|x86.Build.0 = Release|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Debug|x64.ActiveCfg = Debug|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Debug|x64.Build.0 = Debug|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Debug|x86.ActiveCfg = Debug|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Debug|x86.Build.0 = Debug|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Release|Any CPU.Build.0 = Release|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Release|x64.ActiveCfg = Release|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Release|x64.Build.0 = Release|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Release|x86.ActiveCfg = Release|Any CPU - {D167293D-4BD8-4506-BCEA-1EB00096F50F}.Release|x86.Build.0 = Release|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Debug|x64.ActiveCfg = Debug|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Debug|x64.Build.0 = Debug|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Debug|x86.ActiveCfg = Debug|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Debug|x86.Build.0 = Debug|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Release|Any CPU.Build.0 = Release|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Release|x64.ActiveCfg = Release|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Release|x64.Build.0 = Release|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Release|x86.ActiveCfg = Release|Any CPU + {5E36A58C-9179-4197-803B-876929202A3B}.Release|x86.Build.0 = Release|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Debug|x64.ActiveCfg = Debug|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Debug|x64.Build.0 = Debug|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Debug|x86.ActiveCfg = Debug|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Debug|x86.Build.0 = Debug|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Release|Any CPU.Build.0 = Release|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Release|x64.ActiveCfg = Release|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Release|x64.Build.0 = Release|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Release|x86.ActiveCfg = Release|Any CPU + {F47B96CE-C45D-476D-86D3-3E54860BD161}.Release|x86.Build.0 = Release|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Debug|x64.ActiveCfg = Debug|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Debug|x64.Build.0 = Debug|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Debug|x86.ActiveCfg = Debug|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Debug|x86.Build.0 = Debug|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Release|Any CPU.Build.0 = Release|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Release|x64.ActiveCfg = Release|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Release|x64.Build.0 = Release|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Release|x86.ActiveCfg = Release|Any CPU + {910BDC36-DAE5-42F2-8289-D02536741ACE}.Release|x86.Build.0 = Release|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Debug|x64.ActiveCfg = Debug|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Debug|x64.Build.0 = Debug|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Debug|x86.ActiveCfg = Debug|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Debug|x86.Build.0 = Debug|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Release|Any CPU.Build.0 = Release|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Release|x64.ActiveCfg = Release|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Release|x64.Build.0 = Release|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Release|x86.ActiveCfg = Release|Any CPU + {9DEAD20A-4771-43D3-BCB9-BE3347089E62}.Release|x86.Build.0 = Release|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Debug|x64.ActiveCfg = Debug|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Debug|x64.Build.0 = Debug|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Debug|x86.ActiveCfg = Debug|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Debug|x86.Build.0 = Debug|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Release|Any CPU.Build.0 = Release|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Release|x64.ActiveCfg = Release|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Release|x64.Build.0 = Release|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Release|x86.ActiveCfg = Release|Any CPU + {29825CB6-7123-417D-8420-6F63B42E048B}.Release|x86.Build.0 = Release|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Debug|x64.ActiveCfg = Debug|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Debug|x64.Build.0 = Debug|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Debug|x86.ActiveCfg = Debug|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Debug|x86.Build.0 = Debug|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Release|Any CPU.Build.0 = Release|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Release|x64.ActiveCfg = Release|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Release|x64.Build.0 = Release|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Release|x86.ActiveCfg = Release|Any CPU + {B205CE86-4CD8-464C-90D9-42DFD1766B70}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/ContainerInstance/README.md b/src/ContainerInstance/README.md index 5f7d8e9df5e7..864dd0bedc05 100644 --- a/src/ContainerInstance/README.md +++ b/src/ContainerInstance/README.md @@ -17,7 +17,7 @@ This directory contains the PowerShell module for the ContainerInstance service. This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. ## Module Requirements -- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater ## Authentication AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. @@ -140,4 +140,15 @@ directive: $["204"] = { "description": "No content" } + # Change the type of EmptyDir from IAny() to VolumeEmptyDir + - from: swagger-document + where: $.definitions.Volume.properties.emptyDir + transform: >- + return { + "description": "The empty directory volume.", + "type": "object", + "additionalProperties": true + } + # - model-cmdlet: + # - Volume # Hide to customize AzureFileStorageAccountKey from string to securestring ``` diff --git a/src/ContainerInstance/check-dependencies.ps1 b/src/ContainerInstance/check-dependencies.ps1 index b02ae9135957..1200ec1e6fc4 100644 --- a/src/ContainerInstance/check-dependencies.ps1 +++ b/src/ContainerInstance/check-dependencies.ps1 @@ -47,7 +47,7 @@ if(Test-Path -Path $localModulesPath) { $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" } -DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.2.3' +DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5' DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1' $tools = Join-Path $PSScriptRoot 'tools' diff --git a/src/ContainerInstance/create-model-cmdlets.ps1 b/src/ContainerInstance/create-model-cmdlets.ps1 index 4ea43c98f607..e784f0621f34 100644 --- a/src/ContainerInstance/create-model-cmdlets.ps1 +++ b/src/ContainerInstance/create-model-cmdlets.ps1 @@ -23,7 +23,7 @@ function CreateModelCmdlet { } $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models' - $ModuleName = 'Az.ContainerInstance'.Split(".")[1] + $ModuleName = 'ContainerInstance' $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets' $null = New-Item -ItemType Directory -Force -Path $OutputDir @@ -115,7 +115,9 @@ function CreateModelCmdlet { # check whether completer is needed $completer = ''; if($Type.Split('.').Split('.')[-2] -eq 'Support') { - $completer += "`n [ArgumentCompleter([${Type}])]" + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" } $ParameterDefineScript = " [Parameter($ParameterDefineProperty)]${completer} diff --git a/src/ContainerInstance/custom/New-AzContainerGroup.ps1 b/src/ContainerInstance/custom/New-AzContainerGroup.ps1 index 727387934995..f55d116302a8 100644 --- a/src/ContainerInstance/custom/New-AzContainerGroup.ps1 +++ b/src/ContainerInstance/custom/New-AzContainerGroup.ps1 @@ -18,7 +18,7 @@ .Synopsis Create or update container groups with specified configurations. .Description -Create or update container groups with specified configurations. For property Volume, we support mounting Azure File share as a volume or specifying git repository as volume directory. The empty directory volume and secret volume are not supported yet. +Create or update container groups with specified configurations. .Link https://docs.microsoft.com/powershell/module/az.containerinstance/new-azcontainergroup #> diff --git a/src/ContainerInstance/custom/New-AzContainerGroupVolumeObject.ps1 b/src/ContainerInstance/custom/New-AzContainerGroupVolumeObject.ps1 index e9c8d8c7140d..7ce312ffe5eb 100644 --- a/src/ContainerInstance/custom/New-AzContainerGroupVolumeObject.ps1 +++ b/src/ContainerInstance/custom/New-AzContainerGroupVolumeObject.ps1 @@ -1,23 +1,27 @@ # ---------------------------------------------------------------------------------- -# -# Copyright Microsoft Corporation -# Licensed under the Apache License, Version 2.0 (the \"License\"); +# 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, +# 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 -Create a in-memory object for Volume +Create an in-memory object for Volume. .Description -Create a in-memory object for Volume. Currently, we support mounting Azure File share as a volume or specifying git repository as volume directory. The empty directory volume and secret volume are not supported yet. +Create an in-memory object for Volume. + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Volume .Link https://docs.microsoft.com/powershell/module/az.ContainerInstance/new-AzContainerGroupVolumeObject #> @@ -38,9 +42,9 @@ function New-AzContainerGroupVolumeObject { [Parameter(HelpMessage="The name of the storage account that contains the Azure File share.")] [string] $AzureFileStorageAccountName, - # [Parameter(HelpMessage="The empty directory volume.")] - # [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny] - # $EmptyDir, + [Parameter(HelpMessage="The empty directory volume.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir] + $EmptyDir, [Parameter(HelpMessage="Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.")] [string] $GitRepoDirectoryName, @@ -52,28 +56,46 @@ function New-AzContainerGroupVolumeObject { $GitRepoRevision, [Parameter(Mandatory, HelpMessage="The name of the volume.")] [string] - $Name - # , - # [Parameter(HelpMessage="The secret volume.")] - # [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ISecretVolume] - # $Secret + $Name, + [Parameter(HelpMessage="The secret volume.")] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ISecretVolume] + $Secret ) process { $Object = [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Volume]::New() - $Object.AzureFileShareName = $AzureFileShareName + if ($PSBoundParameters.ContainsKey('AzureFileReadOnly')) { + $Object.AzureFileReadOnly = $AzureFileReadOnly + } + if ($PSBoundParameters.ContainsKey('AzureFileShareName')) { + $Object.AzureFileShareName = $AzureFileShareName + } if ($PSBoundParameters.ContainsKey('AzureFileStorageAccountKey')) { - $psTxt = . "$PSScriptRoot/../utils/Unprotect-SecureString.ps1" $PSBoundParameters['AzureFileStorageAccountKey'] + $psTxt = . "$PSScriptRoot/../utils/Unprotect-SecureString.ps1" $PSBoundParameters['AzureFileStorageAccountKey'] + $Object.AzureFileStorageAccountKey = $psTxt + } + if ($PSBoundParameters.ContainsKey('AzureFileStorageAccountName')) { + $Object.AzureFileStorageAccountName = $AzureFileStorageAccountName + } + if ($PSBoundParameters.ContainsKey('EmptyDir')) { + $Object.EmptyDir = $EmptyDir + } + if ($PSBoundParameters.ContainsKey('GitRepoDirectoryName')) { + $Object.GitRepoDirectory = $GitRepoDirectoryName + } + if ($PSBoundParameters.ContainsKey('GitRepoRepositoryUrl')) { + $Object.GitRepoRepository = $GitRepoRepositoryUrl + } + if ($PSBoundParameters.ContainsKey('GitRepoRevision')) { + $Object.GitRepoRevision = $GitRepoRevision + } + if ($PSBoundParameters.ContainsKey('Name')) { + $Object.Name = $Name + } + if ($PSBoundParameters.ContainsKey('Secret')) { + $Object.Secret = $Secret } - $Object.AzureFileStorageAccountKey = $psTxt - $Object.AzureFileStorageAccountName = $AzureFileStorageAccountName - # $Object.EmptyDir = $EmptyDir - $Object.GitRepoDirectory = $GitRepoDirectoryName - $Object.GitRepoRepository = $GitRepoRepositoryUrl - $Object.GitRepoRevision = $GitRepoRevision - $Object.Name = $Name - # $Object.Secret = $Secret return $Object } } diff --git a/src/ContainerInstance/custom/SpecialHandlerToRemoveDefaultValue.cs b/src/ContainerInstance/custom/SpecialHandlerToRemoveDefaultValue.cs index d3f3a0aef125..34170e18f42e 100644 --- a/src/ContainerInstance/custom/SpecialHandlerToRemoveDefaultValue.cs +++ b/src/ContainerInstance/custom/SpecialHandlerToRemoveDefaultValue.cs @@ -243,10 +243,15 @@ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan this._gitRepo = null; } - this._emptyDir = null; - - this._secret = null; } + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject container) + { + if (this._emptyDir != null && this._emptyDir.Count == 0) { + container.Add("emptyDir", new Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject()); + } + } + } } diff --git a/src/ContainerInstance/examples/Add-AzContainerInstanceOutput.md b/src/ContainerInstance/examples/Add-AzContainerInstanceOutput.md index e6a198003083..ffb098db68a5 100644 --- a/src/ContainerInstance/examples/Add-AzContainerInstanceOutput.md +++ b/src/ContainerInstance/examples/Add-AzContainerInstanceOutput.md @@ -1,7 +1,10 @@ ### Example 1: Attach to the output of a specific container instance ```powershell -PS C:\> $response = Add-AzContainerInstanceOutput -GroupName test-cg -Name test-container -ResourceGroupName test-rg -PS C:\> $response +$response = Add-AzContainerInstanceOutput -GroupName test-cg -Name test-container -ResourceGroupName test-rg +$response +``` + +```output Password WebSocketUri -------- ------------ ****************** wss://********.eastus.atlas.cloudapp.azure.com:19390/logstream/sessionId/00000000-0000-0000-0000-000000000000?api-version=1.0 diff --git a/src/ContainerInstance/examples/Get-AzContainerGroup.md b/src/ContainerInstance/examples/Get-AzContainerGroup.md index 8d323a3fdf7c..4f4513d4a06e 100644 --- a/src/ContainerInstance/examples/Get-AzContainerGroup.md +++ b/src/ContainerInstance/examples/Get-AzContainerGroup.md @@ -1,7 +1,9 @@ ### Example 1: List all container groups in the current subscription ```powershell -PS C:\> Get-AzContainerGroup +Get-AzContainerGroup +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg1 test-rg @@ -12,9 +14,10 @@ This command gets all container groups in the current subscription. ### Example 2: Get a specific container group ```powershell -PS C:\> Get-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg | fl - +Get-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg | Format-List +``` +```output Container : {test-container1} DnsConfigNameServer : DnsConfigOption : @@ -69,8 +72,10 @@ The command gets the specified container group. ### Example 3: Get container groups in a resource group ```powershell -PS C:\> Get-AzContainerGroup -ResourceGroupName test-rg +Get-AzContainerGroup -ResourceGroupName test-rg +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg1 test-rg @@ -81,8 +86,10 @@ The command gets the container groups in the resource group `test-rg`. ### Example 4: Get a container group by piping ```powershell -PS C:\> Update-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg -Tag @{"test"="value"} | Get-AzContainerGroup +Update-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg -Tag @{"test"="value"} | Get-AzContainerGroup +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg1 test-rg diff --git a/src/ContainerInstance/examples/Get-AzContainerInstanceCachedImage.md b/src/ContainerInstance/examples/Get-AzContainerInstanceCachedImage.md index 129befb75d7b..15c4097ed2a9 100644 --- a/src/ContainerInstance/examples/Get-AzContainerInstanceCachedImage.md +++ b/src/ContainerInstance/examples/Get-AzContainerInstanceCachedImage.md @@ -1,7 +1,9 @@ ### Example 1: Get the list of cached images for the current subscription in a region. ```powershell -PS C:\> Get-AzContainerInstanceCachedImage -Location eastus +Get-AzContainerInstanceCachedImage -Location eastus +``` +```output Image OSType ----- ------ microsoft/dotnet-framework:4.7.2-runtime-20181211-windowsservercore-ltsc2016 Windows diff --git a/src/ContainerInstance/examples/Get-AzContainerInstanceCapability.md b/src/ContainerInstance/examples/Get-AzContainerInstanceCapability.md index 2df64aa3a59b..c5868476b7ab 100644 --- a/src/ContainerInstance/examples/Get-AzContainerInstanceCapability.md +++ b/src/ContainerInstance/examples/Get-AzContainerInstanceCapability.md @@ -1,7 +1,9 @@ ### Example 1: Get the list of capabilities of the location ```powershell -PS C:\> Get-AzContainerInstanceCapability -Location eastus +Get-AzContainerInstanceCapability -Location eastus +``` +```output Gpu IPAddressType Location OSType ResourceType --- ------------- -------- ------ ------------ None Public eastus NotSpecified containerGroups diff --git a/src/ContainerInstance/examples/Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint.md b/src/ContainerInstance/examples/Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint.md index b7b4c1f7e1b6..dda7ce93673b 100644 --- a/src/ContainerInstance/examples/Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint.md +++ b/src/ContainerInstance/examples/Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint.md @@ -1,7 +1,9 @@ ### Example 1: Get a list of the outbound network dependencies ```powershell -PS C:\> Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint -ResourceGroupName test-rg -ContainerGroupName test-cg +Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint -ResourceGroupName test-rg -ContainerGroupName test-cg +``` +```output [] ``` diff --git a/src/ContainerInstance/examples/Get-AzContainerInstanceLog.md b/src/ContainerInstance/examples/Get-AzContainerInstanceLog.md index 17d20ce3abb9..439d05991a09 100644 --- a/src/ContainerInstance/examples/Get-AzContainerInstanceLog.md +++ b/src/ContainerInstance/examples/Get-AzContainerInstanceLog.md @@ -1,7 +1,9 @@ ### Example 1: Get the tail log of a container instance ```powershell -PS C:\> Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg +Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg +``` +```output /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh @@ -16,8 +18,10 @@ Get the log from test-container in container group test-cg. By default, it will ### Example 2: Get the tail 2 lines of log of a container instance ```powershell -PS C:\> Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Tail 2 +Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Tail 2 +``` +```output /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh /docker-entrypoint.sh: Configuration complete; ready for start up ``` diff --git a/src/ContainerInstance/examples/Get-AzContainerInstanceUsage.md b/src/ContainerInstance/examples/Get-AzContainerInstanceUsage.md index 9dd590ce72c4..75600add70a2 100644 --- a/src/ContainerInstance/examples/Get-AzContainerInstanceUsage.md +++ b/src/ContainerInstance/examples/Get-AzContainerInstanceUsage.md @@ -1,7 +1,9 @@ ### Example 1: Get the usage of the location ```powershell -PS C:\> Get-AzContainerInstanceUsage -Location eastus +Get-AzContainerInstanceUsage -Location eastus +``` +```output CurrentValue Limit Unit ------------ ----- ---- 9 100 Count diff --git a/src/ContainerInstance/examples/Invoke-AzContainerInstanceCommand.md b/src/ContainerInstance/examples/Invoke-AzContainerInstanceCommand.md index 73c9ece2e5b6..53e2c26974b1 100644 --- a/src/ContainerInstance/examples/Invoke-AzContainerInstanceCommand.md +++ b/src/ContainerInstance/examples/Invoke-AzContainerInstanceCommand.md @@ -1,7 +1,9 @@ ### Example 1: Execute a command in a specific container instance ```powershell -PS C:\> Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" +Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" +``` +```output hello ``` diff --git a/src/ContainerInstance/examples/New-AzContainerGroup.md b/src/ContainerInstance/examples/New-AzContainerGroup.md index c09195e98229..7d9d691b7133 100644 --- a/src/ContainerInstance/examples/New-AzContainerGroup.md +++ b/src/ContainerInstance/examples/New-AzContainerGroup.md @@ -1,10 +1,12 @@ ### Example 1: Create a container group with a container instance and request a public IP address with opening ports ```powershell -PS C:\> $port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP -PS C:\> $port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public +$port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP +$port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP +$container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg @@ -14,11 +16,13 @@ This commands creates a container group with a container instance, whose image i ### Example 2: Create container group and runs a custom script inside the container. ```powershell -PS C:\> $env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" -PS C:\> $env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux +$env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" +$env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg @@ -28,9 +32,11 @@ This commands creates a container group and runs a custom script inside the cont ### Example 3: Create a run-to-completion container group ```powershell -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg @@ -40,10 +46,12 @@ This commands creates a container group which prints out 'hello' and stops. ### Example 4: Create a container group with a container instance using image nginx in Azure Container Registry ```powershell -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential +$container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg @@ -53,10 +61,12 @@ This commands creates a container group with a container instance, whose image i ### Example 5: Create a container group with a container instance using image nginx in custom container image Registry ```powershell -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential +$container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg @@ -66,10 +76,12 @@ This commands creates a container group with a container instance, whose image i ### Example 6: Create a container group that mounts Azure File volume ```powershell -PS C:\> $volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume +$volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg @@ -79,9 +91,11 @@ This commands creates a container group with a container instance, whose image i ### Example 7: Create a container group with system assigned and user assigned identity ```powershell -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg diff --git a/src/ContainerInstance/examples/New-AzContainerGroupImageRegistryCredentialObject.md b/src/ContainerInstance/examples/New-AzContainerGroupImageRegistryCredentialObject.md index 5100dd2bed90..6c0112f36f54 100644 --- a/src/ContainerInstance/examples/New-AzContainerGroupImageRegistryCredentialObject.md +++ b/src/ContainerInstance/examples/New-AzContainerGroupImageRegistryCredentialObject.md @@ -1,8 +1,9 @@ ### Example 1: Set up an image registry credential to create a container group ```powershell -PS C:\> New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "******" -AsPlainText -Force) - +New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "******" -AsPlainText -Force) +``` +```output Password Server Username -------- ------ -------- ****** myserver.com username diff --git a/src/ContainerInstance/examples/New-AzContainerGroupPortObject.md b/src/ContainerInstance/examples/New-AzContainerGroupPortObject.md index 86031ec7dbb7..f913a54dd196 100644 --- a/src/ContainerInstance/examples/New-AzContainerGroupPortObject.md +++ b/src/ContainerInstance/examples/New-AzContainerGroupPortObject.md @@ -1,7 +1,9 @@ ### Example 1: Specify port 8000 exposed on a container group with TCP protocol ```powershell -PS C:\> New-AzContainerGroupPortObject -Port 8000 -Protocol TCP +New-AzContainerGroupPortObject -Port 8000 -Protocol TCP +``` +```output Port1 Protocol ----- -------- 8000 TCP diff --git a/src/ContainerInstance/examples/New-AzContainerGroupVolumeObject.md b/src/ContainerInstance/examples/New-AzContainerGroupVolumeObject.md index aea749da47f3..cd61eb14fecd 100644 --- a/src/ContainerInstance/examples/New-AzContainerGroupVolumeObject.md +++ b/src/ContainerInstance/examples/New-AzContainerGroupVolumeObject.md @@ -1,12 +1,34 @@ ### Example 1: Create a Azure File volume ```powershell -PS C:\> New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "******" -AsPlainText -Force) - -****** +New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "******" -AsPlainText -Force) +``` +```output Name ---- myvolume ``` -This command creates a Azure File volume. \ No newline at end of file +This command creates a Azure File volume. + +### Example 2: Create an empty directory volume +```powershell +New-AzContainerGroupVolumeObject -Name "emptyvolume" -EmptyDir @{} | fl +``` + +```output +AzureFileReadOnly : +AzureFileShareName : +AzureFileStorageAccountKey : +AzureFileStorageAccountName : +EmptyDir : { + } +GitRepoDirectory : +GitRepoRepository : +GitRepoRevision : +Name : emptyvolume +Secret : { + } +``` + +This command creates an empty directory volume. \ No newline at end of file diff --git a/src/ContainerInstance/examples/New-AzContainerInstanceEnvironmentVariableObject.md b/src/ContainerInstance/examples/New-AzContainerInstanceEnvironmentVariableObject.md index 914eb6261cd6..484ee282ae5f 100644 --- a/src/ContainerInstance/examples/New-AzContainerInstanceEnvironmentVariableObject.md +++ b/src/ContainerInstance/examples/New-AzContainerInstanceEnvironmentVariableObject.md @@ -1,7 +1,9 @@ ### Example 1: Create an environment variable within a container instance ```powershell -PS C:\> New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" +New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" +``` +```output Name SecureValue Value ---- ----------- ----- env1 value1 @@ -11,8 +13,10 @@ This command creates an environment variable within a container instance. ### Example 2: Create a secure environment variable within a container instance ```powershell -PS C:\> New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "******" -AsPlainText -Force) +New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "******" -AsPlainText -Force) +``` +```output Name SecureValue Value ---- ----------- ----- env2 ****** diff --git a/src/ContainerInstance/examples/New-AzContainerInstanceHttpHeaderObject.md b/src/ContainerInstance/examples/New-AzContainerInstanceHttpHeaderObject.md index 902313c06d4a..9e9e0ec00686 100644 --- a/src/ContainerInstance/examples/New-AzContainerInstanceHttpHeaderObject.md +++ b/src/ContainerInstance/examples/New-AzContainerInstanceHttpHeaderObject.md @@ -1,7 +1,9 @@ ### Example 1: Create an HTTP Header object ```powershell -PS C:\> New-AzContainerInstanceHttpHeaderObject -name foo -value bar +New-AzContainerInstanceHttpHeaderObject -name foo -value bar +``` +```output Name Value ---- ----- foo bar diff --git a/src/ContainerInstance/examples/New-AzContainerInstanceInitDefinitionObject.md b/src/ContainerInstance/examples/New-AzContainerInstanceInitDefinitionObject.md index 4c30f5223569..2f76ccb9edff 100644 --- a/src/ContainerInstance/examples/New-AzContainerInstanceInitDefinitionObject.md +++ b/src/ContainerInstance/examples/New-AzContainerInstanceInitDefinitionObject.md @@ -1,7 +1,9 @@ ### Example 1: Set up the init container definition ```powershell -PS C:\> New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh" +New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh" +``` +```output Name ---- initDefinition diff --git a/src/ContainerInstance/examples/New-AzContainerInstanceObject.md b/src/ContainerInstance/examples/New-AzContainerInstanceObject.md index a4114ef23017..f336e7c4e7d1 100644 --- a/src/ContainerInstance/examples/New-AzContainerInstanceObject.md +++ b/src/ContainerInstance/examples/New-AzContainerInstanceObject.md @@ -1,7 +1,9 @@ ### Example 1: Create a container instance using image alphine with request cpu 1.0 and request memory 1.5Gb ```powershell -PS C:\> New-AzContainerInstanceObject -Name "test-container" -Image alpine -RequestCpu 1 -RequestMemoryInGb 1.5 +New-AzContainerInstanceObject -Name "test-container" -Image alpine -RequestCpu 1 -RequestMemoryInGb 1.5 +``` +```output Name ---- test-container @@ -11,8 +13,10 @@ Create a container instance using image alphine with request cpu 1.0 and request ### Example 2: Create a container instance using image alphine with limit cpu 2.0 and limit memory 2.5Gb ```powershell -PS C:\> New-AzContainerInstanceObject -Image alpine -Name "test-container" -LimitCpu 2 -LimitMemoryInGb 2.5 +New-AzContainerInstanceObject -Image alpine -Name "test-container" -LimitCpu 2 -LimitMemoryInGb 2.5 +``` +```output Name ---- test-container @@ -22,9 +26,11 @@ Create a container instance using image alphine with limit cpu 2.0 and limit mem ### Example 3: Create a container group with a container instance ```powershell -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> New-AzContainerGroup -ResourceGroupName testrg-rg -Name test-cg -Location eastus -Container $container +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +New-AzContainerGroup -ResourceGroupName testrg-rg -Name test-cg -Location eastus -Container $container +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg diff --git a/src/ContainerInstance/examples/New-AzContainerInstancePortObject.md b/src/ContainerInstance/examples/New-AzContainerInstancePortObject.md index b8f9c3fb61e4..577342999315 100644 --- a/src/ContainerInstance/examples/New-AzContainerInstancePortObject.md +++ b/src/ContainerInstance/examples/New-AzContainerInstancePortObject.md @@ -1,7 +1,9 @@ ### Example 1: Specify port 8000 exposed on a container instance with TCP protocol ```powershell -PS C:\> New-AzContainerInstancePortObject -Port 8000 -Protocol TCP +New-AzContainerInstancePortObject -Port 8000 -Protocol TCP +``` +```output Port Protocol ----- -------- 8000 TCP diff --git a/src/ContainerInstance/examples/New-AzContainerInstanceVolumeMountObject.md b/src/ContainerInstance/examples/New-AzContainerInstanceVolumeMountObject.md index e5e44fbc7dc4..1eec508c1f88 100644 --- a/src/ContainerInstance/examples/New-AzContainerInstanceVolumeMountObject.md +++ b/src/ContainerInstance/examples/New-AzContainerInstanceVolumeMountObject.md @@ -1,8 +1,10 @@ ### Example 1: Specify a volume mount available to a container instance ```powershell -PS C:\> New-AzContainerInstanceVolumeMountObject -Name +New-AzContainerInstanceVolumeMountObject -Name "mnt" -MountPath "/mnt/azfile" -ReadOnly $true +``` +```output MountPath Name ReadOnly --------- ---- -------- /mnt/azfile mnt True diff --git a/src/ContainerInstance/examples/Remove-AzContainerGroup.md b/src/ContainerInstance/examples/Remove-AzContainerGroup.md index ba7a3018347f..51d88ba009f5 100644 --- a/src/ContainerInstance/examples/Remove-AzContainerGroup.md +++ b/src/ContainerInstance/examples/Remove-AzContainerGroup.md @@ -1,7 +1,9 @@ ### Example 1: Remove a container group ```powershell -PS C:\> Remove-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Remove-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg @@ -11,8 +13,10 @@ This command removes the specified container group. ### Example 2: Removes a container group by piping ```powershell -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName bez-rg | Remove-AzContainerGroup +Get-AzContainerGroup -Name test-cg -ResourceGroupName bez-rg | Remove-AzContainerGroup +``` +```output Location Name Zone ResourceGroupName -------- ---- ---- ----------------- eastus test-cg test-rg diff --git a/src/ContainerInstance/examples/Restart-AzContainerGroup.md b/src/ContainerInstance/examples/Restart-AzContainerGroup.md index 3f09de6d54a4..a1c70793afce 100644 --- a/src/ContainerInstance/examples/Restart-AzContainerGroup.md +++ b/src/ContainerInstance/examples/Restart-AzContainerGroup.md @@ -1,13 +1,13 @@ ### Example 1: Restart all containers in a container group ```powershell -PS C:\> Restart-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Restart-AzContainerGroup -Name test-cg -ResourceGroupName test-rg ``` This command restarts all containers in a container group. ### Example 2: Restart all containers in a container group by piping ```powershell -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Restart-AzContainerGroup +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Restart-AzContainerGroup ``` This command restarts all containers in a container group by piping. diff --git a/src/ContainerInstance/examples/Start-AzContainerGroup.md b/src/ContainerInstance/examples/Start-AzContainerGroup.md index 602a39096116..aa41886c311a 100644 --- a/src/ContainerInstance/examples/Start-AzContainerGroup.md +++ b/src/ContainerInstance/examples/Start-AzContainerGroup.md @@ -1,14 +1,13 @@ ### Example 1: Start all containers in a container group ```powershell -PS C:\> start-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Start-AzContainerGroup -Name test-cg -ResourceGroupName test-rg ``` This command starts all containers in a container group. ### Example 2: Start all containers in a container group by piping ```powershell -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Start-AzContainerGroup - +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Start-AzContainerGroup ``` This command starts all containers in a container group by piping. diff --git a/src/ContainerInstance/examples/Stop-AzContainerGroup.md b/src/ContainerInstance/examples/Stop-AzContainerGroup.md index 96652fcbe591..2331e2f2b249 100644 --- a/src/ContainerInstance/examples/Stop-AzContainerGroup.md +++ b/src/ContainerInstance/examples/Stop-AzContainerGroup.md @@ -1,13 +1,13 @@ ### Example 1: Stop all containers in a container group ```powershell -PS C:\> Stop-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Stop-AzContainerGroup -Name test-cg -ResourceGroupName test-rg ``` This command stops all containers in a container group. Compute resources will be deallocated and billing will stop. ### Example 2: Stop all containers in a container group by piping ```powershell -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Stop-AzContainerGroup +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Stop-AzContainerGroup ``` This command stops all containers in a container group by piping. diff --git a/src/ContainerInstance/examples/Update-AzContainerGroup.md b/src/ContainerInstance/examples/Update-AzContainerGroup.md index 79908e948049..c74a9371db5b 100644 --- a/src/ContainerInstance/examples/Update-AzContainerGroup.md +++ b/src/ContainerInstance/examples/Update-AzContainerGroup.md @@ -1,8 +1,10 @@ ### Example 1: Update a container group ```powershell -PS C:\> $container = Update-AzContainerGroup -Name test-cg -ResourceGroupName test-rg -Tag @{"k"="v"} -PS C:\> $container.Tag | fl +$container = Update-AzContainerGroup -Name test-cg -ResourceGroupName test-rg -Tag @{"k"="v"} +$container.Tag | Format-List +``` +```output Keys : {k} Values : {v} AdditionalProperties : {[k, v]} @@ -13,9 +15,11 @@ This command updates a container group. ### Example 2: Update a container group using piping ```powershell -PS C:\> $container = Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Update-AzContainerGroup -Tag @{"k"="v"} -PS C:\> $container.Tag | fl +$container = Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Update-AzContainerGroup -Tag @{"k"="v"} +$container.Tag | Format-List +``` +```output Keys : {k} Values : {v} AdditionalProperties : {[k, v]} diff --git a/src/ContainerInstance/exports/Add-AzContainerInstanceOutput.ps1 b/src/ContainerInstance/exports/Add-AzContainerInstanceOutput.ps1 index c740ff795de4..828166adc690 100644 --- a/src/ContainerInstance/exports/Add-AzContainerInstanceOutput.ps1 +++ b/src/ContainerInstance/exports/Add-AzContainerInstanceOutput.ps1 @@ -20,11 +20,8 @@ Attach to the output stream of a specific container instance in a specified reso .Description Attach to the output stream of a specific container instance in a specified resource group and container group. .Example -PS C:\> $response = Add-AzContainerInstanceOutput -GroupName test-cg -Name test-container -ResourceGroupName test-rg -PS C:\> $response -Password WebSocketUri --------- ------------ -****************** wss://********.eastus.atlas.cloudapp.azure.com:19390/logstream/sessionId/00000000-0000-0000-0000-000000000000?api-version=1.0 +$response = Add-AzContainerInstanceOutput -GroupName test-cg -Name test-container -ResourceGroupName test-rg +$response .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IContainerAttachResponse @@ -118,6 +115,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ Attach = 'Az.ContainerInstance.private\Add-AzContainerInstanceOutput_Attach'; } @@ -131,6 +146,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -139,15 +155,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Get-AzContainerGroup.ps1 b/src/ContainerInstance/exports/Get-AzContainerGroup.ps1 index 360aaf13ba31..c646acee5ec4 100644 --- a/src/ContainerInstance/exports/Get-AzContainerGroup.ps1 +++ b/src/ContainerInstance/exports/Get-AzContainerGroup.ps1 @@ -22,77 +22,13 @@ The operation returns the properties of each container group including container Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. .Example -PS C:\> Get-AzContainerGroup - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg1 test-rg -eastus test-cg2 test-rg +Get-AzContainerGroup .Example -PS C:\> Get-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg | fl - - -Container : {test-container1} -DnsConfigNameServer : -DnsConfigOption : -DnsConfigSearchDomain : -EncryptionPropertyKeyName : -EncryptionPropertyKeyVersion : -EncryptionPropertyVaultBaseUrl : -IPAddressDnsNameLabel : -IPAddressFqdn : -IPAddressIP : 000.000.000.000 -IPAddressPort : {Microsoft.Azure.PowerShell.Cmdlets.ContainerInsta - nce.Models.Api20210301.Port, Microsoft.Azure.Power - Shell.Cmdlets.ContainerInstance.Models.Api20210301 - .Port} -IPAddressType : Public -Id : /subscriptions/00000000-0000-0000-0000-000000000000 - 0/resourceGroups/test-rg/providers/Microsoft.Contai - nerInstance/containerGroups/test-cg1 -IdentityPrincipalId : -IdentityTenantId : -IdentityType : -IdentityUserAssignedIdentity : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan - ce.Models.Api20210301.ContainerGroupIdentityUserAs - signedIdentities -ImageRegistryCredentials : -InitContainer : {} -InstanceViewEvent : -InstanceViewState : -Location : eastus -LogAnalyticLogType : -LogAnalyticMetadata : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan - ce.Models.Api20210301.LogAnalyticsMetadata -LogAnalyticWorkspaceId : -LogAnalyticWorkspaceKey : -LogAnalyticWorkspaceResourceId : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan - ce.Models.Api20210301.LogAnalyticsWorkspaceResourc - eId -Name : test-cg1 -NetworkProfileId : -OSType : Linux -ProvisioningState : Succeeded -ResourceGroupName : test-rg -RestartPolicy : Never -Sku : Standard -Tag : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan - ce.Models.Api20210301.ResourceTags -Type : Microsoft.ContainerInstance/containerGroups -Volume : +Get-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg | Format-List .Example -PS C:\> Get-AzContainerGroup -ResourceGroupName test-rg - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg1 test-rg -eastus test-cg2 test-rg +Get-AzContainerGroup -ResourceGroupName test-rg .Example -PS C:\> Update-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg -Tag @{"test"="value"} | Get-AzContainerGroup - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg1 test-rg +Update-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg -Tag @{"test"="value"} | Get-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -203,6 +139,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.private\Get-AzContainerGroup_Get'; GetViaIdentity = 'Az.ContainerInstance.private\Get-AzContainerGroup_GetViaIdentity'; @@ -219,6 +173,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -227,15 +182,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Get-AzContainerInstanceCachedImage.ps1 b/src/ContainerInstance/exports/Get-AzContainerInstanceCachedImage.ps1 index 38efe2c053dd..7691dff989bc 100644 --- a/src/ContainerInstance/exports/Get-AzContainerInstanceCachedImage.ps1 +++ b/src/ContainerInstance/exports/Get-AzContainerInstanceCachedImage.ps1 @@ -20,14 +20,7 @@ Get the list of cached images on specific OS type for a subscription in a region .Description Get the list of cached images on specific OS type for a subscription in a region. .Example -PS C:\> Get-AzContainerInstanceCachedImage -Location eastus - -Image OSType ------ ------ -microsoft/dotnet-framework:4.7.2-runtime-20181211-windowsservercore-ltsc2016 Windows -microsoft/dotnet-framework:4.7.2-runtime-20190108-windowsservercore-ltsc2016 Windows -microsoft/dotnet-framework:4.7.2-runtime-20190212-windowsservercore-ltsc2016 Windows -... +Get-AzContainerInstanceCachedImage -Location eastus .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ICachedImages @@ -107,6 +100,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceCachedImage_List'; } @@ -120,6 +131,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -128,15 +140,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Get-AzContainerInstanceCapability.ps1 b/src/ContainerInstance/exports/Get-AzContainerInstanceCapability.ps1 index 464ea09dcedd..e04f320f4615 100644 --- a/src/ContainerInstance/exports/Get-AzContainerInstanceCapability.ps1 +++ b/src/ContainerInstance/exports/Get-AzContainerInstanceCapability.ps1 @@ -20,18 +20,7 @@ Get the list of CPU/memory/GPU capabilities of a region. .Description Get the list of CPU/memory/GPU capabilities of a region. .Example -PS C:\> Get-AzContainerInstanceCapability -Location eastus - -Gpu IPAddressType Location OSType ResourceType ---- ------------- -------- ------ ------------ -None Public eastus NotSpecified containerGroups -None Private eastus NotSpecified containerGroups -None Public EASTUS Linux containerGroups -None Private EASTUS Linux containerGroups -K80 Public EASTUS Linux containerGroups -P100 Public EASTUS Linux containerGroups -V100 Public EASTUS Linux containerGroups -None Public EASTUS Windows containerGroups +Get-AzContainerInstanceCapability -Location eastus .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ICapabilities @@ -111,6 +100,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceCapability_List'; } @@ -124,6 +131,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -132,15 +140,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint.ps1 b/src/ContainerInstance/exports/Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint.ps1 index af25f8e20ee2..cea9bdf3a1f9 100644 --- a/src/ContainerInstance/exports/Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint.ps1 +++ b/src/ContainerInstance/exports/Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint.ps1 @@ -22,9 +22,7 @@ For container groups, this will always be an empty list. Gets all the network dependencies for this container group to allow complete control of network setting and configuration. For container groups, this will always be an empty list. .Example -PS C:\> Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint -ResourceGroupName test-rg -ContainerGroupName test-cg - -[] +Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint -ResourceGroupName test-rg -ContainerGroupName test-cg .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -132,6 +130,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.private\Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_Get'; GetViaIdentity = 'Az.ContainerInstance.private\Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_GetViaIdentity'; @@ -146,6 +162,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -154,15 +171,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Get-AzContainerInstanceLog.ps1 b/src/ContainerInstance/exports/Get-AzContainerInstanceLog.ps1 index 564856e70390..f9dee03e5c1d 100644 --- a/src/ContainerInstance/exports/Get-AzContainerInstanceLog.ps1 +++ b/src/ContainerInstance/exports/Get-AzContainerInstanceLog.ps1 @@ -20,21 +20,9 @@ Get the logs for a specified container instance in a specified resource group an .Description Get the logs for a specified container instance in a specified resource group and container group. .Example -PS C:\> Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg - -/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration -/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ -/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh -10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf -10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf -/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh -/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh -/docker-entrypoint.sh: Configuration complete; ready for start up +Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Tail 2 - -/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh -/docker-entrypoint.sh: Configuration complete; ready for start up +Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Tail 2 .Outputs System.String @@ -140,6 +128,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceLog_List'; } @@ -153,6 +159,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -161,15 +168,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Get-AzContainerInstanceUsage.ps1 b/src/ContainerInstance/exports/Get-AzContainerInstanceUsage.ps1 index d8314dd88669..7a15413f56a6 100644 --- a/src/ContainerInstance/exports/Get-AzContainerInstanceUsage.ps1 +++ b/src/ContainerInstance/exports/Get-AzContainerInstanceUsage.ps1 @@ -20,17 +20,7 @@ Get the usage for a subscription .Description Get the usage for a subscription .Example -PS C:\> Get-AzContainerInstanceUsage -Location eastus - -CurrentValue Limit Unit ------------- ----- ---- -9 100 Count -9 100 Count -1 48 Count -0 0 Count -0 0 Count -0 0 Count -0 3000 Count +Get-AzContainerInstanceUsage -Location eastus .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IUsage @@ -110,6 +100,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceUsage_List'; } @@ -123,6 +131,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -131,15 +140,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Invoke-AzContainerInstanceCommand.ps1 b/src/ContainerInstance/exports/Invoke-AzContainerInstanceCommand.ps1 index be1c4478bd4c..2f0f926b80de 100644 --- a/src/ContainerInstance/exports/Invoke-AzContainerInstanceCommand.ps1 +++ b/src/ContainerInstance/exports/Invoke-AzContainerInstanceCommand.ps1 @@ -20,9 +20,7 @@ Executes a command for a specific container instance in a specified resource gro .Description Executes a command for a specific container instance in a specified resource group and container group. .Example -PS C:\> Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" - -hello +Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" .Outputs System.String @@ -141,6 +139,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ ExecuteExpanded = 'Az.ContainerInstance.custom\Invoke-AzContainerInstanceCommand'; } @@ -160,6 +176,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -168,15 +185,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerGroup.ps1 b/src/ContainerInstance/exports/New-AzContainerGroup.ps1 index d7e84ff2dcaa..29d9838dfe3c 100644 --- a/src/ContainerInstance/exports/New-AzContainerGroup.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerGroup.ps1 @@ -20,61 +20,33 @@ Create or update container groups with specified configurations. .Description Create or update container groups with specified configurations. .Example -PS C:\> $port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP -PS C:\> $port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP +$port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP +$container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public .Example -PS C:\> $env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" -PS C:\> $env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" +$env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential .Example -PS C:\> $volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IContainerGroup @@ -163,7 +135,8 @@ VOLUME : The list of volumes that can be mounted by containers in thi [AzureFileShareName ]: The name of the Azure File share to be mounted as a volume. [AzureFileStorageAccountKey ]: The storage account access key used to access the Azure File share. [AzureFileStorageAccountName ]: The name of the storage account that contains the Azure File share. - [EmptyDir ]: The empty directory volume. + [EmptyDir ]: The empty directory volume. + [(Any) ]: This indicates any property can be added to this object. [GitRepoDirectory ]: Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. [GitRepoRepository ]: Repository URL [GitRepoRevision ]: Commit hash for the specified revision. @@ -460,6 +433,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ CreateExpanded = 'Az.ContainerInstance.custom\New-AzContainerGroup'; } @@ -476,6 +467,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -484,15 +476,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerGroupImageRegistryCredentialObject.ps1 b/src/ContainerInstance/exports/New-AzContainerGroupImageRegistryCredentialObject.ps1 index 99d340196210..d15c61714f5b 100644 --- a/src/ContainerInstance/exports/New-AzContainerGroupImageRegistryCredentialObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerGroupImageRegistryCredentialObject.ps1 @@ -20,12 +20,7 @@ Create a in-memory object for ImageRegistryCredential .Description Create a in-memory object for ImageRegistryCredential .Example -PS C:\> New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "******" -AsPlainText -Force) - - -Password Server Username --------- ------ -------- -****** myserver.com username +New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "******" -AsPlainText -Force) .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ImageRegistryCredential @@ -68,6 +63,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerGroupImageRegistryCredentialObject'; } @@ -78,6 +91,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -86,15 +100,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerGroupPortObject.ps1 b/src/ContainerInstance/exports/New-AzContainerGroupPortObject.ps1 index d99e7cb236a9..e56d7309ba82 100644 --- a/src/ContainerInstance/exports/New-AzContainerGroupPortObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerGroupPortObject.ps1 @@ -20,11 +20,7 @@ Create a in-memory object for Port .Description Create a in-memory object for Port .Example -PS C:\> New-AzContainerGroupPortObject -Port 8000 -Protocol TCP - -Port1 Protocol ------ -------- -8000 TCP +New-AzContainerGroupPortObject -Port 8000 -Protocol TCP .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Port @@ -56,6 +52,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerGroupPortObject'; } @@ -66,6 +80,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -74,15 +89,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerGroupVolumeObject.ps1 b/src/ContainerInstance/exports/New-AzContainerGroupVolumeObject.ps1 index 9d808248eea7..75f617ebb868 100644 --- a/src/ContainerInstance/exports/New-AzContainerGroupVolumeObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerGroupVolumeObject.ps1 @@ -16,20 +16,26 @@ <# .Synopsis -Create a in-memory object for Volume +Create an in-memory object for Volume. .Description -Create a in-memory object for Volume +Create an in-memory object for Volume. .Example -PS C:\> New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "******" -AsPlainText -Force) - -****** - -Name ----- -myvolume +New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "******" -AsPlainText -Force) +.Example +New-AzContainerGroupVolumeObject -Name "emptyvolume" -EmptyDir @{} | fl .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Volume +.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. + +EMPTYDIR : The empty directory volume. + [(Any) ]: This indicates any property can be added to this object. + +SECRET : The secret volume. + [(Any) ]: This indicates any property can be added to this object. .Link https://docs.microsoft.com/powershell/module/az.ContainerInstance/new-AzContainerGroupVolumeObject #> @@ -67,6 +73,13 @@ param( # The name of the storage account that contains the Azure File share. ${AzureFileStorageAccountName}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir] + # The empty directory volume. + # To construct, see NOTES section for EMPTYDIR properties and create a hash table. + ${EmptyDir}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Category('Body')] [System.String] @@ -86,7 +99,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Category('Body')] [System.String] # Commit hash for the specified revision. - ${GitRepoRevision} + ${GitRepoRevision}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ISecretVolume] + # The secret volume. + # To construct, see NOTES section for SECRET properties and create a hash table. + ${Secret} ) begin { @@ -96,6 +116,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerGroupVolumeObject'; } @@ -106,6 +144,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -114,15 +153,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerInstanceEnvironmentVariableObject.ps1 b/src/ContainerInstance/exports/New-AzContainerInstanceEnvironmentVariableObject.ps1 index 33f79113d9cc..b9775fe5c76d 100644 --- a/src/ContainerInstance/exports/New-AzContainerInstanceEnvironmentVariableObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerInstanceEnvironmentVariableObject.ps1 @@ -20,17 +20,9 @@ Create a in-memory object for EnvironmentVariable .Description Create a in-memory object for EnvironmentVariable .Example -PS C:\> New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" - -Name SecureValue Value ----- ----------- ----- -env1 value1 +New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" .Example -PS C:\> New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "******" -AsPlainText -Force) - -Name SecureValue Value ----- ----------- ----- -env2 ****** +New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "******" -AsPlainText -Force) .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.EnvironmentVariable @@ -67,6 +59,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceEnvironmentVariableObject'; } @@ -77,6 +87,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -85,15 +96,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerInstanceHttpHeaderObject.ps1 b/src/ContainerInstance/exports/New-AzContainerInstanceHttpHeaderObject.ps1 index baf920f9d3ce..e33e44f12375 100644 --- a/src/ContainerInstance/exports/New-AzContainerInstanceHttpHeaderObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerInstanceHttpHeaderObject.ps1 @@ -20,11 +20,7 @@ Create a in-memory object for HttpHeader .Description Create a in-memory object for HttpHeader .Example -PS C:\> New-AzContainerInstanceHttpHeaderObject -name foo -value bar - -Name Value ----- ----- -foo bar +New-AzContainerInstanceHttpHeaderObject -name foo -value bar .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.HttpHeader @@ -55,6 +51,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceHttpHeaderObject'; } @@ -65,6 +79,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -73,15 +88,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerInstanceInitDefinitionObject.ps1 b/src/ContainerInstance/exports/New-AzContainerInstanceInitDefinitionObject.ps1 index 14035cc0811a..4810495f7bf2 100644 --- a/src/ContainerInstance/exports/New-AzContainerInstanceInitDefinitionObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerInstanceInitDefinitionObject.ps1 @@ -20,11 +20,7 @@ Create a in-memory object for InitContainerDefinition .Description Create a in-memory object for InitContainerDefinition .Example -PS C:\> New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh" - -Name ----- -initDefinition +New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh" .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.InitContainerDefinition @@ -89,6 +85,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceInitDefinitionObject'; } @@ -99,6 +113,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -107,15 +122,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerInstanceObject.ps1 b/src/ContainerInstance/exports/New-AzContainerInstanceObject.ps1 index bdf2d79e02d0..1098a43826aa 100644 --- a/src/ContainerInstance/exports/New-AzContainerInstanceObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerInstanceObject.ps1 @@ -20,24 +20,12 @@ Create a in-memory object for Container .Description Create a in-memory object for Container .Example -PS C:\> New-AzContainerInstanceObject -Name "test-container" -Image alpine -RequestCpu 1 -RequestMemoryInGb 1.5 - -Name ----- -test-container +New-AzContainerInstanceObject -Name "test-container" -Image alpine -RequestCpu 1 -RequestMemoryInGb 1.5 .Example -PS C:\> New-AzContainerInstanceObject -Image alpine -Name "test-container" -LimitCpu 2 -LimitMemoryInGb 2.5 - -Name ----- -test-container +New-AzContainerInstanceObject -Image alpine -Name "test-container" -LimitCpu 2 -LimitMemoryInGb 2.5 .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> New-AzContainerGroup -ResourceGroupName testrg-rg -Name test-cg -Location eastus -Container $container - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +New-AzContainerGroup -ResourceGroupName testrg-rg -Name test-cg -Location eastus -Container $container .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Container @@ -295,6 +283,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceObject'; } @@ -305,6 +311,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -313,15 +320,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerInstancePortObject.ps1 b/src/ContainerInstance/exports/New-AzContainerInstancePortObject.ps1 index 9aed707fde2c..2541e5c78b1e 100644 --- a/src/ContainerInstance/exports/New-AzContainerInstancePortObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerInstancePortObject.ps1 @@ -20,11 +20,7 @@ Create a in-memory object for ContainerPort .Description Create a in-memory object for ContainerPort .Example -PS C:\> New-AzContainerInstancePortObject -Port 8000 -Protocol TCP - -Port Protocol ------ -------- -8000 TCP +New-AzContainerInstancePortObject -Port 8000 -Protocol TCP .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ContainerPort @@ -56,6 +52,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstancePortObject'; } @@ -66,6 +80,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -74,15 +89,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/New-AzContainerInstanceVolumeMountObject.ps1 b/src/ContainerInstance/exports/New-AzContainerInstanceVolumeMountObject.ps1 index 1566aa288f11..1f8e4532982d 100644 --- a/src/ContainerInstance/exports/New-AzContainerInstanceVolumeMountObject.ps1 +++ b/src/ContainerInstance/exports/New-AzContainerInstanceVolumeMountObject.ps1 @@ -20,13 +20,9 @@ Create a in-memory object for VolumeMount .Description Create a in-memory object for VolumeMount .Example -PS C:\> New-AzContainerInstanceVolumeMountObject -Name +New-AzContainerInstanceVolumeMountObject -Name "mnt" -MountPath "/mnt/azfile" -ReadOnly $true -MountPath Name ReadOnly ---------- ---- -------- -/mnt/azfile mnt True - .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.VolumeMount .Link @@ -63,6 +59,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceVolumeMountObject'; } @@ -73,6 +87,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -81,15 +96,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/ProxyCmdletDefinitions.ps1 b/src/ContainerInstance/exports/ProxyCmdletDefinitions.ps1 index 635f0ea4edaa..1b42096049bd 100644 --- a/src/ContainerInstance/exports/ProxyCmdletDefinitions.ps1 +++ b/src/ContainerInstance/exports/ProxyCmdletDefinitions.ps1 @@ -20,11 +20,8 @@ Attach to the output stream of a specific container instance in a specified reso .Description Attach to the output stream of a specific container instance in a specified resource group and container group. .Example -PS C:\> $response = Add-AzContainerInstanceOutput -GroupName test-cg -Name test-container -ResourceGroupName test-rg -PS C:\> $response -Password WebSocketUri --------- ------------ -****************** wss://********.eastus.atlas.cloudapp.azure.com:19390/logstream/sessionId/00000000-0000-0000-0000-000000000000?api-version=1.0 +$response = Add-AzContainerInstanceOutput -GroupName test-cg -Name test-container -ResourceGroupName test-rg +$response .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IContainerAttachResponse @@ -118,6 +115,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ Attach = 'Az.ContainerInstance.private\Add-AzContainerInstanceOutput_Attach'; } @@ -131,6 +146,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -139,17 +155,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -160,77 +193,13 @@ The operation returns the properties of each container group including container Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. .Example -PS C:\> Get-AzContainerGroup - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg1 test-rg -eastus test-cg2 test-rg +Get-AzContainerGroup .Example -PS C:\> Get-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg | fl - - -Container : {test-container1} -DnsConfigNameServer : -DnsConfigOption : -DnsConfigSearchDomain : -EncryptionPropertyKeyName : -EncryptionPropertyKeyVersion : -EncryptionPropertyVaultBaseUrl : -IPAddressDnsNameLabel : -IPAddressFqdn : -IPAddressIP : 000.000.000.000 -IPAddressPort : {Microsoft.Azure.PowerShell.Cmdlets.ContainerInsta - nce.Models.Api20210301.Port, Microsoft.Azure.Power - Shell.Cmdlets.ContainerInstance.Models.Api20210301 - .Port} -IPAddressType : Public -Id : /subscriptions/00000000-0000-0000-0000-000000000000 - 0/resourceGroups/test-rg/providers/Microsoft.Contai - nerInstance/containerGroups/test-cg1 -IdentityPrincipalId : -IdentityTenantId : -IdentityType : -IdentityUserAssignedIdentity : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan - ce.Models.Api20210301.ContainerGroupIdentityUserAs - signedIdentities -ImageRegistryCredentials : -InitContainer : {} -InstanceViewEvent : -InstanceViewState : -Location : eastus -LogAnalyticLogType : -LogAnalyticMetadata : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan - ce.Models.Api20210301.LogAnalyticsMetadata -LogAnalyticWorkspaceId : -LogAnalyticWorkspaceKey : -LogAnalyticWorkspaceResourceId : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan - ce.Models.Api20210301.LogAnalyticsWorkspaceResourc - eId -Name : test-cg1 -NetworkProfileId : -OSType : Linux -ProvisioningState : Succeeded -ResourceGroupName : test-rg -RestartPolicy : Never -Sku : Standard -Tag : Microsoft.Azure.PowerShell.Cmdlets.ContainerInstan - ce.Models.Api20210301.ResourceTags -Type : Microsoft.ContainerInstance/containerGroups -Volume : +Get-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg | Format-List .Example -PS C:\> Get-AzContainerGroup -ResourceGroupName test-rg - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg1 test-rg -eastus test-cg2 test-rg +Get-AzContainerGroup -ResourceGroupName test-rg .Example -PS C:\> Update-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg -Tag @{"test"="value"} | Get-AzContainerGroup - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg1 test-rg +Update-AzContainerGroup -Name test-cg1 -ResourceGroupName test-rg -Tag @{"test"="value"} | Get-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -341,6 +310,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.private\Get-AzContainerGroup_Get'; GetViaIdentity = 'Az.ContainerInstance.private\Get-AzContainerGroup_GetViaIdentity'; @@ -357,6 +344,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -365,17 +353,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -384,14 +389,7 @@ Get the list of cached images on specific OS type for a subscription in a region .Description Get the list of cached images on specific OS type for a subscription in a region. .Example -PS C:\> Get-AzContainerInstanceCachedImage -Location eastus - -Image OSType ------ ------ -microsoft/dotnet-framework:4.7.2-runtime-20181211-windowsservercore-ltsc2016 Windows -microsoft/dotnet-framework:4.7.2-runtime-20190108-windowsservercore-ltsc2016 Windows -microsoft/dotnet-framework:4.7.2-runtime-20190212-windowsservercore-ltsc2016 Windows -... +Get-AzContainerInstanceCachedImage -Location eastus .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ICachedImages @@ -471,6 +469,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceCachedImage_List'; } @@ -484,6 +500,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -492,17 +509,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -511,18 +545,7 @@ Get the list of CPU/memory/GPU capabilities of a region. .Description Get the list of CPU/memory/GPU capabilities of a region. .Example -PS C:\> Get-AzContainerInstanceCapability -Location eastus - -Gpu IPAddressType Location OSType ResourceType ---- ------------- -------- ------ ------------ -None Public eastus NotSpecified containerGroups -None Private eastus NotSpecified containerGroups -None Public EASTUS Linux containerGroups -None Private EASTUS Linux containerGroups -K80 Public EASTUS Linux containerGroups -P100 Public EASTUS Linux containerGroups -V100 Public EASTUS Linux containerGroups -None Public EASTUS Windows containerGroups +Get-AzContainerInstanceCapability -Location eastus .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ICapabilities @@ -602,6 +625,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceCapability_List'; } @@ -615,6 +656,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -623,17 +665,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -644,9 +703,7 @@ For container groups, this will always be an empty list. Gets all the network dependencies for this container group to allow complete control of network setting and configuration. For container groups, this will always be an empty list. .Example -PS C:\> Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint -ResourceGroupName test-rg -ContainerGroupName test-cg - -[] +Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint -ResourceGroupName test-rg -ContainerGroupName test-cg .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -754,6 +811,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.private\Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_Get'; GetViaIdentity = 'Az.ContainerInstance.private\Get-AzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_GetViaIdentity'; @@ -768,6 +843,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -776,17 +852,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -795,21 +888,9 @@ Get the logs for a specified container instance in a specified resource group an .Description Get the logs for a specified container instance in a specified resource group and container group. .Example -PS C:\> Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg - -/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration -/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ -/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh -10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf -10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf -/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh -/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh -/docker-entrypoint.sh: Configuration complete; ready for start up +Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Tail 2 - -/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh -/docker-entrypoint.sh: Configuration complete; ready for start up +Get-AzContainerInstanceLog -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Tail 2 .Outputs System.String @@ -915,6 +996,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceLog_List'; } @@ -928,6 +1027,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -936,17 +1036,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -955,17 +1072,7 @@ Get the usage for a subscription .Description Get the usage for a subscription .Example -PS C:\> Get-AzContainerInstanceUsage -Location eastus - -CurrentValue Limit Unit ------------- ----- ---- -9 100 Count -9 100 Count -1 48 Count -0 0 Count -0 0 Count -0 0 Count -0 3000 Count +Get-AzContainerInstanceUsage -Location eastus .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IUsage @@ -1045,6 +1152,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceUsage_List'; } @@ -1058,6 +1183,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -1066,17 +1192,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -1087,17 +1230,9 @@ The operation does not delete other resources provided by the user, such as volu Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. .Example -PS C:\> Remove-AzContainerGroup -Name test-cg -ResourceGroupName test-rg - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +Remove-AzContainerGroup -Name test-cg -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName bez-rg | Remove-AzContainerGroup - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +Get-AzContainerGroup -Name test-cg -ResourceGroupName bez-rg | Remove-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -1223,6 +1358,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.private\Remove-AzContainerGroup_Delete'; DeleteViaIdentity = 'Az.ContainerInstance.private\Remove-AzContainerGroup_DeleteViaIdentity'; @@ -1237,6 +1390,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -1245,17 +1399,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -1266,9 +1437,9 @@ If container image has updates, new image will be downloaded. Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. .Example -PS C:\> Restart-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Restart-AzContainerGroup -Name test-cg -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Restart-AzContainerGroup +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Restart-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -1394,6 +1565,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ Restart = 'Az.ContainerInstance.private\Restart-AzContainerGroup_Restart'; RestartViaIdentity = 'Az.ContainerInstance.private\Restart-AzContainerGroup_RestartViaIdentity'; @@ -1408,6 +1597,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -1416,17 +1606,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -1437,10 +1644,9 @@ Compute resources will be allocated and billing will start. Starts all containers in a container group. Compute resources will be allocated and billing will start. .Example -PS C:\> start-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Start-AzContainerGroup -Name test-cg -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Start-AzContainerGroup - +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Start-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -1566,6 +1772,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ Start = 'Az.ContainerInstance.private\Start-AzContainerGroup_Start'; StartViaIdentity = 'Az.ContainerInstance.private\Start-AzContainerGroup_StartViaIdentity'; @@ -1580,6 +1804,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -1588,17 +1813,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -1609,9 +1851,9 @@ Compute resources will be deallocated and billing will stop. Stops all containers in a container group. Compute resources will be deallocated and billing will stop. .Example -PS C:\> Stop-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Stop-AzContainerGroup -Name test-cg -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Stop-AzContainerGroup +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Stop-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -1725,6 +1967,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ Stop = 'Az.ContainerInstance.private\Stop-AzContainerGroup_Stop'; StopViaIdentity = 'Az.ContainerInstance.private\Stop-AzContainerGroup_StopViaIdentity'; @@ -1739,6 +1999,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -1747,17 +2008,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -1766,21 +2044,11 @@ Updates container group tags with specified values. .Description Updates container group tags with specified values. .Example -PS C:\> $container = Update-AzContainerGroup -Name test-cg -ResourceGroupName test-rg -Tag @{"k"="v"} -PS C:\> $container.Tag | fl - -Keys : {k} -Values : {v} -AdditionalProperties : {[k, v]} -Count : 1 +$container = Update-AzContainerGroup -Name test-cg -ResourceGroupName test-rg -Tag @{"k"="v"} +$container.Tag | Format-List .Example -PS C:\> $container = Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Update-AzContainerGroup -Tag @{"k"="v"} -PS C:\> $container.Tag | fl - -Keys : {k} -Values : {v} -AdditionalProperties : {[k, v]} -Count : 1 +$container = Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Update-AzContainerGroup -Tag @{"k"="v"} +$container.Tag | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -1908,6 +2176,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ UpdateExpanded = 'Az.ContainerInstance.private\Update-AzContainerGroup_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ContainerInstance.private\Update-AzContainerGroup_UpdateViaIdentityExpanded'; @@ -1922,6 +2208,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -1930,17 +2217,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -1949,9 +2253,7 @@ Executes a command for a specific container instance in a specified resource gro .Description Executes a command for a specific container instance in a specified resource group and container group. .Example -PS C:\> Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" - -hello +Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" .Outputs System.String @@ -2070,6 +2372,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ ExecuteExpanded = 'Az.ContainerInstance.custom\Invoke-AzContainerInstanceCommand'; } @@ -2089,6 +2409,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -2097,17 +2418,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -2116,61 +2454,33 @@ Create or update container groups with specified configurations. .Description Create or update container groups with specified configurations. .Example -PS C:\> $port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP -PS C:\> $port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP +$port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP +$container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public .Example -PS C:\> $env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" -PS C:\> $env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" +$env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential .Example -PS C:\> $volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IContainerGroup @@ -2259,7 +2569,8 @@ VOLUME : The list of volumes that can be mounted by containers in thi [AzureFileShareName ]: The name of the Azure File share to be mounted as a volume. [AzureFileStorageAccountKey ]: The storage account access key used to access the Azure File share. [AzureFileStorageAccountName ]: The name of the storage account that contains the Azure File share. - [EmptyDir ]: The empty directory volume. + [EmptyDir ]: The empty directory volume. + [(Any) ]: This indicates any property can be added to this object. [GitRepoDirectory ]: Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. [GitRepoRepository ]: Repository URL [GitRepoRevision ]: Commit hash for the specified revision. @@ -2556,6 +2867,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ CreateExpanded = 'Az.ContainerInstance.custom\New-AzContainerGroup'; } @@ -2572,6 +2901,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -2580,17 +2910,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -2599,12 +2946,7 @@ Create a in-memory object for ImageRegistryCredential .Description Create a in-memory object for ImageRegistryCredential .Example -PS C:\> New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "******" -AsPlainText -Force) - - -Password Server Username --------- ------ -------- -****** myserver.com username +New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "******" -AsPlainText -Force) .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ImageRegistryCredential @@ -2647,6 +2989,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerGroupImageRegistryCredentialObject'; } @@ -2657,6 +3017,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -2665,17 +3026,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -2684,11 +3062,7 @@ Create a in-memory object for Port .Description Create a in-memory object for Port .Example -PS C:\> New-AzContainerGroupPortObject -Port 8000 -Protocol TCP - -Port1 Protocol ------ -------- -8000 TCP +New-AzContainerGroupPortObject -Port 8000 -Protocol TCP .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Port @@ -2720,6 +3094,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerGroupPortObject'; } @@ -2730,6 +3122,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -2738,35 +3131,58 @@ 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.ContainerInstance.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 a in-memory object for Volume +Create an in-memory object for Volume. .Description -Create a in-memory object for Volume +Create an in-memory object for Volume. .Example -PS C:\> New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "******" -AsPlainText -Force) - -****** - -Name ----- -myvolume +New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "******" -AsPlainText -Force) +.Example +New-AzContainerGroupVolumeObject -Name "emptyvolume" -EmptyDir @{} | fl .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Volume +.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. + +EMPTYDIR : The empty directory volume. + [(Any) ]: This indicates any property can be added to this object. + +SECRET : The secret volume. + [(Any) ]: This indicates any property can be added to this object. .Link https://docs.microsoft.com/powershell/module/az.ContainerInstance/new-AzContainerGroupVolumeObject #> @@ -2804,6 +3220,13 @@ param( # The name of the storage account that contains the Azure File share. ${AzureFileStorageAccountName}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir] + # The empty directory volume. + # To construct, see NOTES section for EMPTYDIR properties and create a hash table. + ${EmptyDir}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Category('Body')] [System.String] @@ -2823,7 +3246,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Category('Body')] [System.String] # Commit hash for the specified revision. - ${GitRepoRevision} + ${GitRepoRevision}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ISecretVolume] + # The secret volume. + # To construct, see NOTES section for SECRET properties and create a hash table. + ${Secret} ) begin { @@ -2833,6 +3263,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerGroupVolumeObject'; } @@ -2843,6 +3291,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -2851,17 +3300,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -2870,17 +3336,9 @@ Create a in-memory object for EnvironmentVariable .Description Create a in-memory object for EnvironmentVariable .Example -PS C:\> New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" - -Name SecureValue Value ----- ----------- ----- -env1 value1 +New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" .Example -PS C:\> New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "******" -AsPlainText -Force) - -Name SecureValue Value ----- ----------- ----- -env2 ****** +New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "******" -AsPlainText -Force) .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.EnvironmentVariable @@ -2917,6 +3375,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceEnvironmentVariableObject'; } @@ -2927,6 +3403,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -2935,17 +3412,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -2954,11 +3448,7 @@ Create a in-memory object for HttpHeader .Description Create a in-memory object for HttpHeader .Example -PS C:\> New-AzContainerInstanceHttpHeaderObject -name foo -value bar - -Name Value ----- ----- -foo bar +New-AzContainerInstanceHttpHeaderObject -name foo -value bar .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.HttpHeader @@ -2989,6 +3479,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceHttpHeaderObject'; } @@ -2999,6 +3507,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -3007,17 +3516,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -3026,11 +3552,7 @@ Create a in-memory object for InitContainerDefinition .Description Create a in-memory object for InitContainerDefinition .Example -PS C:\> New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh" - -Name ----- -initDefinition +New-AzContainerInstanceInitDefinitionObject -Name "initDefinition" -Command "/bin/sh -c myscript.sh" .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.InitContainerDefinition @@ -3095,6 +3617,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceInitDefinitionObject'; } @@ -3105,6 +3645,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -3113,17 +3654,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -3132,24 +3690,12 @@ Create a in-memory object for Container .Description Create a in-memory object for Container .Example -PS C:\> New-AzContainerInstanceObject -Name "test-container" -Image alpine -RequestCpu 1 -RequestMemoryInGb 1.5 - -Name ----- -test-container +New-AzContainerInstanceObject -Name "test-container" -Image alpine -RequestCpu 1 -RequestMemoryInGb 1.5 .Example -PS C:\> New-AzContainerInstanceObject -Image alpine -Name "test-container" -LimitCpu 2 -LimitMemoryInGb 2.5 - -Name ----- -test-container +New-AzContainerInstanceObject -Image alpine -Name "test-container" -LimitCpu 2 -LimitMemoryInGb 2.5 .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> New-AzContainerGroup -ResourceGroupName testrg-rg -Name test-cg -Location eastus -Container $container - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +New-AzContainerGroup -ResourceGroupName testrg-rg -Name test-cg -Location eastus -Container $container .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Container @@ -3407,6 +3953,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceObject'; } @@ -3417,6 +3981,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -3425,17 +3990,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -3444,11 +4026,7 @@ Create a in-memory object for ContainerPort .Description Create a in-memory object for ContainerPort .Example -PS C:\> New-AzContainerInstancePortObject -Port 8000 -Protocol TCP - -Port Protocol ------ -------- -8000 TCP +New-AzContainerInstancePortObject -Port 8000 -Protocol TCP .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ContainerPort @@ -3480,6 +4058,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstancePortObject'; } @@ -3490,6 +4086,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -3498,17 +4095,34 @@ 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.ContainerInstance.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 } -} +} } <# @@ -3517,13 +4131,9 @@ Create a in-memory object for VolumeMount .Description Create a in-memory object for VolumeMount .Example -PS C:\> New-AzContainerInstanceVolumeMountObject -Name +New-AzContainerInstanceVolumeMountObject -Name "mnt" -MountPath "/mnt/azfile" -ReadOnly $true -MountPath Name ReadOnly ---------- ---- -------- -/mnt/azfile mnt True - .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.VolumeMount .Link @@ -3560,6 +4170,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.custom\New-AzContainerInstanceVolumeMountObject'; } @@ -3570,6 +4198,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -3578,15 +4207,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Remove-AzContainerGroup.ps1 b/src/ContainerInstance/exports/Remove-AzContainerGroup.ps1 index a0e84cd69cd4..216e1c7625a3 100644 --- a/src/ContainerInstance/exports/Remove-AzContainerGroup.ps1 +++ b/src/ContainerInstance/exports/Remove-AzContainerGroup.ps1 @@ -22,17 +22,9 @@ The operation does not delete other resources provided by the user, such as volu Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. .Example -PS C:\> Remove-AzContainerGroup -Name test-cg -ResourceGroupName test-rg - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +Remove-AzContainerGroup -Name test-cg -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName bez-rg | Remove-AzContainerGroup - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +Get-AzContainerGroup -Name test-cg -ResourceGroupName bez-rg | Remove-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -158,6 +150,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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.ContainerInstance.private\Remove-AzContainerGroup_Delete'; DeleteViaIdentity = 'Az.ContainerInstance.private\Remove-AzContainerGroup_DeleteViaIdentity'; @@ -172,6 +182,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -180,15 +191,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Restart-AzContainerGroup.ps1 b/src/ContainerInstance/exports/Restart-AzContainerGroup.ps1 index c75859542a3f..1fe68a01a067 100644 --- a/src/ContainerInstance/exports/Restart-AzContainerGroup.ps1 +++ b/src/ContainerInstance/exports/Restart-AzContainerGroup.ps1 @@ -22,9 +22,9 @@ If container image has updates, new image will be downloaded. Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. .Example -PS C:\> Restart-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Restart-AzContainerGroup -Name test-cg -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Restart-AzContainerGroup +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Restart-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -150,6 +150,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ Restart = 'Az.ContainerInstance.private\Restart-AzContainerGroup_Restart'; RestartViaIdentity = 'Az.ContainerInstance.private\Restart-AzContainerGroup_RestartViaIdentity'; @@ -164,6 +182,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -172,15 +191,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Start-AzContainerGroup.ps1 b/src/ContainerInstance/exports/Start-AzContainerGroup.ps1 index ec893b36d9a7..6edc1663ca3c 100644 --- a/src/ContainerInstance/exports/Start-AzContainerGroup.ps1 +++ b/src/ContainerInstance/exports/Start-AzContainerGroup.ps1 @@ -22,10 +22,9 @@ Compute resources will be allocated and billing will start. Starts all containers in a container group. Compute resources will be allocated and billing will start. .Example -PS C:\> start-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Start-AzContainerGroup -Name test-cg -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Start-AzContainerGroup - +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Start-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -151,6 +150,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ Start = 'Az.ContainerInstance.private\Start-AzContainerGroup_Start'; StartViaIdentity = 'Az.ContainerInstance.private\Start-AzContainerGroup_StartViaIdentity'; @@ -165,6 +182,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -173,15 +191,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Stop-AzContainerGroup.ps1 b/src/ContainerInstance/exports/Stop-AzContainerGroup.ps1 index cdb90074bc73..9d5d5d710e3b 100644 --- a/src/ContainerInstance/exports/Stop-AzContainerGroup.ps1 +++ b/src/ContainerInstance/exports/Stop-AzContainerGroup.ps1 @@ -22,9 +22,9 @@ Compute resources will be deallocated and billing will stop. Stops all containers in a container group. Compute resources will be deallocated and billing will stop. .Example -PS C:\> Stop-AzContainerGroup -Name test-cg -ResourceGroupName test-rg +Stop-AzContainerGroup -Name test-cg -ResourceGroupName test-rg .Example -PS C:\> Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Stop-AzContainerGroup +Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Stop-AzContainerGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -138,6 +138,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ Stop = 'Az.ContainerInstance.private\Stop-AzContainerGroup_Stop'; StopViaIdentity = 'Az.ContainerInstance.private\Stop-AzContainerGroup_StopViaIdentity'; @@ -152,6 +170,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -160,15 +179,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/exports/Update-AzContainerGroup.ps1 b/src/ContainerInstance/exports/Update-AzContainerGroup.ps1 index 244124a94f70..252385948e18 100644 --- a/src/ContainerInstance/exports/Update-AzContainerGroup.ps1 +++ b/src/ContainerInstance/exports/Update-AzContainerGroup.ps1 @@ -20,21 +20,11 @@ Updates container group tags with specified values. .Description Updates container group tags with specified values. .Example -PS C:\> $container = Update-AzContainerGroup -Name test-cg -ResourceGroupName test-rg -Tag @{"k"="v"} -PS C:\> $container.Tag | fl - -Keys : {k} -Values : {v} -AdditionalProperties : {[k, v]} -Count : 1 +$container = Update-AzContainerGroup -Name test-cg -ResourceGroupName test-rg -Tag @{"k"="v"} +$container.Tag | Format-List .Example -PS C:\> $container = Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Update-AzContainerGroup -Tag @{"k"="v"} -PS C:\> $container.Tag | fl - -Keys : {k} -Values : {v} -AdditionalProperties : {[k, v]} -Count : 1 +$container = Get-AzContainerGroup -Name test-cg -ResourceGroupName test-rg | Update-AzContainerGroup -Tag @{"k"="v"} +$container.Tag | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IContainerInstanceIdentity @@ -162,6 +152,24 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.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 = @{ UpdateExpanded = 'Az.ContainerInstance.private\Update-AzContainerGroup_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ContainerInstance.private\Update-AzContainerGroup_UpdateViaIdentityExpanded'; @@ -176,6 +184,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } @@ -184,15 +193,32 @@ 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.ContainerInstance.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 } -} +} } diff --git a/src/ContainerInstance/generate-info.json b/src/ContainerInstance/generate-info.json index 658fa1ce5d76..270188f5138a 100644 --- a/src/ContainerInstance/generate-info.json +++ b/src/ContainerInstance/generate-info.json @@ -1,8 +1,8 @@ { - "autorest_powershell": "3.0.476", - "autorest_core": "3.7.6", + "swagger_commit": "f5b15e812e6e5228eaebf3b629a682a088afebd6", + "autorest_powershell": "3.0.482", "node": "v14.15.5", - "autorest": "`-- (empty)", - "swagger_commit": "efd3d669a86d2e123f57ac3a43e5af4bb9e3a29f", - "autorest_modelerfour": "4.15.414" + "autorest_modelerfour": "4.15.414", + "autorest_core": "3.8.3", + "autorest": "`-- (empty)" } diff --git a/src/ContainerInstance/generated/Module.cs b/src/ContainerInstance/generated/Module.cs index c9b3aaa8dba7..cd8eaa7fc242 100644 --- a/src/ContainerInstance/generated/Module.cs +++ b/src/ContainerInstance/generated/Module.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance using GetParameterDelegate = global::System.Func; using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; using ArgumentCompleterDelegate = global::System.Func; + using GetTelemetryIdDelegate = global::System.Func; + using TelemetryDelegate = global::System.Action; using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; @@ -46,6 +48,9 @@ public partial class Module /// The delegate to call to get parameter data from a common module. public GetParameterDelegate GetParameterValue { get; set; } + /// The delegate to get the telemetry Id. + public GetTelemetryIdDelegate GetTelemetryId { get; set; } + /// Backing field for property. private static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module _instance; @@ -67,6 +72,9 @@ public partial class Module /// The ResourceID for this module (azure arm). public string ResourceId => @"Az.ContainerInstance"; + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + /// The from the cmdlet /// The HttpPipeline for the request diff --git a/src/ContainerInstance/generated/api/Models/Api20210901/Volume.PowerShell.cs b/src/ContainerInstance/generated/api/Models/Api20210901/Volume.PowerShell.cs index 0b8bfd728c3f..534d7f7cc7ec 100644 --- a/src/ContainerInstance/generated/api/Models/Api20210901/Volume.PowerShell.cs +++ b/src/ContainerInstance/generated/api/Models/Api20210901/Volume.PowerShell.cs @@ -138,7 +138,7 @@ internal Volume(global::System.Collections.IDictionary content) } if (content.Contains("EmptyDir")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeInternal)this).EmptyDir = (Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny) content.GetValueForProperty("EmptyDir",((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeInternal)this).EmptyDir, Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeInternal)this).EmptyDir = (Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir) content.GetValueForProperty("EmptyDir",((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeInternal)this).EmptyDir, Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.VolumeEmptyDirTypeConverter.ConvertFrom); } if (content.Contains("Secret")) { @@ -203,7 +203,7 @@ internal Volume(global::System.Management.Automation.PSObject content) } if (content.Contains("EmptyDir")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeInternal)this).EmptyDir = (Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny) content.GetValueForProperty("EmptyDir",((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeInternal)this).EmptyDir, Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeInternal)this).EmptyDir = (Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir) content.GetValueForProperty("EmptyDir",((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeInternal)this).EmptyDir, Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.VolumeEmptyDirTypeConverter.ConvertFrom); } if (content.Contains("Secret")) { diff --git a/src/ContainerInstance/generated/api/Models/Api20210901/Volume.cs b/src/ContainerInstance/generated/api/Models/Api20210901/Volume.cs index 2855570ac551..5442386b5a8b 100644 --- a/src/ContainerInstance/generated/api/Models/Api20210901/Volume.cs +++ b/src/ContainerInstance/generated/api/Models/Api20210901/Volume.cs @@ -39,11 +39,11 @@ public partial class Volume : public string AzureFileStorageAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IAzureFileVolumeInternal)AzureFile).StorageAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IAzureFileVolumeInternal)AzureFile).StorageAccountName = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny _emptyDir; + private Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir _emptyDir; /// The empty directory volume. [Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Origin(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny EmptyDir { get => (this._emptyDir = this._emptyDir ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Any()); set => this._emptyDir = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir EmptyDir { get => (this._emptyDir = this._emptyDir ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.VolumeEmptyDir()); set => this._emptyDir = value; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IGitRepoVolume _gitRepo; @@ -137,8 +137,8 @@ public partial interface IVolume : ReadOnly = false, Description = @"The empty directory volume.", SerializedName = @"emptyDir", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny) })] - Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny EmptyDir { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir) })] + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir EmptyDir { get; set; } /// /// Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. /// Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. @@ -201,7 +201,7 @@ internal partial interface IVolumeInternal /// The name of the storage account that contains the Azure File share. string AzureFileStorageAccountName { get; set; } /// The empty directory volume. - Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny EmptyDir { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir EmptyDir { get; set; } /// The git repo volume. Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IGitRepoVolume GitRepo { get; set; } /// diff --git a/src/ContainerInstance/generated/api/Models/Api20210901/Volume.json.cs b/src/ContainerInstance/generated/api/Models/Api20210901/Volume.json.cs index 63662825fc0b..1a3cc8eeca60 100644 --- a/src/ContainerInstance/generated/api/Models/Api20210901/Volume.json.cs +++ b/src/ContainerInstance/generated/api/Models/Api20210901/Volume.json.cs @@ -106,7 +106,7 @@ internal Volume(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Jso {_azureFile = If( json?.PropertyT("azureFile"), out var __jsonAzureFile) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.AzureFileVolume.FromJson(__jsonAzureFile) : AzureFile;} {_gitRepo = If( json?.PropertyT("gitRepo"), out var __jsonGitRepo) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.GitRepoVolume.FromJson(__jsonGitRepo) : GitRepo;} {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_emptyDir = If( json?.PropertyT("emptyDir"), out var __jsonEmptyDir) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Any.FromJson(__jsonEmptyDir) : EmptyDir;} + {_emptyDir = If( json?.PropertyT("emptyDir"), out var __jsonEmptyDir) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.VolumeEmptyDir.FromJson(__jsonEmptyDir) : EmptyDir;} {_secret = If( json?.PropertyT("secret"), out var __jsonSecret) ? Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.SecretVolume.FromJson(__jsonSecret) : Secret;} AfterFromJson(json); } diff --git a/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.PowerShell.cs b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.PowerShell.cs new file mode 100644 index 000000000000..568f7b7f286d --- /dev/null +++ b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.PowerShell; + + /// The empty directory volume. + [System.ComponentModel.TypeConverter(typeof(VolumeEmptyDirTypeConverter))] + public partial class VolumeEmptyDir + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VolumeEmptyDir(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VolumeEmptyDir(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VolumeEmptyDir(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VolumeEmptyDir(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// The empty directory volume. + [System.ComponentModel.TypeConverter(typeof(VolumeEmptyDirTypeConverter))] + public partial interface IVolumeEmptyDir + + { + + } +} \ No newline at end of file diff --git a/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.TypeConverter.cs b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.TypeConverter.cs new file mode 100644 index 000000000000..99dc500116c6 --- /dev/null +++ b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901 +{ + using Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VolumeEmptyDirTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter to the parameter using and + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VolumeEmptyDir.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VolumeEmptyDir.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VolumeEmptyDir.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.cs b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.cs new file mode 100644 index 000000000000..9846b54e6230 --- /dev/null +++ b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Extensions; + + /// The empty directory volume. + public partial class VolumeEmptyDir : + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir, + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDirInternal + { + + /// Creates an new instance. + public VolumeEmptyDir() + { + + } + } + /// The empty directory volume. + public partial interface IVolumeEmptyDir : + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IAssociativeArray + { + + } + /// The empty directory volume. + internal partial interface IVolumeEmptyDirInternal + + { + + } +} \ No newline at end of file diff --git a/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.dictionary.cs b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.dictionary.cs new file mode 100644 index 000000000000..6f40579d443c --- /dev/null +++ b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Extensions; + + public partial class VolumeEmptyDir : + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public global::System.Object this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, global::System.Object value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out global::System.Object value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.VolumeEmptyDir source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.json.cs b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.json.cs new file mode 100644 index 000000000000..5b3819157906 --- /dev/null +++ b/src/ContainerInstance/generated/api/Models/Api20210901/VolumeEmptyDir.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Extensions; + + /// The empty directory volume. + public partial class VolumeEmptyDir + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir FromJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject json ? new VolumeEmptyDir(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject instance to deserialize from. + /// + internal VolumeEmptyDir(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/src/ContainerInstance/generated/cmdlets/AddAzContainerInstanceOutput_Attach.cs b/src/ContainerInstance/generated/cmdlets/AddAzContainerInstanceOutput_Attach.cs index 0b97646351ca..59da4985c01d 100644 --- a/src/ContainerInstance/generated/cmdlets/AddAzContainerInstanceOutput_Attach.cs +++ b/src/ContainerInstance/generated/cmdlets/AddAzContainerInstanceOutput_Attach.cs @@ -198,6 +198,11 @@ public AddAzContainerInstanceOutput_Attach() /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -209,7 +214,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -312,7 +317,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_Get.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_Get.cs index cc75581b3529..21fbb494959c 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_Get.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_Get.cs @@ -177,6 +177,11 @@ public partial class GetAzContainerGroup_Get : global::System.Management.Automat /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -188,7 +193,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -296,7 +301,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_GetViaIdentity.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_GetViaIdentity.cs index f6dcd5a86435..abd6ccb851d0 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_GetViaIdentity.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_GetViaIdentity.cs @@ -135,6 +135,11 @@ public partial class GetAzContainerGroup_GetViaIdentity : global::System.Managem /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -146,7 +151,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -254,7 +259,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_List.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_List.cs index a7a6e86ef558..18fabdc3dba3 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_List.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_List.cs @@ -153,6 +153,11 @@ public partial class GetAzContainerGroup_List : global::System.Management.Automa /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -164,7 +169,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -272,7 +277,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_List1.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_List1.cs index 47d8e6dc3279..2c1d383dc71c 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_List1.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerGroup_List1.cs @@ -168,6 +168,11 @@ public partial class GetAzContainerGroup_List1 : global::System.Management.Autom /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -179,7 +184,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -287,7 +292,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceCachedImage_List.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceCachedImage_List.cs index f3a290957ed7..5ef3e644d49d 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceCachedImage_List.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceCachedImage_List.cs @@ -166,6 +166,11 @@ public partial class GetAzContainerInstanceCachedImage_List : global::System.Man /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -177,7 +182,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -285,7 +290,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceCapability_List.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceCapability_List.cs index 3ace2fc8d0cd..bfd118d69df1 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceCapability_List.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceCapability_List.cs @@ -164,6 +164,11 @@ public partial class GetAzContainerInstanceCapability_List : global::System.Mana /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -175,7 +180,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -283,7 +288,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_Get.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_Get.cs index ae8d23b17d45..3b1da8487a2b 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_Get.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_Get.cs @@ -175,6 +175,11 @@ public partial class GetAzContainerInstanceContainerGroupOutboundNetworkDependen /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -186,7 +191,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -295,7 +300,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_GetViaIdentity.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_GetViaIdentity.cs index 1ff7561977c2..e4e5181ce477 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_GetViaIdentity.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceContainerGroupOutboundNetworkDependencyEndpoint_GetViaIdentity.cs @@ -134,6 +134,11 @@ public partial class GetAzContainerInstanceContainerGroupOutboundNetworkDependen /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -145,7 +150,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -254,7 +259,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceLog_List.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceLog_List.cs index ecb27ef5f6bf..817ad4f68c63 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceLog_List.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceLog_List.cs @@ -221,6 +221,11 @@ public partial class GetAzContainerInstanceLog_List : global::System.Management. /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -232,7 +237,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -340,7 +345,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceOperation_List.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceOperation_List.cs index 8d84dc2f4f11..c647ef774621 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceOperation_List.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceOperation_List.cs @@ -130,6 +130,11 @@ public partial class GetAzContainerInstanceOperation_List : global::System.Manag /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -141,7 +146,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -249,7 +254,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceUsage_List.cs b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceUsage_List.cs index 8eb51cff4b8d..02d3945a4476 100644 --- a/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceUsage_List.cs +++ b/src/ContainerInstance/generated/cmdlets/GetAzContainerInstanceUsage_List.cs @@ -158,6 +158,11 @@ public partial class GetAzContainerInstanceUsage_List : global::System.Managemen /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -169,7 +174,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -277,7 +282,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/InvokeAzContainerInstanceCommand_ExecuteExpanded.cs b/src/ContainerInstance/generated/cmdlets/InvokeAzContainerInstanceCommand_ExecuteExpanded.cs index 7f78f25a6e59..e697f89cee47 100644 --- a/src/ContainerInstance/generated/cmdlets/InvokeAzContainerInstanceCommand_ExecuteExpanded.cs +++ b/src/ContainerInstance/generated/cmdlets/InvokeAzContainerInstanceCommand_ExecuteExpanded.cs @@ -236,6 +236,11 @@ public partial class InvokeAzContainerInstanceCommand_ExecuteExpanded : global:: /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -247,7 +252,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// @@ -358,7 +363,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/NewAzContainerGroup_CreateExpanded.cs b/src/ContainerInstance/generated/cmdlets/NewAzContainerGroup_CreateExpanded.cs index bf0f99949e74..c38e3185e723 100644 --- a/src/ContainerInstance/generated/cmdlets/NewAzContainerGroup_CreateExpanded.cs +++ b/src/ContainerInstance/generated/cmdlets/NewAzContainerGroup_CreateExpanded.cs @@ -532,6 +532,11 @@ public partial class NewAzContainerGroup_CreateExpanded : global::System.Managem /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -567,7 +572,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Cmdlets.NewAzContain /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -708,7 +713,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/RemoveAzContainerGroup_Delete.cs b/src/ContainerInstance/generated/cmdlets/RemoveAzContainerGroup_Delete.cs index 5ec5ae94e350..8b3a588528bb 100644 --- a/src/ContainerInstance/generated/cmdlets/RemoveAzContainerGroup_Delete.cs +++ b/src/ContainerInstance/generated/cmdlets/RemoveAzContainerGroup_Delete.cs @@ -206,6 +206,11 @@ public partial class RemoveAzContainerGroup_Delete : global::System.Management.A /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -240,7 +245,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Cmdlets.RemoveAzCont /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -373,7 +378,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/RemoveAzContainerGroup_DeleteViaIdentity.cs b/src/ContainerInstance/generated/cmdlets/RemoveAzContainerGroup_DeleteViaIdentity.cs index d486605cfa59..b11f41642893 100644 --- a/src/ContainerInstance/generated/cmdlets/RemoveAzContainerGroup_DeleteViaIdentity.cs +++ b/src/ContainerInstance/generated/cmdlets/RemoveAzContainerGroup_DeleteViaIdentity.cs @@ -164,6 +164,11 @@ public partial class RemoveAzContainerGroup_DeleteViaIdentity : global::System.M /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -195,7 +200,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Cmdlets.RemoveAzCont /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -328,7 +333,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/RestartAzContainerGroup_Restart.cs b/src/ContainerInstance/generated/cmdlets/RestartAzContainerGroup_Restart.cs index ba6d522369ff..b23e83b86208 100644 --- a/src/ContainerInstance/generated/cmdlets/RestartAzContainerGroup_Restart.cs +++ b/src/ContainerInstance/generated/cmdlets/RestartAzContainerGroup_Restart.cs @@ -193,6 +193,11 @@ public partial class RestartAzContainerGroup_Restart : global::System.Management /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -227,7 +232,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Cmdlets.RestartAzCon /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -360,7 +365,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/RestartAzContainerGroup_RestartViaIdentity.cs b/src/ContainerInstance/generated/cmdlets/RestartAzContainerGroup_RestartViaIdentity.cs index 7c877f4556e7..9711c423dbb0 100644 --- a/src/ContainerInstance/generated/cmdlets/RestartAzContainerGroup_RestartViaIdentity.cs +++ b/src/ContainerInstance/generated/cmdlets/RestartAzContainerGroup_RestartViaIdentity.cs @@ -151,6 +151,11 @@ public partial class RestartAzContainerGroup_RestartViaIdentity : global::System /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -182,7 +187,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Cmdlets.RestartAzCon /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -315,7 +320,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/StartAzContainerGroup_Start.cs b/src/ContainerInstance/generated/cmdlets/StartAzContainerGroup_Start.cs index 57e9654465bd..85390a0b325b 100644 --- a/src/ContainerInstance/generated/cmdlets/StartAzContainerGroup_Start.cs +++ b/src/ContainerInstance/generated/cmdlets/StartAzContainerGroup_Start.cs @@ -203,6 +203,11 @@ public partial class StartAzContainerGroup_Start : global::System.Management.Aut /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -237,7 +242,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Cmdlets.StartAzConta /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -370,7 +375,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/StartAzContainerGroup_StartViaIdentity.cs b/src/ContainerInstance/generated/cmdlets/StartAzContainerGroup_StartViaIdentity.cs index fc7f8bd87aaa..fb3793449dc0 100644 --- a/src/ContainerInstance/generated/cmdlets/StartAzContainerGroup_StartViaIdentity.cs +++ b/src/ContainerInstance/generated/cmdlets/StartAzContainerGroup_StartViaIdentity.cs @@ -161,6 +161,11 @@ public partial class StartAzContainerGroup_StartViaIdentity : global::System.Man /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -192,7 +197,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Cmdlets.StartAzConta /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -325,7 +330,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/StopAzContainerGroup_Stop.cs b/src/ContainerInstance/generated/cmdlets/StopAzContainerGroup_Stop.cs index e0d2288f5529..9e3db11dcdfa 100644 --- a/src/ContainerInstance/generated/cmdlets/StopAzContainerGroup_Stop.cs +++ b/src/ContainerInstance/generated/cmdlets/StopAzContainerGroup_Stop.cs @@ -180,6 +180,11 @@ public partial class StopAzContainerGroup_Stop : global::System.Management.Autom /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -191,7 +196,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -294,7 +299,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/StopAzContainerGroup_StopViaIdentity.cs b/src/ContainerInstance/generated/cmdlets/StopAzContainerGroup_StopViaIdentity.cs index 0cfcabb2203b..5324e1b05bee 100644 --- a/src/ContainerInstance/generated/cmdlets/StopAzContainerGroup_StopViaIdentity.cs +++ b/src/ContainerInstance/generated/cmdlets/StopAzContainerGroup_StopViaIdentity.cs @@ -138,6 +138,11 @@ public partial class StopAzContainerGroup_StopViaIdentity : global::System.Manag /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -149,7 +154,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -252,7 +257,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/UpdateAzContainerGroup_UpdateExpanded.cs b/src/ContainerInstance/generated/cmdlets/UpdateAzContainerGroup_UpdateExpanded.cs index 65f0b109e38d..2c36fb37b6a7 100644 --- a/src/ContainerInstance/generated/cmdlets/UpdateAzContainerGroup_UpdateExpanded.cs +++ b/src/ContainerInstance/generated/cmdlets/UpdateAzContainerGroup_UpdateExpanded.cs @@ -214,6 +214,11 @@ public partial class UpdateAzContainerGroup_UpdateExpanded : global::System.Mana /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -225,7 +230,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -328,7 +333,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/cmdlets/UpdateAzContainerGroup_UpdateViaIdentityExpanded.cs b/src/ContainerInstance/generated/cmdlets/UpdateAzContainerGroup_UpdateViaIdentityExpanded.cs index 5a26deaf883a..6d25d5b47502 100644 --- a/src/ContainerInstance/generated/cmdlets/UpdateAzContainerGroup_UpdateViaIdentityExpanded.cs +++ b/src/ContainerInstance/generated/cmdlets/UpdateAzContainerGroup_UpdateViaIdentityExpanded.cs @@ -172,6 +172,11 @@ public partial class UpdateAzContainerGroup_UpdateViaIdentityExpanded : global:: /// protected override void BeginProcessing() { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { @@ -183,7 +188,7 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } /// Handles/Dispatches events during the call to the REST service. @@ -286,7 +291,6 @@ protected override void ProcessRecord() { using( NoSynchronizationContext ) { - await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) diff --git a/src/ContainerInstance/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/src/ContainerInstance/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs index 9344a62b020d..80bf896898b3 100644 --- a/src/ContainerInstance/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs +++ b/src/ContainerInstance/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -52,6 +52,17 @@ public override string ToString() internal class HelpExampleOutput { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + public MarkdownExampleHelpInfo ExampleInfo { get; } public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) @@ -59,17 +70,26 @@ public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) ExampleInfo = exampleInfo; } - public override string ToString() => $@"{ExampleNameHeader}{ExampleInfo.Name} -{ExampleCodeHeader} -{ExampleInfo.Code} -{ExampleCodeFooter} - -{ExampleInfo.Description.ToDescriptionFormat()} - -"; + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } } - - + internal class HelpParameterOutput { public MarkdownParameterHelpInfo ParameterInfo { get; } @@ -161,6 +181,8 @@ public static string ToDescriptionFormat(this string text, bool escapeAngleBrack public const string ExampleNameHeader = "### "; public const string ExampleCodeHeader = "```powershell"; public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); diff --git a/src/ContainerInstance/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/src/ContainerInstance/generated/runtime/BuildTime/Models/PsHelpTypes.cs index 9266460a0f5d..c7d0caf0b65a 100644 --- a/src/ContainerInstance/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/src/ContainerInstance/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -109,18 +109,21 @@ internal class PsHelpExampleInfo { public string Title { get; } public string Code { get; } + public string Output { get; } public string Remarks { get; } public PsHelpExampleInfo(PSObject exampleObject) { Title = exampleObject.GetProperty("title"); Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); } public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) { Title = markdownExample.Name; Code = markdownExample.Code; + Output = markdownExample.Output; Remarks = markdownExample.Description; } diff --git a/src/ContainerInstance/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/src/ContainerInstance/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 76ac9b56b3ee..eef805eaafef 100644 --- a/src/ContainerInstance/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/src/ContainerInstance/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -91,12 +91,17 @@ private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) var code = codeStartIndex.HasValue && codeEndIndex.HasValue ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) : String.Empty; - var descriptionStartIndex = (codeEndIndex ?? 0) + 1; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; var descriptionEndIndex = eg.Length - 1; descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); - return new MarkdownExampleHelpInfo(name, code, description); + return new MarkdownExampleHelpInfo(name, code, output, description); }).ToArray(); } } @@ -154,12 +159,14 @@ internal class MarkdownExampleHelpInfo { public string Name { get; } public string Code { get; } + public string Output { get; } public string Description { get; } - public MarkdownExampleHelpInfo(string name, string code, string description) + public MarkdownExampleHelpInfo(string name, string code, string output, string description) { Name = name; Code = code; + Output = output; Description = description; } } @@ -213,12 +220,12 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param internal static class MarkdownTypesExtensions { - public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Remarks); + public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = { - new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"PS C:\> {{{{ Add code here }}}}{Environment.NewLine}{Environment.NewLine}{{{{ Add output here }}}}", @"{{ Add description here }}"), - new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"PS C:\> {{{{ Add code here }}}}{Environment.NewLine}{Environment.NewLine}{{{{ Add output here }}}}", @"{{ Add description here }}") + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/src/ContainerInstance/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/src/ContainerInstance/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index f12797b99440..a4382395d78a 100644 --- a/src/ContainerInstance/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/src/ContainerInstance/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -168,19 +168,56 @@ public ParameterNameOutput(string parameterName, bool isLast) public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; } - internal class BeginOutput + internal class BaseOutput { public VariantGroup VariantGroup { get; } - public BeginOutput(VariantGroup variantGroup) + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } public string GetProcessCustomAttributesAtRuntime() { return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Runspace.Version.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } public override string ToString() => $@"begin {{ {Indent}try {{ {Indent}{Indent}$outBuffer = $null @@ -188,6 +225,7 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -195,6 +233,7 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) {Indent}}} catch {{ +{ClearTelemetryContext()} {Indent}{Indent}throw {Indent}}} }} @@ -231,28 +270,69 @@ private string GetDefaultValuesStatements() } } - internal class ProcessOutput + internal class ProcessOutput : BaseOutput { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } public override string ToString() => $@"process {{ {Indent}try {{ {Indent}{Indent}$steppablePipeline.Process($_) {Indent}}} catch {{ +{ClearTelemetryContext()} {Indent}{Indent}throw {Indent}}} +{GetFinally()} }} - "; } - internal class EndOutput + internal class EndOutput : BaseOutput { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } public override string ToString() => $@"end {{ {Indent}try {{ {Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} {Indent}}} catch {{ +{ClearTelemetryContext()} {Indent}{Indent}throw {Indent}}} -}} +}} "; } @@ -493,9 +573,9 @@ public static string ToSyntaxTypeName(this Type type) public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); - public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(); + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); - public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(); + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); diff --git a/src/ContainerInstance/help/Az.ContainerInstance.md b/src/ContainerInstance/help/Az.ContainerInstance.md index 478c0c35ec5a..cec092c53145 100644 --- a/src/ContainerInstance/help/Az.ContainerInstance.md +++ b/src/ContainerInstance/help/Az.ContainerInstance.md @@ -47,7 +47,7 @@ Create a in-memory object for ImageRegistryCredential Create a in-memory object for Port ### [New-AzContainerGroupVolumeObject](New-AzContainerGroupVolumeObject.md) -Create a in-memory object for Volume +Create an in-memory object for Volume. ### [New-AzContainerInstanceEnvironmentVariableObject](New-AzContainerInstanceEnvironmentVariableObject.md) Create a in-memory object for EnvironmentVariable diff --git a/src/ContainerInstance/help/New-AzContainerGroup.md b/src/ContainerInstance/help/New-AzContainerGroup.md index 6907700ac543..4afd911ee20d 100644 --- a/src/ContainerInstance/help/New-AzContainerGroup.md +++ b/src/ContainerInstance/help/New-AzContainerGroup.md @@ -29,7 +29,7 @@ New-AzContainerGroup -Name -ResourceGroupName -Container : The list of volumes that can be mounted by containers in thi - `[AzureFileShareName ]`: The name of the Azure File share to be mounted as a volume. - `[AzureFileStorageAccountKey ]`: The storage account access key used to access the Azure File share. - `[AzureFileStorageAccountName ]`: The name of the storage account that contains the Azure File share. - - `[EmptyDir ]`: The empty directory volume. + - `[EmptyDir ]`: The empty directory volume. + - `[(Any) ]`: This indicates any property can be added to this object. - `[GitRepoDirectory ]`: Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. - `[GitRepoRepository ]`: Repository URL - `[GitRepoRevision ]`: Commit hash for the specified revision. diff --git a/src/ContainerInstance/help/New-AzContainerGroupVolumeObject.md b/src/ContainerInstance/help/New-AzContainerGroupVolumeObject.md index f65d7a65e745..7e1ddcdccb2e 100644 --- a/src/ContainerInstance/help/New-AzContainerGroupVolumeObject.md +++ b/src/ContainerInstance/help/New-AzContainerGroupVolumeObject.md @@ -8,19 +8,19 @@ schema: 2.0.0 # New-AzContainerGroupVolumeObject ## SYNOPSIS -Create a in-memory object for Volume +Create an in-memory object for Volume. ## SYNTAX ``` New-AzContainerGroupVolumeObject -Name [-AzureFileReadOnly] [-AzureFileShareName ] [-AzureFileStorageAccountKey ] [-AzureFileStorageAccountName ] - [-GitRepoDirectoryName ] [-GitRepoRepositoryUrl ] [-GitRepoRevision ] - [] + [-EmptyDir ] [-GitRepoDirectoryName ] [-GitRepoRepositoryUrl ] + [-GitRepoRevision ] [-Secret ] [] ``` ## DESCRIPTION -Create a in-memory object for Volume. Currently, we support mounting Azure File share as a volume or specifying git repository as volume directory. The empty directory volume and secret volume are not supported yet. +Create an in-memory object for Volume. ## EXAMPLES @@ -30,8 +30,6 @@ New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" ``` ```output -****** - Name ---- myvolume @@ -39,6 +37,28 @@ myvolume This command creates a Azure File volume. +### Example 2: Create an empty directory volume +```powershell +New-AzContainerGroupVolumeObject -Name "emptyvolume" -EmptyDir @{} | fl +``` + +```output +AzureFileReadOnly : +AzureFileShareName : +AzureFileStorageAccountKey : +AzureFileStorageAccountName : +EmptyDir : { + } +GitRepoDirectory : +GitRepoRepository : +GitRepoRevision : +Name : emptyvolume +Secret : { + } +``` + +This command creates an empty directory volume. + ## PARAMETERS ### -AzureFileReadOnly @@ -101,6 +121,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -EmptyDir +The empty directory volume. +To construct, see NOTES section for EMPTYDIR properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolumeEmptyDir +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -GitRepoDirectoryName Target directory name. Must not contain or start with '..'. @@ -164,6 +200,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Secret +The secret volume. +To construct, see NOTES section for SECRET properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.ISecretVolume +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). @@ -177,5 +229,16 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES +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. + + +EMPTYDIR : The empty directory volume. + - `[(Any) ]`: This indicates any property can be added to this object. + +SECRET : The secret volume. + - `[(Any) ]`: This indicates any property can be added to this object. + ## RELATED LINKS diff --git a/src/ContainerInstance/internal/Get-AzContainerInstanceOperation.ps1 b/src/ContainerInstance/internal/Get-AzContainerInstanceOperation.ps1 index d8e10816b75c..a78bcf230353 100644 --- a/src/ContainerInstance/internal/Get-AzContainerInstanceOperation.ps1 +++ b/src/ContainerInstance/internal/Get-AzContainerInstanceOperation.ps1 @@ -20,13 +20,9 @@ List the operations for Azure Container Instance service. .Description List the operations for Azure Container Instance service. .Example -PS C:\> {{ Add code here }} - -{{ Add output here }} +{{ Add code here }} .Example -PS C:\> {{ Add code here }} - -{{ Add output here }} +{{ Add code here }} .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IOperation @@ -92,6 +88,7 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceOperation_List'; } @@ -101,6 +98,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -109,15 +107,18 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } diff --git a/src/ContainerInstance/internal/Invoke-AzContainerInstanceCommand.ps1 b/src/ContainerInstance/internal/Invoke-AzContainerInstanceCommand.ps1 index d4210bb3a87f..1094bb904df0 100644 --- a/src/ContainerInstance/internal/Invoke-AzContainerInstanceCommand.ps1 +++ b/src/ContainerInstance/internal/Invoke-AzContainerInstanceCommand.ps1 @@ -20,9 +20,7 @@ Executes a command for a specific container instance in a specified resource gro .Description Executes a command for a specific container instance in a specified resource group and container group. .Example -PS C:\> Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" - -hello +Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IContainerExecResponse @@ -141,6 +139,7 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ ExecuteExpanded = 'Az.ContainerInstance.private\Invoke-AzContainerInstanceCommand_ExecuteExpanded'; } @@ -159,6 +158,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -167,15 +167,18 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } diff --git a/src/ContainerInstance/internal/New-AzContainerGroup.ps1 b/src/ContainerInstance/internal/New-AzContainerGroup.ps1 index 046494e22227..ba1ed5113835 100644 --- a/src/ContainerInstance/internal/New-AzContainerGroup.ps1 +++ b/src/ContainerInstance/internal/New-AzContainerGroup.ps1 @@ -20,61 +20,33 @@ Create or update container groups with specified configurations. .Description Create or update container groups with specified configurations. .Example -PS C:\> $port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP -PS C:\> $port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP +$port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP +$container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public .Example -PS C:\> $env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" -PS C:\> $env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" +$env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential .Example -PS C:\> $volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IContainerGroup @@ -163,7 +135,8 @@ VOLUME : The list of volumes that can be mounted by containers in thi [AzureFileShareName ]: The name of the Azure File share to be mounted as a volume. [AzureFileStorageAccountKey ]: The storage account access key used to access the Azure File share. [AzureFileStorageAccountName ]: The name of the storage account that contains the Azure File share. - [EmptyDir ]: The empty directory volume. + [EmptyDir ]: The empty directory volume. + [(Any) ]: This indicates any property can be added to this object. [GitRepoDirectory ]: Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. [GitRepoRepository ]: Repository URL [GitRepoRevision ]: Commit hash for the specified revision. @@ -460,6 +433,7 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ CreateExpanded = 'Az.ContainerInstance.private\New-AzContainerGroup_CreateExpanded'; } @@ -475,6 +449,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -483,15 +458,18 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } diff --git a/src/ContainerInstance/internal/ProxyCmdletDefinitions.ps1 b/src/ContainerInstance/internal/ProxyCmdletDefinitions.ps1 index d13526c1b565..7286f4e3e6be 100644 --- a/src/ContainerInstance/internal/ProxyCmdletDefinitions.ps1 +++ b/src/ContainerInstance/internal/ProxyCmdletDefinitions.ps1 @@ -20,13 +20,9 @@ List the operations for Azure Container Instance service. .Description List the operations for Azure Container Instance service. .Example -PS C:\> {{ Add code here }} - -{{ Add output here }} +{{ Add code here }} .Example -PS C:\> {{ Add code here }} - -{{ Add output here }} +{{ Add code here }} .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IOperation @@ -92,6 +88,7 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ List = 'Az.ContainerInstance.private\Get-AzContainerInstanceOperation_List'; } @@ -101,6 +98,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -109,17 +107,20 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } <# @@ -128,9 +129,7 @@ Executes a command for a specific container instance in a specified resource gro .Description Executes a command for a specific container instance in a specified resource group and container group. .Example -PS C:\> Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" - -hello +Invoke-AzContainerInstanceCommand -ContainerGroupName test-cg -ContainerName test-container -ResourceGroupName test-rg -Command "echo hello" .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IContainerExecResponse @@ -249,6 +248,7 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ ExecuteExpanded = 'Az.ContainerInstance.private\Invoke-AzContainerInstanceCommand_ExecuteExpanded'; } @@ -267,6 +267,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -275,17 +276,20 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } <# @@ -294,61 +298,33 @@ Create or update container groups with specified configurations. .Description Create or update container groups with specified configurations. .Example -PS C:\> $port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP -PS C:\> $port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$port1 = New-AzContainerInstancePortObject -Port 8000 -Protocol TCP +$port2 = New-AzContainerInstancePortObject -Port 8001 -Protocol TCP +$container = New-AzContainerInstanceObject -Name test-container -Image nginx -RequestCpu 1 -RequestMemoryInGb 1.5 -Port @($port1, $port2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux -RestartPolicy "Never" -IpAddressType Public .Example -PS C:\> $env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" -PS C:\> $env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$env1 = New-AzContainerInstanceEnvironmentVariableObject -Name "env1" -Value "value1" +$env2 = New-AzContainerInstanceEnvironmentVariableObject -Name "env2" -SecureValue (ConvertTo-SecureString -String "value2" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "/bin/sh -c myscript.sh" -EnvironmentVariable @($env1, $env2) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine -Command "echo hello" +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -OsType Linux .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image myacr.azurecr.io/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myacr.azurecr.io" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest -PS C:\> $imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image myserver.com/nginx:latest +$imageRegistryCredential = New-AzContainerGroupImageRegistryCredentialObject -Server "myserver.com" -Username "username" -Password (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -ImageRegistryCredential $imageRegistryCredential .Example -PS C:\> $volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$volume = New-AzContainerGroupVolumeObject -Name "myvolume" -AzureFileShareName "myshare" -AzureFileStorageAccountName "username" -AzureFileStorageAccountKey (ConvertTo-SecureString "PlainTextPassword" -AsPlainText -Force) +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -Volume $volume .Example -PS C:\> $container = New-AzContainerInstanceObject -Name test-container -Image alpine -PS C:\> $containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ - -Location Name Zone ResourceGroupName --------- ---- ---- ----------------- -eastus test-cg test-rg +$container = New-AzContainerInstanceObject -Name test-container -Image alpine +$containerGroup = New-AzContainerGroup -ResourceGroupName test-rg -Name test-cg -Location eastus -Container $container -IdentityType "SystemAssigned, UserAssigned" -IdentityUserAssignedIdentity /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/ .Outputs Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IContainerGroup @@ -437,7 +413,8 @@ VOLUME : The list of volumes that can be mounted by containers in thi [AzureFileShareName ]: The name of the Azure File share to be mounted as a volume. [AzureFileStorageAccountKey ]: The storage account access key used to access the Azure File share. [AzureFileStorageAccountName ]: The name of the storage account that contains the Azure File share. - [EmptyDir ]: The empty directory volume. + [EmptyDir ]: The empty directory volume. + [(Any) ]: This indicates any property can be added to this object. [GitRepoDirectory ]: Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. [GitRepoRepository ]: Repository URL [GitRepoRevision ]: Commit hash for the specified revision. @@ -734,6 +711,7 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + $mapping = @{ CreateExpanded = 'Az.ContainerInstance.private\New-AzContainerGroup_CreateExpanded'; } @@ -749,6 +727,7 @@ begin { $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { + throw } } @@ -757,15 +736,18 @@ process { try { $steppablePipeline.Process($_) } catch { + throw } -} +} end { try { $steppablePipeline.End() + } catch { + throw } -} +} } diff --git a/src/ContainerInstance/internal/README.md b/src/ContainerInstance/internal/README.md index 18dd9a636c8f..fef7cb2848ff 100644 --- a/src/ContainerInstance/internal/README.md +++ b/src/ContainerInstance/internal/README.md @@ -1,5 +1,5 @@ # Internal -This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. ## Info - Modifiable: no @@ -11,4 +11,4 @@ This directory contains a module to handle *internal only* cmdlets. Cmdlets that The `Az.ContainerInstance.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.ContainerInstance`. Instead, this sub-module is imported by the `..\custom\Az.ContainerInstance.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.ContainerInstance.internal\Get-Example` would call an internal cmdlet named `Get-Example`. ## Purpose -This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.ContainerInstance`. \ No newline at end of file +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.ContainerInstance`. diff --git a/src/ContainerInstance/test/New-AzContainerInstanceVolumeObject.Tests.ps1 b/src/ContainerInstance/test/New-AzContainerInstanceVolumeObject.Tests.ps1 new file mode 100644 index 000000000000..58dc4600090a --- /dev/null +++ b/src/ContainerInstance/test/New-AzContainerInstanceVolumeObject.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzContainerInstanceVolumeObject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzContainerInstanceVolumeObject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzContainerInstanceVolumeObject' { + It '__AllParameterSets' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} From dc44838ca8737785315751e178a35f46dcd58db1 Mon Sep 17 00:00:00 2001 From: Yeming Liu <11371776+isra-fel@users.noreply.github.com> Date: Mon, 18 Apr 2022 23:11:40 +0800 Subject: [PATCH 2/4] changelog --- src/ContainerInstance/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ContainerInstance/Changelog.md b/src/ContainerInstance/Changelog.md index 780277872235..b1e36bcfcdb3 100644 --- a/src/ContainerInstance/Changelog.md +++ b/src/ContainerInstance/Changelog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release +* Supported empty directory volume and secret volume for creating container group ## Version 3.0.1 * Fixed Identity Bug in ImageRegistryCredential From 7e526a10ada8bb5e80cddf0aefc557dac6af2ec7 Mon Sep 17 00:00:00 2001 From: Dingmeng Xue Date: Tue, 19 Apr 2022 09:55:06 +0800 Subject: [PATCH 3/4] Update src/ContainerInstance/Changelog.md Co-authored-by: Beisi Zhou --- src/ContainerInstance/Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ContainerInstance/Changelog.md b/src/ContainerInstance/Changelog.md index b1e36bcfcdb3..a7461669b1fc 100644 --- a/src/ContainerInstance/Changelog.md +++ b/src/ContainerInstance/Changelog.md @@ -19,7 +19,7 @@ --> ## Upcoming Release -* Supported empty directory volume and secret volume for creating container group +* Supported empty directory volume and secret volume for creating container group [#17410] ## Version 3.0.1 * Fixed Identity Bug in ImageRegistryCredential From 3e6627ae1cc2102679cd876e3e732dc72dd843d7 Mon Sep 17 00:00:00 2001 From: Beisi Zhou Date: Tue, 19 Apr 2022 10:31:54 +0800 Subject: [PATCH 4/4] Create BreakingChangeIssues.csv --- .../Exceptions/Az.ContainerInstance/BreakingChangeIssues.csv | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tools/StaticAnalysis/Exceptions/Az.ContainerInstance/BreakingChangeIssues.csv diff --git a/tools/StaticAnalysis/Exceptions/Az.ContainerInstance/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.ContainerInstance/BreakingChangeIssues.csv new file mode 100644 index 000000000000..7f5463cea742 --- /dev/null +++ b/tools/StaticAnalysis/Exceptions/Az.ContainerInstance/BreakingChangeIssues.csv @@ -0,0 +1,3 @@ +"AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation" +"Az.ContainerInstance","Get-AzContainerGroup","Get-AzContainerGroup","0","3000","The type of property 'EmptyDir' of type 'Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.IVolume' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny' to 'Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IVolumeEmptyDir'.","Change the type of property 'EmptyDir' back to 'Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny'." +"Az.ContainerInstance","New-AzContainerGroupVolumeObject","New-AzContainerGroupVolumeObject","0","3000","The type of property 'EmptyDir' of type 'Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.Api20210901.Volume' has changed from 'Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny' to 'Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IVolumeEmptyDir'.","Change the type of property 'EmptyDir' back to 'Microsoft.Azure.PowerShell.Cmdlets.ContainerInstance.Models.IAny'."