From 135b519d02a384c5aeddecd24271ca703ebcc8c6 Mon Sep 17 00:00:00 2001 From: Azure PowerShell <65331932+azure-powershell-bot@users.noreply.github.com> Date: Sun, 7 Apr 2024 19:52:02 +0800 Subject: [PATCH] Migrate NetworkFunction from generation to main (#24582) * Move NetworkFunction to main * Update ChangeLog.md --------- Co-authored-by: NanxiangLiu <33285578+Nickcandy@users.noreply.github.com> --- .../Az.NetworkFunction.psd1 | 159 +----- .../NetworkFunction.Autorest/README.md | 13 +- .../NetworkFunction.Autorest/build-module.ps1 | 9 +- .../New-AzNetworkFunctionCollectorPolicy.ps1 | 189 +++++++ ...pdate-AzNetworkFunctionCollectorPolicy.ps1 | 20 +- .../Get-AzNetworkFunctionCollectorPolicy.ps1 | 12 +- .../Get-AzNetworkFunctionTrafficCollector.ps1 | 12 +- .../New-AzNetworkFunctionCollectorPolicy.ps1 | 21 +- .../New-AzNetworkFunctionTrafficCollector.ps1 | 12 +- .../exports/ProxyCmdletDefinitions.ps1 | 463 +++++++++++------- ...emove-AzNetworkFunctionCollectorPolicy.ps1 | 12 +- ...move-AzNetworkFunctionTrafficCollector.ps1 | 12 +- ...pdate-AzNetworkFunctionCollectorPolicy.ps1 | 12 +- ...te-AzNetworkFunctionCollectorPolicyTag.ps1 | 12 +- ...date-AzNetworkFunctionTrafficCollector.ps1 | 12 +- ...e-AzNetworkFunctionTrafficCollectorTag.ps1 | 12 +- .../generate-help.ps1 | 4 +- .../generate-portal-ux.ps1 | 375 ++++++++++++++ ...GetAzNetworkFunctionCollectorPolicy_Get.cs | 1 + ...kFunctionCollectorPolicy_GetViaIdentity.cs | 1 + ...etAzNetworkFunctionCollectorPolicy_List.cs | 1 + .../GetAzNetworkFunctionOperation_List.cs | 1 + ...etAzNetworkFunctionTrafficCollector_Get.cs | 1 + ...FunctionTrafficCollector_GetViaIdentity.cs | 1 + ...tAzNetworkFunctionTrafficCollector_List.cs | 1 + ...AzNetworkFunctionTrafficCollector_List1.cs | 1 + ...AzNetworkFunctionCollectorPolicy_Create.cs | 1 + ...kFunctionCollectorPolicy_CreateExpanded.cs | 2 + ...nctionCollectorPolicy_CreateViaIdentity.cs | 1 + ...llectorPolicy_CreateViaIdentityExpanded.cs | 1 + ...zNetworkFunctionTrafficCollector_Create.cs | 1 + ...FunctionTrafficCollector_CreateExpanded.cs | 1 + ...ctionTrafficCollector_CreateViaIdentity.cs | 1 + ...fficCollector_CreateViaIdentityExpanded.cs | 1 + ...AzNetworkFunctionCollectorPolicy_Delete.cs | 1 + ...nctionCollectorPolicy_DeleteViaIdentity.cs | 1 + ...zNetworkFunctionTrafficCollector_Delete.cs | 1 + ...ctionTrafficCollector_DeleteViaIdentity.cs | 1 + ...AzNetworkFunctionCollectorPolicy_Update.cs | 1 + ...kFunctionCollectorPolicy_UpdateExpanded.cs | 1 + ...zNetworkFunctionTrafficCollector_Update.cs | 1 + ...FunctionTrafficCollector_UpdateExpanded.cs | 1 + ...etworkFunctionCollectorPolicyTag_Update.cs | 1 + ...nctionCollectorPolicyTag_UpdateExpanded.cs | 1 + ...ionCollectorPolicyTag_UpdateViaIdentity.cs | 1 + ...ctorPolicyTag_UpdateViaIdentityExpanded.cs | 1 + ...tworkFunctionTrafficCollectorTag_Update.cs | 1 + ...ctionTrafficCollectorTag_UpdateExpanded.cs | 1 + ...onTrafficCollectorTag_UpdateViaIdentity.cs | 1 + ...cCollectorTag_UpdateViaIdentityExpanded.cs | 1 + .../BuildTime/Cmdlets/ExportHelpMarkdown.cs | 5 +- .../BuildTime/Cmdlets/ExportProxyCmdlet.cs | 5 +- .../runtime/BuildTime/MarkdownRenderer.cs | 24 +- .../BuildTime/Models/PsProxyOutputs.cs | 32 +- .../runtime/BuildTime/PsAttributes.cs | 7 + .../generated/runtime/MessageAttribute.cs | 100 ++-- .../runtime/MessageAttributeHelper.cs | 33 +- .../runtime/Properties/Resources.Designer.cs | 28 +- .../runtime/Properties/Resources.resx | 10 +- .../help/Az.NetworkFunction.md | 43 ++ .../Get-AzNetworkFunctionCollectorPolicy.md | 182 +++++++ .../Get-AzNetworkFunctionTrafficCollector.md | 200 ++++++++ .../New-AzNetworkFunctionCollectorPolicy.md | 292 +++++++++++ .../New-AzNetworkFunctionTrafficCollector.md | 210 ++++++++ .../NetworkFunction.Autorest/help/README.md | 11 + ...Remove-AzNetworkFunctionCollectorPolicy.md | 224 +++++++++ ...emove-AzNetworkFunctionTrafficCollector.md | 208 ++++++++ ...Update-AzNetworkFunctionCollectorPolicy.md | 292 +++++++++++ ...ate-AzNetworkFunctionCollectorPolicyTag.md | 228 +++++++++ ...pdate-AzNetworkFunctionTrafficCollector.md | 225 +++++++++ ...te-AzNetworkFunctionTrafficCollectorTag.md | 195 ++++++++ .../New-AzNetworkFunctionCollectorPolicy.ps1 | 22 +- .../New-AzNetworkFunctionTrafficCollector.ps1 | 8 +- .../internal/ProxyCmdletDefinitions.ps1 | 62 ++- .../Set-AzNetworkFunctionCollectorPolicy.ps1 | 8 +- .../Set-AzNetworkFunctionTrafficCollector.ps1 | 8 +- ...te-AzNetworkFunctionCollectorPolicyTag.ps1 | 8 +- ...e-AzNetworkFunctionTrafficCollectorTag.ps1 | 8 +- .../NetworkFunction.Autorest/test-module.ps1 | 8 +- ...AzNetworkFunctionCollectorPolicy.Tests.ps1 | 30 +- ...AzNetworkFunctionCollectorPolicy.Tests.ps1 | 14 +- .../NetworkFunction.Autorest/test/env.json | 10 + .../NetworkFunction.Autorest/test/loadEnv.ps1 | 2 +- .../utils/Get-SubscriptionIdTestSafe.ps1 | 7 + .../NetworkFunction/Az.NetworkFunction.psd1 | 4 +- .../NetworkFunction/ChangeLog.md | 2 +- .../Get-AzNetworkFunctionCollectorPolicy.md | 46 +- .../Get-AzNetworkFunctionTrafficCollector.md | 50 +- .../New-AzNetworkFunctionCollectorPolicy.md | 41 +- .../New-AzNetworkFunctionTrafficCollector.md | 26 +- ...Remove-AzNetworkFunctionCollectorPolicy.md | 36 +- ...emove-AzNetworkFunctionTrafficCollector.md | 37 +- ...Update-AzNetworkFunctionCollectorPolicy.md | 38 +- ...ate-AzNetworkFunctionCollectorPolicyTag.md | 36 +- ...pdate-AzNetworkFunctionTrafficCollector.md | 49 +- ...te-AzNetworkFunctionTrafficCollectorTag.md | 38 +- 96 files changed, 3890 insertions(+), 656 deletions(-) create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/custom/New-AzNetworkFunctionCollectorPolicy.ps1 create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/generate-portal-ux.ps1 create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Az.NetworkFunction.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Get-AzNetworkFunctionCollectorPolicy.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Get-AzNetworkFunctionTrafficCollector.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/New-AzNetworkFunctionCollectorPolicy.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/New-AzNetworkFunctionTrafficCollector.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/README.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Remove-AzNetworkFunctionCollectorPolicy.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Remove-AzNetworkFunctionTrafficCollector.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionCollectorPolicy.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionCollectorPolicyTag.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionTrafficCollector.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionTrafficCollectorTag.md create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/test/env.json create mode 100644 src/NetworkFunction/NetworkFunction.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 diff --git a/src/NetworkFunction/NetworkFunction.Autorest/Az.NetworkFunction.psd1 b/src/NetworkFunction/NetworkFunction.Autorest/Az.NetworkFunction.psd1 index b54d0c853c5a..2c3cb64ae345 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/Az.NetworkFunction.psd1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/Az.NetworkFunction.psd1 @@ -1,141 +1,24 @@ -# -# Module manifest for module 'Az.NetworkFunction' -# -# Generated by: Microsoft Corporation -# -# Generated on: 6/1/2023 -# - @{ - -# Script module or binary module file associated with this manifest. -RootModule = './Az.NetworkFunction.psm1' - -# Version number of this module. -ModuleVersion = '0.1.2' - -# Supported PSEditions -CompatiblePSEditions = 'Core', 'Desktop' - -# ID used to uniquely identify this module -GUID = '1d339b1c-5a86-4fbd-9a2e-d0497c39b397' - -# Author of this module -Author = 'Microsoft Corporation' - -# Company or vendor of this module -CompanyName = 'Microsoft Corporation' - -# Copyright statement for this module -Copyright = 'Microsoft Corporation. All rights reserved.' - -# Description of the functionality provided by this module -Description = 'Microsoft Azure PowerShell: NetworkFunction cmdlets' - -# Minimum version of the PowerShell engine required by this module -PowerShellVersion = '5.1' - -# Name of the PowerShell host required by this module -# PowerShellHostName = '' - -# Minimum version of the PowerShell host required by this module -# PowerShellHostVersion = '' - -# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -DotNetFrameworkVersion = '4.7.2' - -# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# ClrVersion = '' - -# Processor architecture (None, X86, Amd64) required by this module -# ProcessorArchitecture = '' - -# Modules that must be imported into the global environment prior to importing this module -RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.10.3'; }) - -# Assemblies that must be loaded prior to importing this module -RequiredAssemblies = './bin/Az.NetworkFunction.private.dll' - -# Script files (.ps1) that are run in the caller's environment prior to importing this module. -# ScriptsToProcess = @() - -# Type files (.ps1xml) to be loaded when importing this module -# TypesToProcess = @() - -# Format files (.ps1xml) to be loaded when importing this module -FormatsToProcess = './Az.NetworkFunction.format.ps1xml' - -# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -# NestedModules = @() - -# Functions 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 functions to export. -FunctionsToExport = 'Get-AzNetworkFunctionCollectorPolicy', - 'Get-AzNetworkFunctionTrafficCollector', - 'New-AzNetworkFunctionCollectorPolicy', - 'New-AzNetworkFunctionTrafficCollector', - 'Remove-AzNetworkFunctionCollectorPolicy', - 'Remove-AzNetworkFunctionTrafficCollector', - 'Update-AzNetworkFunctionCollectorPolicy', - 'Update-AzNetworkFunctionCollectorPolicyTag', - 'Update-AzNetworkFunctionTrafficCollector', - 'Update-AzNetworkFunctionTrafficCollectorTag' - -# Cmdlets 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 cmdlets to export. -CmdletsToExport = @() - -# Variables to export from this module -# 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 = '*' - -# DSC resources to export from this module -# DscResourcesToExport = @() - -# List of all modules packaged with this module -# ModuleList = @() - -# List of all files packaged with this module -# FileList = @() - -# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. -PrivateData = @{ - + GUID = '1d339b1c-5a86-4fbd-9a2e-d0497c39b397' + RootModule = './Az.NetworkFunction.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: NetworkFunction cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.NetworkFunction.private.dll' + FormatsToProcess = './Az.NetworkFunction.format.ps1xml' + FunctionsToExport = 'Get-AzNetworkFunctionCollectorPolicy', 'Get-AzNetworkFunctionTrafficCollector', 'New-AzNetworkFunctionCollectorPolicy', 'New-AzNetworkFunctionTrafficCollector', 'Remove-AzNetworkFunctionCollectorPolicy', 'Remove-AzNetworkFunctionTrafficCollector', 'Update-AzNetworkFunctionCollectorPolicy', 'Update-AzNetworkFunctionCollectorPolicyTag', 'Update-AzNetworkFunctionTrafficCollector', 'Update-AzNetworkFunctionTrafficCollectorTag', '*' + AliasesToExport = '*' + PrivateData = @{ PSData = @{ - - # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'Azure','ResourceManager','ARM','PSModule','NetworkFunction' - - # A URL to the license for this module. - LicenseUri = 'https://aka.ms/azps-license' - - # A URL to the main website for this project. - ProjectUri = 'https://github.com/Azure/azure-powershell' - - # A URL to an icon representing this module. - # IconUri = '' - - # ReleaseNotes of this module - # ReleaseNotes = '' - - # Prerelease string of this module - # Prerelease = '' - - # Flag to indicate whether the module requires explicit user acceptance for install/update/save - # RequireLicenseAcceptance = $false - - # External dependent modules of this module - # ExternalModuleDependencies = @() - - } # End of PSData hashtable - - } # End of PrivateData hashtable - -# HelpInfo URI of this module -# HelpInfoURI = '' - -# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. -# DefaultCommandPrefix = '' - + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'NetworkFunction' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } } - diff --git a/src/NetworkFunction/NetworkFunction.Autorest/README.md b/src/NetworkFunction/NetworkFunction.Autorest/README.md index 25756f7b4c0a..edefc5518f72 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/README.md +++ b/src/NetworkFunction/NetworkFunction.Autorest/README.md @@ -3,7 +3,6 @@ This directory contains the PowerShell module for the NetworkFunction service. --- - ## Info - Modifiable: yes - Generated: all @@ -28,9 +27,9 @@ For information on how to develop for `Az.NetworkFunction`, see [how-to.md](how- > see https://aka.ms/autorest ``` yaml -branch: 5ef93469c04983e472e57ca227fc5159d13a172a +commit: 5ef93469c04983e472e57ca227fc5159d13a172a require: - - $(this-folder)/../readme.azure.noprofile.md + - $(this-folder)/../../readme.azure.noprofile.md input-file: - $(repo)/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/AzureTrafficCollector.json module-version: 0.1.0 @@ -40,6 +39,10 @@ identity-correction-for-post: true resourcegroup-append: true nested-object-to-string: true +# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option +use-extension: + "@autorest/powershell": "3.x" + directive: - where: subject: ^AzureTrafficCollector(.*) @@ -57,4 +60,8 @@ directive: - where: verb: Set hide: true + - where: + verb: New + subject: ^CollectorPolicy(.*) + hide: true ``` diff --git a/src/NetworkFunction/NetworkFunction.Autorest/build-module.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/build-module.ps1 index e2052252da31..166aa9083955 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/build-module.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/build-module.ps1 @@ -143,7 +143,8 @@ if($NoDocs) { $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue } $null = New-Item -ItemType Directory -Force -Path $docsFolder - Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo } Write-Host -ForegroundColor Green 'Creating format.ps1xml...' @@ -162,4 +163,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol Write-Host -ForegroundColor Green 'Creating example stubs...' Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder +if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')) +{ + Write-Host -ForegroundColor Green 'Creating ux metadata...' + . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1') +} + Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/src/NetworkFunction/NetworkFunction.Autorest/custom/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/custom/New-AzNetworkFunctionCollectorPolicy.ps1 new file mode 100644 index 000000000000..42a877cd2459 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/custom/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -0,0 +1,189 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates a Collector Policy resource +.Description +Creates or updates a Collector Policy resource +.Example +New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus | Format-List + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy +.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. + +EMISSIONPOLICY : Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. + +INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. +.Link +https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy +#> +function New-AzNetworkFunctionCollectorPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy])] +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Azure Traffic Collector name + ${AzureTrafficCollectorName}, + + [Parameter(Mandatory)] + [Alias('CollectorPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Collector Policy Name + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # The name of the resource group. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # Azure Subscription ID. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IEmissionPoliciesPropertiesFormat[]] + # Emission policies. + # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. + ${EmissionPolicy}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IIngestionSourcesPropertiesFormat[]] + # Ingestion Sources. + # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. + ${IngestionPolicyIngestionSource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] + # The ingestion type. + ${IngestionPolicyIngestionType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ITrackedResourceTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +process { + $rg = $PSBoundParameters.ResourceGroupName + + # Ensure exr circuit bandwidth 1G or more + $cktname = $IngestionPolicyIngestionSource.ResourceId | Where {$IngestionPolicyIngestionSource.ResourceId -match "/*subscriptions/(?.*)/resourceGroups/(?.*)/providers/Microsoft.Network/expressRouteCircuits/(?.*)"} | Foreach {$Matches['circuitname']} + Import-Module Az.Network -Force + $exrCircuit = Get-AzExpressRouteCircuit -Name $cktname -ResourceGroupName $rg + $bandwidthInGbps = $exrCircuit.BandwidthInGbps + $bandwidthInMbps = $exrCircuit.ServiceProviderProperties.BandwidthInMbps + + if ($bandwidthInGbps -and ($bandwidthInGbps -lt 1)) { + throw "CollectorPolicy can not be updated because circuit has bandwidth less than 1G. Circuit size with a bandwidth of 1G or more is supported." + } + + if ($bandwidthInMbps -and ($bandwidthInMbps -lt 1000)) { + throw "CollectorPolicy can not be updated because circuit has bandwidth less than 1G. Circuit size with a bandwidth of 1G or more is supported." + } + + Az.NetworkFunction.internal\New-AzNetworkFunctionCollectorPolicy @PSBoundParameters + } +} \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/custom/Update-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/custom/Update-AzNetworkFunctionCollectorPolicy.ps1 index dff98bc9a05b..09e58824742a 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/custom/Update-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/custom/Update-AzNetworkFunctionCollectorPolicy.ps1 @@ -173,10 +173,26 @@ process { $null = $PSBoundParameters.Remove('WhatIf') $null = $PSBoundParameters.Remove('Confirm') $null = $PSBoundParameters.Remove('Location') + $rg = $PSBoundParameters.ResourceGroupName - $cp = Get-AzNetworkFunctionCollectorPolicy @PSBoundParameters + # 2. Ensure exr circuit bandwidth 1G or more + $cktname = $IngestionPolicyIngestionSource.ResourceId | Where {$IngestionPolicyIngestionSource.ResourceId -match "/*subscriptions/(?.*)/resourceGroups/(?.*)/providers/Microsoft.Network/expressRouteCircuits/(?.*)"} | Foreach {$Matches['circuitname']} + Import-Module Az.Network -Force + $exrCircuit = Get-AzExpressRouteCircuit -Name $cktname -ResourceGroupName $rg + $bandwidthInGbps = $exrCircuit.BandwidthInGbps + $bandwidthInMbps = $exrCircuit.ServiceProviderProperties.BandwidthInMbps + + if ($bandwidthInGbps -and ($bandwidthInGbps -lt 1)) { + throw "CollectorPolicy can not be updated because circuit has bandwidth less than 1G. Circuit size with a bandwidth of 1G or more is supported." + } - # 2. PUT + if ($bandwidthInMbps -and ($bandwidthInMbps -lt 1000)) { + throw "CollectorPolicy can not be updated because circuit has bandwidth less than 1G. Circuit size with a bandwidth of 1G or more is supported." + } + + $cp = Get-AzNetworkFunctionCollectorPolicy @PSBoundParameters + + # 3. PUT $null = $PSBoundParameters.Remove('AzureTrafficCollectorName') $null = $PSBoundParameters.Remove('ResourceGroupName') $null = $PSBoundParameters.Remove('Name') diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/Get-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/Get-AzNetworkFunctionCollectorPolicy.ps1 index afd8395b9a1b..4ac2b5342f01 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/Get-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/Get-AzNetworkFunctionCollectorPolicy.ps1 @@ -160,10 +160,20 @@ begin { List = 'Az.NetworkFunction.private\Get-AzNetworkFunctionCollectorPolicy_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/Get-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/Get-AzNetworkFunctionTrafficCollector.ps1 index 04fee6d38789..a1dfb2b86d63 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/Get-AzNetworkFunctionTrafficCollector.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/Get-AzNetworkFunctionTrafficCollector.ps1 @@ -159,10 +159,20 @@ begin { List1 = 'Az.NetworkFunction.private\Get-AzNetworkFunctionTrafficCollector_List1'; } if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/New-AzNetworkFunctionCollectorPolicy.ps1 index 46428a68b38d..c50ef24f4060 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/New-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -42,7 +42,7 @@ https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfu #> function New-AzNetworkFunctionCollectorPolicy { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] @@ -111,8 +111,7 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + # The credentials, account, tenant, and subscription used for communication with Azure. ${DefaultProfile}, [Parameter()] @@ -193,13 +192,23 @@ begin { } $mapping = @{ - CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateExpanded'; + __AllParameterSets = 'Az.NetworkFunction.custom\New-AzNetworkFunctionCollectorPolicy'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/New-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/New-AzNetworkFunctionTrafficCollector.ps1 index d2962e22d6f1..a206b30814f9 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/New-AzNetworkFunctionTrafficCollector.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/New-AzNetworkFunctionTrafficCollector.ps1 @@ -154,10 +154,20 @@ begin { CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionTrafficCollector_CreateExpanded'; } if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/ProxyCmdletDefinitions.ps1 index fb65bd6ef0de..84b91bf08d13 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -160,10 +160,20 @@ begin { List = 'Az.NetworkFunction.private\Get-AzNetworkFunctionCollectorPolicy_List'; } if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -353,10 +363,20 @@ begin { List1 = 'Az.NetworkFunction.private\Get-AzNetworkFunctionTrafficCollector_List1'; } if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -403,45 +423,26 @@ end { <# .Synopsis -Creates or updates a Collector Policy resource +Creates or updates a Azure Traffic Collector resource .Description -Creates or updates a Collector Policy resource +Creates or updates a Azure Traffic Collector resource .Example -New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus | Format-List +New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname test -location eastus | Format-List .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy -.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. - -EMISSIONPOLICY : Emission policies. - [EmissionDestination ]: Emission policy destinations. - [DestinationType ]: Emission destination type. - [EmissionType ]: Emission format type. - -INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. - [ResourceId ]: Resource ID. - [SourceType ]: Ingestion source type. +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector .Link -https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy +https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctiontrafficcollector #> -function New-AzNetworkFunctionCollectorPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy])] +function New-AzNetworkFunctionTrafficCollector { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] + [Alias('AzureTrafficCollectorName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # Azure Traffic Collector name - ${AzureTrafficCollectorName}, - - [Parameter(Mandatory)] - [Alias('CollectorPolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Collector Policy Name ${Name}, [Parameter(Mandatory)] @@ -463,29 +464,6 @@ param( # Resource location. ${Location}, - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IEmissionPoliciesPropertiesFormat[]] - # Emission policies. - # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. - ${EmissionPolicy}, - - [Parameter()] - [AllowEmptyCollection()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IIngestionSourcesPropertiesFormat[]] - # Ingestion Sources. - # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. - ${IngestionPolicyIngestionSource}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] - # The ingestion type. - ${IngestionPolicyIngestionType}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ITrackedResourceTags]))] @@ -580,13 +558,23 @@ begin { } $mapping = @{ - CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateExpanded'; + CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionTrafficCollector_CreateExpanded'; } if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -633,53 +621,66 @@ end { <# .Synopsis -Creates or updates a Azure Traffic Collector resource +Deletes a specified Collector Policy resource. .Description -Creates or updates a Azure Traffic Collector resource +Deletes a specified Collector Policy resource. .Example -New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname test -location eastus | Format-List +Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroupname test +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AzureTrafficCollectorName ]: Azure Traffic Collector name + [CollectorPolicyName ]: Collector Policy Name + [Id ]: Resource identity path + [ResourceGroupName ]: The name of the resource group. + [SubscriptionId ]: Azure Subscription ID. .Link -https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctiontrafficcollector +https://learn.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctioncollectorpolicy #> -function New-AzNetworkFunctionTrafficCollector { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Remove-AzNetworkFunctionCollectorPolicy { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Alias('AzureTrafficCollectorName')] + [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # Azure Traffic Collector name + ${AzureTrafficCollectorName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('CollectorPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Collector Policy Name ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # The name of the resource group. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='Delete')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # Azure Subscription ID. ${SubscriptionId}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [System.String] - # Resource location. - ${Location}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ITrackedResourceTags]))] - [System.Collections.Hashtable] - # Resource tags. - ${Tag}, + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] @@ -722,6 +723,12 @@ param( # Run the command asynchronously ${NoWait}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] [System.Uri] @@ -768,13 +775,24 @@ begin { } $mapping = @{ - CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionTrafficCollector_CreateExpanded'; + Delete = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionCollectorPolicy_Delete'; + DeleteViaIdentity = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionCollectorPolicy_DeleteViaIdentity'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -821,11 +839,11 @@ end { <# .Synopsis -Deletes a specified Collector Policy resource. +Deletes a specified Azure Traffic Collector resource. .Description -Deletes a specified Collector Policy resource. +Deletes a specified Azure Traffic Collector resource. .Example -Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroupname test +Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname SEA-Cust10 .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity @@ -843,23 +861,17 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. [SubscriptionId ]: Azure Subscription ID. .Link -https://learn.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctioncollectorpolicy +https://learn.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctiontrafficcollector #> -function Remove-AzNetworkFunctionCollectorPolicy { +function Remove-AzNetworkFunctionTrafficCollector { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('AzureTrafficCollectorName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # Azure Traffic Collector name - ${AzureTrafficCollectorName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('CollectorPolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Collector Policy Name ${Name}, [Parameter(ParameterSetName='Delete', Mandatory)] @@ -975,14 +987,24 @@ begin { } $mapping = @{ - Delete = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionCollectorPolicy_Delete'; - DeleteViaIdentity = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionCollectorPolicy_DeleteViaIdentity'; + Delete = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionTrafficCollector_Delete'; + DeleteViaIdentity = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionTrafficCollector_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1029,16 +1051,16 @@ end { <# .Synopsis -Deletes a specified Azure Traffic Collector resource. +Updates the specified Collector Policy tags. .Description -Deletes a specified Azure Traffic Collector resource. +Updates the specified Collector Policy tags. .Example -Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname SEA-Cust10 +Update-AzNetworkFunctionCollectorPolicyTag -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity .Outputs -System.Boolean +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy .Notes COMPLEX PARAMETER PROPERTIES @@ -1051,39 +1073,51 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. [SubscriptionId ]: Azure Subscription ID. .Link -https://learn.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctiontrafficcollector +https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctioncollectorpolicytag #> -function Remove-AzNetworkFunctionTrafficCollector { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Update-AzNetworkFunctionCollectorPolicyTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('AzureTrafficCollectorName')] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # Azure Traffic Collector name - ${Name}, + ${AzureTrafficCollectorName}, - [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Collector Policy Name + ${CollectorPolicyName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # The name of the resource group. ${ResourceGroupName}, - [Parameter(ParameterSetName='Delete')] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # Azure Subscription ID. ${SubscriptionId}, - [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ITagsObjectTags]))] + [System.Collections.Hashtable] + # Resource tags. + ${Tag}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1093,12 +1127,6 @@ param( # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command as a job - ${AsJob}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -1119,18 +1147,6 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Run the command asynchronously - ${NoWait}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] - [System.Management.Automation.SwitchParameter] - # Returns true when the command succeeds - ${PassThru}, - [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] [System.Uri] @@ -1177,14 +1193,24 @@ begin { } $mapping = @{ - Delete = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionTrafficCollector_Delete'; - DeleteViaIdentity = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionTrafficCollector_DeleteViaIdentity'; + UpdateExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionCollectorPolicyTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionCollectorPolicyTag_UpdateViaIdentityExpanded'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1231,16 +1257,16 @@ end { <# .Synopsis -Updates the specified Collector Policy tags. +Updates the specified Azure Traffic Collector tags. .Description -Updates the specified Collector Policy tags. +Updates the specified Azure Traffic Collector tags. .Example -Update-AzNetworkFunctionCollectorPolicyTag -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 | Format-List +Update-AzNetworkFunctionTrafficCollectorTag -azuretrafficcollectorname atc -resourcegroupname rg1 | Format-List .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector .Notes COMPLEX PARAMETER PROPERTIES @@ -1253,10 +1279,10 @@ INPUTOBJECT : Identity Parameter [ResourceGroupName ]: The name of the resource group. [SubscriptionId ]: Azure Subscription ID. .Link -https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctioncollectorpolicytag +https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctiontrafficcollectortag #> -function Update-AzNetworkFunctionCollectorPolicyTag { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy])] +function Update-AzNetworkFunctionTrafficCollectorTag { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -1265,12 +1291,6 @@ param( # Azure Traffic Collector name ${AzureTrafficCollectorName}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [System.String] - # Collector Policy Name - ${CollectorPolicyName}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] @@ -1373,14 +1393,24 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionCollectorPolicyTag_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionCollectorPolicyTag_UpdateViaIdentityExpanded'; + UpdateExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionTrafficCollectorTag_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionTrafficCollectorTag_UpdateViaIdentityExpanded'; } if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1427,63 +1457,92 @@ end { <# .Synopsis -Updates the specified Azure Traffic Collector tags. +Creates or updates a Collector Policy resource .Description -Updates the specified Azure Traffic Collector tags. +Creates or updates a Collector Policy resource .Example -Update-AzNetworkFunctionTrafficCollectorTag -azuretrafficcollectorname atc -resourcegroupname rg1 | Format-List +New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus | Format-List -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector +Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter - [AzureTrafficCollectorName ]: Azure Traffic Collector name - [CollectorPolicyName ]: Collector Policy Name - [Id ]: Resource identity path - [ResourceGroupName ]: The name of the resource group. - [SubscriptionId ]: Azure Subscription ID. +EMISSIONPOLICY : Emission policies. + [EmissionDestination ]: Emission policy destinations. + [DestinationType ]: Emission destination type. + [EmissionType ]: Emission format type. + +INGESTIONPOLICYINGESTIONSOURCE : Ingestion Sources. + [ResourceId ]: Resource ID. + [SourceType ]: Ingestion source type. .Link -https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctiontrafficcollectortag +https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy #> -function Update-AzNetworkFunctionTrafficCollectorTag { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector])] -[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function New-AzNetworkFunctionCollectorPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy])] +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # Azure Traffic Collector name ${AzureTrafficCollectorName}, - [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(Mandatory)] + [Alias('CollectorPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] + [System.String] + # Collector Policy Name + ${Name}, + + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # The name of the resource group. ${ResourceGroupName}, - [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # Azure Subscription ID. ${SubscriptionId}, - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [System.String] + # Resource location. + ${Location}, [Parameter()] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ITagsObjectTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IEmissionPoliciesPropertiesFormat[]] + # Emission policies. + # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. + ${EmissionPolicy}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IIngestionSourcesPropertiesFormat[]] + # Ingestion Sources. + # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. + ${IngestionPolicyIngestionSource}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType] + # The ingestion type. + ${IngestionPolicyIngestionType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, @@ -1493,10 +1552,15 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Azure')] [System.Management.Automation.PSObject] - # The DefaultProfile parameter is not functional. - # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + # The credentials, account, tenant, and subscription used for communication with Azure. ${DefaultProfile}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -1517,6 +1581,12 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Runtime')] [System.Uri] @@ -1563,14 +1633,23 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionTrafficCollectorTag_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionTrafficCollectorTag_UpdateViaIdentityExpanded'; + __AllParameterSets = 'Az.NetworkFunction.custom\New-AzNetworkFunctionCollectorPolicy'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1796,10 +1875,20 @@ begin { UpdateExpanded = 'Az.NetworkFunction.custom\Update-AzNetworkFunctionCollectorPolicy'; } if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2013,10 +2102,20 @@ begin { UpdateExpanded = 'Az.NetworkFunction.custom\Update-AzNetworkFunctionTrafficCollector'; } if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/Remove-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/Remove-AzNetworkFunctionCollectorPolicy.ps1 index c5e05cc19096..44d27feca9ec 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/Remove-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/Remove-AzNetworkFunctionCollectorPolicy.ps1 @@ -174,10 +174,20 @@ begin { DeleteViaIdentity = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionCollectorPolicy_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/Remove-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/Remove-AzNetworkFunctionTrafficCollector.ps1 index 73bc3da29b24..8ee93ec38c94 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/Remove-AzNetworkFunctionTrafficCollector.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/Remove-AzNetworkFunctionTrafficCollector.ps1 @@ -168,10 +168,20 @@ begin { DeleteViaIdentity = 'Az.NetworkFunction.private\Remove-AzNetworkFunctionTrafficCollector_DeleteViaIdentity'; } if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionCollectorPolicy.ps1 index f9b6754e53dd..072d37b8a6be 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionCollectorPolicy.ps1 @@ -195,10 +195,20 @@ begin { UpdateExpanded = 'Az.NetworkFunction.custom\Update-AzNetworkFunctionCollectorPolicy'; } if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionCollectorPolicyTag.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionCollectorPolicyTag.ps1 index 1a78d2aee3b2..18446db62c39 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionCollectorPolicyTag.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionCollectorPolicyTag.ps1 @@ -162,10 +162,20 @@ begin { UpdateViaIdentityExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionCollectorPolicyTag_UpdateViaIdentityExpanded'; } if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionTrafficCollector.ps1 index 8a3b2266fca2..d15517da8b99 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionTrafficCollector.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionTrafficCollector.ps1 @@ -183,10 +183,20 @@ begin { UpdateExpanded = 'Az.NetworkFunction.custom\Update-AzNetworkFunctionTrafficCollector'; } if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionTrafficCollectorTag.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionTrafficCollectorTag.ps1 index 1620b2f98dad..dff43d91d062 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionTrafficCollectorTag.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/exports/Update-AzNetworkFunctionTrafficCollectorTag.ps1 @@ -156,10 +156,20 @@ begin { UpdateViaIdentityExpanded = 'Az.NetworkFunction.private\Update-AzNetworkFunctionTrafficCollectorTag_UpdateViaIdentityExpanded'; } if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generate-help.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/generate-help.ps1 index 76789e645bfa..f44c69bcaab2 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generate-help.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/generate-help.ps1 @@ -66,8 +66,8 @@ foreach($directory in $directories) $docsPath = Join-Path $docsFolder $directory.Name $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue $examplesPath = Join-Path $examplesFolder $directory.Name - - Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" } diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generate-portal-ux.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/generate-portal-ux.ps1 new file mode 100644 index 000000000000..72b7756afa4a --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/generate-portal-ux.ps1 @@ -0,0 +1,375 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# +# This Script will create a folder dedicated to Azure-specific content and includes metadata files essential for enhancing the user experience (UX) within the Azure portal. +# These files are utilized by the Azure portal to effectively present the usage of cmdlets related to specific resources on portal pages. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$moduleName = 'Az.NetworkFunction' +$rootModuleName = '' +if ($rootModuleName -eq "") +{ + $rootModuleName = $moduleName +} +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot "./$moduleName.psd1") +$modulePath = $modulePsd1.FullName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot "./bin/$moduleName.private.dll") +$instance = [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName +$parameterSetsInfo = Get-Module -Name "$moduleName.private" + +$buildinFunctions = @("Export-CmdletSurface", "Export-ExampleStub", "Export-FormatPs1xml", "Export-HelpMarkdown", "Export-ModelSurface", "Export-ProxyCmdlet", "Export-Psd1", "Export-TestStub", "Get-CommonParameter", "Get-ModuleGuid", "Get-ScriptCmdlet") + +function Test-FunctionSupported() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + If ($buildinfunctions.Contains($FunctionName)) { + return $false + } + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity")) { + return $false + } + If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) { + return $false + } + + $parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName] + foreach ($parameterInfo in $parameterSetInfo.Parameters.Values) + { + $category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories + $invalideCategory = @('Query', 'Body') + if ($invalideCategory -contains $category) + { + return $false + } + } + + $customFiles = Get-ChildItem -Path custom -Filter "$cmdletName.*" + if ($customFiles.Length -ne 0) + { + return $false + } + + return $true +} + +function Get-MappedCmdletFromFunctionName() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + + return $cmdletName +} + +function Get-ParameterAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo, + [Parameter()] + [String] + $AttributeName + ) + return $ParameterInfo.Attributes | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $CmdletInfo, + [Parameter()] + [String] + $AttributeName + ) + + return $CmdletInfo.ImplementingType.GetTypeInfo().GetCustomAttributes([System.object], $true) | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletDescription() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [String] + $CmdletName + ) + $helpInfo = Get-Help $CmdletName -Full + + $description = $helpInfo.Description.Text + if ($null -eq $description) + { + return "" + } + return $description +} + +# Test whether the parameter is from swagger http path +function Test-ParameterFromSwagger() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo + ) + $category = (Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "CategoryAttribute").Categories + $doNotExport = Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "DoNotExportAttribute" + if ($null -ne $doNotExport) + { + return $false + } + + $valideCategory = @('Path') + if ($valideCategory -contains $category) + { + return $true + } + return $false +} + +function New-ExampleForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $category = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "CategoryAttribute").Categories + $sourceName = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "InfoAttribute").SerializedName + $name = $parameter.Name + $result += [ordered]@{ + name = "-$Name" + value = "[$category.$sourceName]" + } + } + + return $result +} + +function New-ParameterArrayInParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $isMandatory = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "ParameterAttribute").Mandatory + $parameterName = $parameter.Name + $parameterType = $parameter.ParameterType.ToString().Split('.')[1] + if ($parameter.SwitchParameter) + { + $parameterSignature = "-$parameterName" + } + else + { + $parameterSignature = "-$parameterName <$parameterType>" + } + if ($parameterName -eq "SubscriptionId") + { + $isMandatory = $false + } + if (-not $isMandatory) + { + $parameterSignature = "[$parameterSignature]" + } + $result += $parameterSignature + } + + return $result +} + +function New-MetadataForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $httpAttribute = Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "HttpPathAttribute" + $httpPath = $httpAttribute.Path + $apiVersion = $httpAttribute.ApiVersion + $provider = [System.Text.RegularExpressions.Regex]::New("/providers/([\w+\.]+)/").Match($httpPath).Groups[1].Value + $resourcePath = "/" + $httpPath.Split("$provider/")[1] + $resourceType = [System.Text.RegularExpressions.Regex]::New("/([\w]+)/\{\w+\}").Matches($resourcePath) | ForEach-Object {$_.groups[1].Value} | Join-String -Separator "/" + $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name + $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description + [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo + [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo + + return @{ + Path = $httpPath + Provider = $provider + ResourceType = $resourceType + ApiVersion = $apiVersion + CmdletName = $cmdletName + Description = $description + Example = $example + Signature = @{ + parameters = $signature + } + } +} + +function Merge-WithExistCmdletMetadata() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Collections.Specialized.OrderedDictionary] + $ExistedCmdletInfo, + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $ExistedCmdletInfo.help.parameterSets += $ParameterSetMetadata.Signature + $ExistedCmdletInfo.examples += [ordered]@{ + description = $ParameterSetMetadata.Description + parameters = $ParameterSetMetadata.Example + } + + return $ExistedCmdletInfo +} + +function New-MetadataForCmdlet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $cmdletName = $ParameterSetMetadata.CmdletName + $description = Get-CmdletDescription $cmdletName + $result = [ordered]@{ + name = $cmdletName + description = $description + path = $ParameterSetMetadata.Path + help = [ordered]@{ + learnMore = [ordered]@{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName/$cmdletName".ToLower() + } + parameterSets = @() + } + examples = @() + } + $result = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $result -ParameterSetMetadata $ParameterSetMetadata + return $result +} + +$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-functionSupported($_) } +$resourceTypes = @{} +foreach ($parameterSetName in $parameterSets) +{ + $cmdletInfo = $parameterSetsInfo.ExportedCommands[$parameterSetName] + $parameterSetMetadata = New-MetadataForParameterSet -ParameterSetInfo $cmdletInfo + $cmdletName = $parameterSetMetadata.CmdletName + if (-not ($moduleInfo.ExportedCommands.ContainsKey($cmdletName))) + { + continue + } + if ($resourceTypes.ContainsKey($parameterSetMetadata.ResourceType)) + { + $ExistedCmdletInfo = $resourceTypes[$parameterSetMetadata.ResourceType].commands | Where-Object { $_.name -eq $cmdletName } + if ($ExistedCmdletInfo) + { + $ExistedCmdletInfo = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $ExistedCmdletInfo -ParameterSetMetadata $parameterSetMetadata + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType].commands += $cmdletInfo + } + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType] = [ordered]@{ + resourceType = $parameterSetMetadata.ResourceType + apiVersion = $parameterSetMetadata.ApiVersion + learnMore = @{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName".ToLower() + } + commands = @($cmdletInfo) + provider = $parameterSetMetadata.Provider + } + } +} + +$UXFolder = 'UX' +if (Test-Path $UXFolder) +{ + Remove-Item -Path $UXFolder -Recurse +} +$null = New-Item -ItemType Directory -Path $UXFolder + +foreach ($resourceType in $resourceTypes.Keys) +{ + $resourceTypeFileName = $resourceType -replace "/", "-" + if ($resourceTypeFileName -eq "") + { + continue + } + $resourceTypeInfo = $resourceTypes[$resourceType] + $provider = $resourceTypeInfo.provider + $providerFolder = "$UXFolder/$provider" + if (-not (Test-Path $providerFolder)) + { + $null = New-Item -ItemType Directory -Path $providerFolder + } + $resourceTypeInfo.Remove("provider") + $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json" +} \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_Get.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_Get.cs index 2df5b9fac09c..ba9bad1c1d4b 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_Get.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Gets the collector policy in a specified Traffic Collector")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class GetAzNetworkFunctionCollectorPolicy_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_GetViaIdentity.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_GetViaIdentity.cs index 611a0f986d10..764fc8d4a61d 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_GetViaIdentity.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Gets the collector policy in a specified Traffic Collector")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class GetAzNetworkFunctionCollectorPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_List.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_List.cs index 70e5b757b7b8..d11550f37c08 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_List.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionCollectorPolicy_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Return list of Collector policies in a Azure Traffic Collector")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies", ApiVersion = "2022-11-01")] public partial class GetAzNetworkFunctionCollectorPolicy_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionOperation_List.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionOperation_List.cs index a3b2e82c8557..26f1e4822180 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionOperation_List.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionOperation_List.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Lists all of the available NetworkFunction Rest API operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/providers/Microsoft.NetworkFunction/operations", ApiVersion = "2022-11-01")] public partial class GetAzNetworkFunctionOperation_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_Get.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_Get.cs index 42c76845370f..fef989ed91bf 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_Get.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_Get.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Gets the specified Azure Traffic Collector in a specified resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class GetAzNetworkFunctionTrafficCollector_Get : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_GetViaIdentity.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_GetViaIdentity.cs index 6189c942b497..2339ddb24e9d 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_GetViaIdentity.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_GetViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Gets the specified Azure Traffic Collector in a specified resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class GetAzNetworkFunctionTrafficCollector_GetViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_List.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_List.cs index 47e4042044c5..5c6cac56f876 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_List.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_List.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Return list of Azure Traffic Collectors in a subscription")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkFunction/azureTrafficCollectors", ApiVersion = "2022-11-01")] public partial class GetAzNetworkFunctionTrafficCollector_List : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_List1.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_List1.cs index cd568436e6ed..95df0976abc8 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_List1.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/GetAzNetworkFunctionTrafficCollector_List1.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Return list of Azure Traffic Collectors in a Resource Group")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors", ApiVersion = "2022-11-01")] public partial class GetAzNetworkFunctionTrafficCollector_List1 : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_Create.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_Create.cs index 4fda01687d10..5e482175ea9e 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_Create.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_Create.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Collector Policy resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class NewAzNetworkFunctionCollectorPolicy_Create : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs index 04fcd8a5236d..4cd4bd4a091e 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateExpanded.cs @@ -12,10 +12,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}" /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkFunctionCollectorPolicy_CreateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Collector Policy resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class NewAzNetworkFunctionCollectorPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateViaIdentity.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateViaIdentity.cs index e951cdaec842..6af0d830d7c0 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateViaIdentity.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateViaIdentity.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Collector Policy resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class NewAzNetworkFunctionCollectorPolicy_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateViaIdentityExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateViaIdentityExpanded.cs index d14e97d9f778..908af72569d9 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateViaIdentityExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionCollectorPolicy_CreateViaIdentityExpanded.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Collector Policy resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class NewAzNetworkFunctionCollectorPolicy_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_Create.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_Create.cs index c17217ed94c7..72112bbc5a74 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_Create.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_Create.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Azure Traffic Collector resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class NewAzNetworkFunctionTrafficCollector_Create : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateExpanded.cs index a6dff8fff8fc..a354960efc30 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Azure Traffic Collector resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class NewAzNetworkFunctionTrafficCollector_CreateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateViaIdentity.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateViaIdentity.cs index 6cca8e9f3e1e..3a6b9e8283ea 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateViaIdentity.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateViaIdentity.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Azure Traffic Collector resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class NewAzNetworkFunctionTrafficCollector_CreateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateViaIdentityExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateViaIdentityExpanded.cs index 071133cc3810..faa98fa51fec 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateViaIdentityExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/NewAzNetworkFunctionTrafficCollector_CreateViaIdentityExpanded.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Azure Traffic Collector resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class NewAzNetworkFunctionTrafficCollector_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionCollectorPolicy_Delete.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionCollectorPolicy_Delete.cs index 92322f5d38de..9ab09c016052 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionCollectorPolicy_Delete.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionCollectorPolicy_Delete.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Deletes a specified Collector Policy resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class RemoveAzNetworkFunctionCollectorPolicy_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionCollectorPolicy_DeleteViaIdentity.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionCollectorPolicy_DeleteViaIdentity.cs index 524464bd2bd8..133137d0dc6f 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionCollectorPolicy_DeleteViaIdentity.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionCollectorPolicy_DeleteViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Deletes a specified Collector Policy resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class RemoveAzNetworkFunctionCollectorPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionTrafficCollector_Delete.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionTrafficCollector_Delete.cs index df9867f42b70..f90446f24bcb 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionTrafficCollector_Delete.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionTrafficCollector_Delete.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Deletes a specified Azure Traffic Collector resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class RemoveAzNetworkFunctionTrafficCollector_Delete : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionTrafficCollector_DeleteViaIdentity.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionTrafficCollector_DeleteViaIdentity.cs index fe3c22be395e..c7412525f925 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionTrafficCollector_DeleteViaIdentity.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/RemoveAzNetworkFunctionTrafficCollector_DeleteViaIdentity.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Deletes a specified Azure Traffic Collector resource.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class RemoveAzNetworkFunctionTrafficCollector_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionCollectorPolicy_Update.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionCollectorPolicy_Update.cs index 1b42fb086c6f..e99ed5954466 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionCollectorPolicy_Update.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionCollectorPolicy_Update.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Collector Policy resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class SetAzNetworkFunctionCollectorPolicy_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionCollectorPolicy_UpdateExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionCollectorPolicy_UpdateExpanded.cs index e0202f349788..7de5c56f0411 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionCollectorPolicy_UpdateExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionCollectorPolicy_UpdateExpanded.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Collector Policy resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class SetAzNetworkFunctionCollectorPolicy_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionTrafficCollector_Update.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionTrafficCollector_Update.cs index 7fc63c2dfbd7..96e02ae0413b 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionTrafficCollector_Update.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionTrafficCollector_Update.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Azure Traffic Collector resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class SetAzNetworkFunctionTrafficCollector_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionTrafficCollector_UpdateExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionTrafficCollector_UpdateExpanded.cs index 5c01cb381d89..bd6b7f6afc27 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionTrafficCollector_UpdateExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/SetAzNetworkFunctionTrafficCollector_UpdateExpanded.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Creates or updates a Azure Traffic Collector resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class SetAzNetworkFunctionTrafficCollector_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_Update.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_Update.cs index d7a12b83aeff..5420b66fe152 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_Update.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_Update.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Updates the specified Collector Policy tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class UpdateAzNetworkFunctionCollectorPolicyTag_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateExpanded.cs index 644acd99cae5..ae5bd40bba18 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Updates the specified Collector Policy tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class UpdateAzNetworkFunctionCollectorPolicyTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentity.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentity.cs index cb4dcb9ce877..19c3b0b522ac 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentity.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentity.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Updates the specified Collector Policy tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentityExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentityExpanded.cs index 55af8048fcae..c707189186ab 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentityExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentityExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Updates the specified Collector Policy tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}/collectorPolicies/{collectorPolicyName}", ApiVersion = "2022-11-01")] public partial class UpdateAzNetworkFunctionCollectorPolicyTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_Update.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_Update.cs index 1ac420a8c288..304f7e496f4b 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_Update.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_Update.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Updates the specified Azure Traffic Collector tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class UpdateAzNetworkFunctionTrafficCollectorTag_Update : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateExpanded.cs index e32ee1afc107..bb645d464a94 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Updates the specified Azure Traffic Collector tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class UpdateAzNetworkFunctionTrafficCollectorTag_UpdateExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentity.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentity.cs index 1012f7094f8f..b685cfc97d84 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentity.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentity.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Updates the specified Azure Traffic Collector tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentityExpanded.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentityExpanded.cs index 841d648b5b20..e46d89260cf9 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentityExpanded.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/cmdlets/UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentityExpanded.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Cmdlets [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Description(@"Updates the specified Azure Traffic Collector tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}", ApiVersion = "2022-11-01")] public partial class UpdateAzNetworkFunctionTrafficCollectorTag_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.IEventListener { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs index bb1217c051ee..5e35785c1d74 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -33,6 +33,9 @@ public class ExportHelpMarkdown : PSCmdlet [ValidateNotNullOrEmpty] public string ExamplesFolder { get; set; } + [Parameter()] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + protected override void ProcessRecord() { try @@ -41,7 +44,7 @@ protected override void ProcessRecord() var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); - WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder, AddComplexInterfaceInfo.IsPresent); } catch (Exception ee) { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index edc2e06f2bbd..636344797e2d 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -52,6 +52,9 @@ public class ExportProxyCmdlet : PSCmdlet [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] public SwitchParameter ExcludeDocs { get; set; } + [Parameter(ParameterSetName = "Docs")] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + protected override void ProcessRecord() { try @@ -163,7 +166,7 @@ protected override void ProcessRecord() var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; - WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder, AddComplexInterfaceInfo.IsPresent); } } } diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 3e79131c3d60..dd62596974f4 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PowerShell { internal static class MarkdownRenderer { - public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder, bool AddComplexInterfaceInfo = true) { Directory.CreateDirectory(docsFolder); var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); @@ -69,18 +69,26 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod } sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); - sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); - foreach (var alias in markdownInfo.Aliases) + if (markdownInfo.Aliases.Any()) { - sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); } - if (markdownInfo.ComplexInterfaceInfos.Any()) + foreach (var alias in markdownInfo.Aliases) { - sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); } - foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + + if (AddComplexInterfaceInfo) { - sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + } sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index b207fcb3866a..3a4d72513a54 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -191,8 +191,15 @@ 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.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + return VariantGroup.IsInternal ? "" : IsAzure ? $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet] +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) +{Indent}{Indent}}}" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -262,9 +269,26 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); - sb.Append($"{Indent}{Indent}}}"); + //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to + //override default value set in required readme + if ("SubscriptionId".Equals(parameterName)) + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); + sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.AppendLine($"{Indent}{Indent}{Indent}}}"); + sb.Append($"{Indent}{Indent}}}"); + } + else + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } } return sb.ToString(); } diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 3ca7c852fca9..f5eab8368585 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -48,6 +48,13 @@ public ProfileAttribute(params string[] profiles) } } + [AttributeUsage(AttributeTargets.Class)] + public class HttpPathAttribute : Attribute + { + public string Path { get; set; } + public string ApiVersion { get; set; } + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/MessageAttribute.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/MessageAttribute.cs index 3d90c8a4db58..da83173a1f44 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/MessageAttribute.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/MessageAttribute.cs @@ -21,7 +21,7 @@ public class GenericBreakingChangeAttribute : Attribute //The version the change is effective from, non mandatory public string DeprecateByVersion { get; } - public bool DeprecateByVersionSet { get; } = false; + public string DeprecateByAzVersion { get; } //The date on which the change comes in effect public DateTime ChangeInEfectByDate { get; } @@ -32,23 +32,18 @@ public class GenericBreakingChangeAttribute : Attribute //New way fo calling the cmdlet public string NewWay { get; set; } - public GenericBreakingChangeAttribute(string message) - { - _message = message; - } - - public GenericBreakingChangeAttribute(string message, string deprecateByVersion) + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion) { _message = message; + this.DeprecateByAzVersion = deprecateByAzVersion; this.DeprecateByVersion = deprecateByVersion; - this.DeprecateByVersionSet = true; } - public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate) + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) { _message = message; this.DeprecateByVersion = deprecateByVersion; - this.DeprecateByVersionSet = true; + this.DeprecateByAzVersion = deprecateByAzVersion; if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) { @@ -86,10 +81,8 @@ public void PrintCustomAttributeInfo(Action writeOutput) writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); } - if (DeprecateByVersionSet) - { - writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); - } + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); if (OldWay != null && NewWay != null) { @@ -114,18 +107,13 @@ public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute public string ReplacementCmdletName { get; set; } - public CmdletBreakingChangeAttribute() : - base(string.Empty) + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { } - public CmdletBreakingChangeAttribute(string deprecateByVersione) : - base(string.Empty, deprecateByVersione) - { - } - - public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { } @@ -146,20 +134,15 @@ protected override string GetAttributeSpecificMessage() public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute { public string[] ChangedParameterSet { set; get; } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) : - base(string.Empty) - { - ChangedParameterSet = changedParameterSet; - } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) : - base(string.Empty, deprecateByVersione) + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { ChangedParameterSet = changedParameterSet; } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { ChangedParameterSet = changedParameterSet; } @@ -185,6 +168,11 @@ public class PreviewMessageAttribute : Attribute { public string _message; + public DateTime EstimatedGaDate { get; } + + public bool IsEstimatedGaDateSet { get; } = false; + + public PreviewMessageAttribute() { this._message = Resources.PreviewCmdletMessage; @@ -192,12 +180,26 @@ public PreviewMessageAttribute() public PreviewMessageAttribute(string message) { - this._message = message; + this._message = string.IsNullOrEmpty(message) ? Resources.PreviewCmdletMessage : message; } - public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this(message) { - psCmdlet.WriteWarning(this._message); + if (DateTime.TryParse(estimatedDateOfGa, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.EstimatedGaDate = result; + this.IsEstimatedGaDateSet = true; + } + } + + public void PrintCustomAttributeInfo(Action writeOutput) + { + writeOutput(this._message); + + if (IsEstimatedGaDateSet) + { + writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); + } } public virtual bool IsApplicableToInvocation(InvocationInfo invocation) @@ -219,20 +221,14 @@ public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute public String NewParameterType { get; set; } - public ParameterBreakingChangeAttribute(string nameOfParameterChanging) : - base(string.Empty) + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { this.NameOfParameterChanging = nameOfParameterChanging; } - public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) : - base(string.Empty, deprecateByVersion) - { - this.NameOfParameterChanging = nameOfParameterChanging; - } - - public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { this.NameOfParameterChanging = nameOfParameterChanging; } @@ -298,20 +294,14 @@ public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute public string[] NewOutputProperties { get; set; } - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) : - base(string.Empty) - { - this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; - } - - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) : - base(string.Empty, deprecateByVersion) + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; } - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; } diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/MessageAttributeHelper.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/MessageAttributeHelper.cs index 7d2638a4138f..f2a07683ae6a 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/MessageAttributeHelper.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/MessageAttributeHelper.cs @@ -35,7 +35,7 @@ public class MessageAttributeHelper * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, * We only process the Parameter beaking change attributes attached only params listed in this list (if present) * */ - public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet, bool showPreviewMessage = true) { bool supressWarningOrError = false; @@ -57,36 +57,49 @@ public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, Inv { psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription."); } + + ProcessBreakingChangeAttributesAtRuntime(commandInfo, invocationInfo, parameterSet, psCmdlet); + + } + + private static void ProcessBreakingChangeAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); StringBuilder sb = new StringBuilder(); - Action appendBreakingChangeInfo = (string s) => sb.Append(s); + Action appendAttributeMessage = (string s) => sb.Append(s); if (attributes != null && attributes.Count > 0) { - appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); foreach (GenericBreakingChangeAttribute attribute in attributes) { - attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + attribute.PrintCustomAttributeInfo(appendAttributeMessage); } - appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); psCmdlet.WriteWarning(sb.ToString()); } + } + + public static void ProcessPreviewMessageAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); if (previewAttributes != null && previewAttributes.Count > 0) { foreach (PreviewMessageAttribute attribute in previewAttributes) { - attribute.PrintCustomAttributeInfo(psCmdlet); + attribute.PrintCustomAttributeInfo(appendAttributeMessage); } + psCmdlet.WriteWarning(sb.ToString()); } } - /** * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) * And returns all the deprecation attributes attached to it @@ -128,6 +141,12 @@ private static IEnumerable GetAllBreakingChangeA } return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); } + + public static bool ContainsPreviewAttribute(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + return GetAllPreviewAttributesInType(commandInfo, invocationInfo)?.Count() > 0; + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) { List attributeList = new List(); diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/Properties/Resources.Designer.cs b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/Properties/Resources.Designer.cs index 8aeda47075a5..8e300ddb8e2a 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/Properties/Resources.Designer.cs +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/Properties/Resources.Designer.cs @@ -734,7 +734,7 @@ public static string BreakingChangesAttributesInEffectByDateMessage } /// - /// Looks up a localized string similar to Note :The change is expected to take effect from the version : '{0}' + /// Looks up a localized string similar to Note :The change is expected to take effect from version : '{0}' /// ///. /// @@ -746,6 +746,19 @@ public static string BreakingChangesAttributesInEffectByVersion } } + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from az version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByAzVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByAzVersion", resourceCulture); + } + } + /// /// Looks up a localized string similar to ```powershell ///# Old @@ -3122,7 +3135,16 @@ public static string PortalInstructionsGit } /// - /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// Looks up a localized string similar to The estimated generally available date is '{0}'.. + /// + public static string PreviewCmdletETAMessage { + get { + return ResourceManager.GetString("PreviewCmdletETAMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. Its behavior is subject to change based on customer feedback.. /// public static string PreviewCmdletMessage { @@ -5630,4 +5652,4 @@ public static string YesHint } } } -} +} \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/Properties/Resources.resx b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/Properties/Resources.resx index 598cd53e958a..a08a2e50172b 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/Properties/Resources.resx +++ b/src/NetworkFunction/NetworkFunction.Autorest/generated/runtime/Properties/Resources.resx @@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can -- The change is expected to take effect from the version : '{0}' +- The change is expected to take effect from version : '{0}' ```powershell @@ -1736,6 +1736,12 @@ The type of the parameter is changing from '{0}' to '{1}'. Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. - This cmdlet is in preview. The functionality may not be available in the selected subscription. + This cmdlet is in preview. Its behavior is subject to change based on customer feedback. + + + The estimated generally available date is '{0}'. + + + - The change is expected to take effect from Az version : '{0}' \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Az.NetworkFunction.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Az.NetworkFunction.md new file mode 100644 index 000000000000..0492f31d673a --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Az.NetworkFunction.md @@ -0,0 +1,43 @@ +--- +Module Name: Az.NetworkFunction +Module Guid: 1d339b1c-5a86-4fbd-9a2e-d0497c39b397 +Download Help Link: https://learn.microsoft.com/powershell/module/az.networkfunction +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.NetworkFunction Module +## Description +Microsoft Azure PowerShell: NetworkFunction cmdlets + +## Az.NetworkFunction Cmdlets +### [Get-AzNetworkFunctionCollectorPolicy](Get-AzNetworkFunctionCollectorPolicy.md) +Gets the collector policy in a specified Traffic Collector + +### [Get-AzNetworkFunctionTrafficCollector](Get-AzNetworkFunctionTrafficCollector.md) +Gets the specified Azure Traffic Collector in a specified resource group + +### [New-AzNetworkFunctionCollectorPolicy](New-AzNetworkFunctionCollectorPolicy.md) +Creates or updates a Collector Policy resource + +### [New-AzNetworkFunctionTrafficCollector](New-AzNetworkFunctionTrafficCollector.md) +Creates or updates a Azure Traffic Collector resource + +### [Remove-AzNetworkFunctionCollectorPolicy](Remove-AzNetworkFunctionCollectorPolicy.md) +Deletes a specified Collector Policy resource. + +### [Remove-AzNetworkFunctionTrafficCollector](Remove-AzNetworkFunctionTrafficCollector.md) +Deletes a specified Azure Traffic Collector resource. + +### [Update-AzNetworkFunctionCollectorPolicy](Update-AzNetworkFunctionCollectorPolicy.md) +Creates or updates a Collector Policy resource + +### [Update-AzNetworkFunctionCollectorPolicyTag](Update-AzNetworkFunctionCollectorPolicyTag.md) +Updates the specified Collector Policy tags. + +### [Update-AzNetworkFunctionTrafficCollector](Update-AzNetworkFunctionTrafficCollector.md) +Creates or updates a Azure Traffic Collector resource + +### [Update-AzNetworkFunctionTrafficCollectorTag](Update-AzNetworkFunctionTrafficCollectorTag.md) +Updates the specified Azure Traffic Collector tags. + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Get-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Get-AzNetworkFunctionCollectorPolicy.md new file mode 100644 index 000000000000..26787ee4cb76 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Get-AzNetworkFunctionCollectorPolicy.md @@ -0,0 +1,182 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctioncollectorpolicy +schema: 2.0.0 +--- + +# Get-AzNetworkFunctionCollectorPolicy + +## SYNOPSIS +Gets the collector policy in a specified Traffic Collector + +## SYNTAX + +### List (Default) +``` +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzNetworkFunctionCollectorPolicy -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the collector policy in a specified Traffic Collector + +## EXAMPLES + +### Example 1: Get list of collector policies by atc name and resource group +```powershell +Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName test -resourcegroupname test | Format-List +``` + +```output +Name : cp1 +Etag : cf0336a2-7454-4aa4-add9-1de3e2291143 +Id : /subscriptions/subid/resourceGroups/test/providers/Microsoft.NetworkFunction/azureTrafficCollectors/test/collectorPolicies/cp1 +Type : Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies +Properties : { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" + } +``` + +This cmdlet gets list of traffic collector policies by atc name and resource group. + +## PARAMETERS + +### -AzureTrafficCollectorName +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Collector Policy Name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: CollectorPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +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). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Get-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Get-AzNetworkFunctionTrafficCollector.md new file mode 100644 index 000000000000..b8dc51c3294d --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Get-AzNetworkFunctionTrafficCollector.md @@ -0,0 +1,200 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctiontrafficcollector +schema: 2.0.0 +--- + +# Get-AzNetworkFunctionTrafficCollector + +## SYNOPSIS +Gets the specified Azure Traffic Collector in a specified resource group + +## SYNTAX + +### List (Default) +``` +Get-AzNetworkFunctionTrafficCollector [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +### Get +``` +Get-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzNetworkFunctionTrafficCollector -InputObject [-DefaultProfile ] + [] +``` + +### List1 +``` +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the specified Azure Traffic Collector in a specified resource group + +## EXAMPLES + +### Example 1: Get list of traffic collectors in selected subscription +```powershell +Get-AzNetworkFunctionTrafficCollector | Format-List +``` + +```output +CollectorPolicies : {} +Etag : cf0336a2-7454-4aa4-add9-1de3e2291143 +Id : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/atcTest/providers/Microsoft.NetworkFunction/azureTrafficCollectors/pstestjuly18 +Location : eastus +Name : pstestjuly18 +ProvisioningState : Failed +Tags : Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Models.ResourceTags +Type : Microsoft.NetworkFunction/AzureTrafficCollectors + +CollectorPolicies : {} +Etag : cedea0e9-e9e4-4b2e-816f-dad184d6b424 +Id : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/atcTest/providers/Microsoft.NetworkFunction/azureTrafficCollectors/newpsatc +Location : eastus +Name : newpsatc +ProvisioningState : Succeeded +Tags : Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Models.ResourceTags +Type : Microsoft.NetworkFunction/AzureTrafficCollectors +``` + +This cmdlet gets list of traffic collectors in selected subscription. + +### Example 2: Get list of traffic collectors by resource group +```powershell +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName test | Format-List +``` + +```output +CollectorPolicies : {} +Etag : cedea0e9-e9e4-4b2e-816f-dad184d6b424 +Id : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/test/providers/Microsoft.NetworkFunction/azureTrafficCollectors/newpsatc +Location : eastus +Name : newpsatc +ProvisioningState : Succeeded +Tags : Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Models.ResourceTags +Type : Microsoft.NetworkFunction/AzureTrafficCollectors +``` + +This cmdlet gets list of traffic collectors by resource group. + +### Example 3: Get list of traffic collectors by name +```powershell +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName test -name test | Format-List +``` + +```output +CollectorPolicies : {} +Etag : cedea0e9-e9e4-4b2e-816f-dad184d6b424 +Id : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/test/providers/Microsoft.NetworkFunction/azureTrafficCollectors/test +Location : eastus +Name : newpsatc +ProvisioningState : Succeeded +Tags : Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Models.ResourceTags +Type : Microsoft.NetworkFunction/AzureTrafficCollectors +``` + +This cmdlet gets list of traffic collectors by name. + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: AzureTrafficCollectorName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +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). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/New-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/NetworkFunction.Autorest/help/New-AzNetworkFunctionCollectorPolicy.md new file mode 100644 index 000000000000..bd35f89eee26 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/New-AzNetworkFunctionCollectorPolicy.md @@ -0,0 +1,292 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy +schema: 2.0.0 +--- + +# New-AzNetworkFunctionCollectorPolicy + +## SYNOPSIS +Creates or updates a Collector Policy resource + +## SYNTAX + +``` +New-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name + -ResourceGroupName -Location [-SubscriptionId ] + [-EmissionPolicy ] + [-IngestionPolicyIngestionSource ] + [-IngestionPolicyIngestionType ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a Collector Policy resource + +## EXAMPLES + +### Example 1: Create a new traffic collector policy +```powershell +New-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus | Format-List +``` + +```output +Name : cp1 +Etag : cf0336a2-7454-4aa4-add9-1de3e2291143 +Id : /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1 +Type : Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies +Properties : { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" + } +``` + +This cmdlet creates a new traffic collector policy. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureTrafficCollectorName +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EmissionPolicy +Emission policies. +To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IEmissionPoliciesPropertiesFormat[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionPolicyIngestionSource +Ingestion Sources. +To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IIngestionSourcesPropertiesFormat[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionPolicyIngestionType +The ingestion type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Collector Policy Name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: CollectorPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +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). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/New-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/NetworkFunction.Autorest/help/New-AzNetworkFunctionTrafficCollector.md new file mode 100644 index 000000000000..02de1eb6cc98 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/New-AzNetworkFunctionTrafficCollector.md @@ -0,0 +1,210 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctiontrafficcollector +schema: 2.0.0 +--- + +# New-AzNetworkFunctionTrafficCollector + +## SYNOPSIS +Creates or updates a Azure Traffic Collector resource + +## SYNTAX + +``` +New-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location + [-SubscriptionId ] [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a Azure Traffic Collector resource + +## EXAMPLES + +### Example 1: Create a new traffic collector +```powershell +New-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname test -location eastus | Format-List +``` + +```output +CollectorPolicies : {} +Etag : cf0336a2-7454-4aa4-add9-1de3e2291143 +Id : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/test/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atctestps +Location : eastus +Name : atctestps +ProvisioningState : Succeeded +Tags : Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Models.ResourceTags +Type : Microsoft.NetworkFunction/AzureTrafficCollectors +``` + +This cmdlet creates a new traffic collector. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AzureTrafficCollectorName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +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). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/README.md b/src/NetworkFunction/NetworkFunction.Autorest/help/README.md new file mode 100644 index 000000000000..78ff9239d4bc --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.NetworkFunction` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.NetworkFunction` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Remove-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Remove-AzNetworkFunctionCollectorPolicy.md new file mode 100644 index 000000000000..fc1f5a124c85 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Remove-AzNetworkFunctionCollectorPolicy.md @@ -0,0 +1,224 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctioncollectorpolicy +schema: 2.0.0 +--- + +# Remove-AzNetworkFunctionCollectorPolicy + +## SYNOPSIS +Deletes a specified Collector Policy resource. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzNetworkFunctionCollectorPolicy -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a specified Collector Policy resource. + +## EXAMPLES + +### Example 1: Delete a new traffic collector policy +```powershell +Remove-AzNetworkFunctionCollectorPolicy -azuretrafficcollectorname atctestps -collectorpolicyname cp1 -resourcegroupname test +``` + +This cmdlet deletes a traffic collector policy. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureTrafficCollectorName +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Collector Policy Name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: CollectorPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +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). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Remove-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Remove-AzNetworkFunctionTrafficCollector.md new file mode 100644 index 000000000000..bce40c8d5cef --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Remove-AzNetworkFunctionTrafficCollector.md @@ -0,0 +1,208 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctiontrafficcollector +schema: 2.0.0 +--- + +# Remove-AzNetworkFunctionTrafficCollector + +## SYNOPSIS +Deletes a specified Azure Traffic Collector resource. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzNetworkFunctionTrafficCollector -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a specified Azure Traffic Collector resource. + +## EXAMPLES + +### Example 1: Delete a new traffic collector +```powershell +Remove-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname SEA-Cust10 +``` + +This cmdlet deletes a traffic collector. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: AzureTrafficCollectorName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +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). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionCollectorPolicy.md new file mode 100644 index 000000000000..f8e615284ea0 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionCollectorPolicy.md @@ -0,0 +1,292 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctioncollectorpolicy +schema: 2.0.0 +--- + +# Update-AzNetworkFunctionCollectorPolicy + +## SYNOPSIS +Creates or updates a Collector Policy resource + +## SYNTAX + +``` +Update-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name + -ResourceGroupName -Location [-SubscriptionId ] + [-EmissionPolicy ] + [-IngestionPolicyIngestionSource ] + [-IngestionPolicyIngestionType ] [-Tag ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a Collector Policy resource + +## EXAMPLES + +### Example 1: Update a traffic collector policy +```powershell +Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 -location eastus | Format-List +``` + +```output +Name : cp1 +Etag : cf0336a2-7454-4aa4-add9-1de3e2291143 +Id : /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1 +Type : Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies +Properties : { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" + } +``` + +This cmdlet updates a traffic collector policy. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureTrafficCollectorName +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EmissionPolicy +Emission policies. +To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IEmissionPoliciesPropertiesFormat[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionPolicyIngestionSource +Ingestion Sources. +To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IIngestionSourcesPropertiesFormat[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IngestionPolicyIngestionType +The ingestion type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Collector Policy Name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: CollectorPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +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). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionCollectorPolicyTag.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionCollectorPolicyTag.md new file mode 100644 index 000000000000..a49353477677 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionCollectorPolicyTag.md @@ -0,0 +1,228 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctioncollectorpolicytag +schema: 2.0.0 +--- + +# Update-AzNetworkFunctionCollectorPolicyTag + +## SYNOPSIS +Updates the specified Collector Policy tags. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzNetworkFunctionCollectorPolicyTag -AzureTrafficCollectorName -CollectorPolicyName + -ResourceGroupName [-SubscriptionId ] [-Tag ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzNetworkFunctionCollectorPolicyTag -InputObject [-Tag ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates the specified Collector Policy tags. + +## EXAMPLES + +### Example 1: Updates a traffic collector tag +```powershell +Update-AzNetworkFunctionCollectorPolicyTag -collectorpolicyname cp1 -azuretrafficcollectorname atc -resourcegroupname rg1 | Format-List +``` + +```output +Name : cp1 +Etag : 72090554-7e3b-43f2-80ad-99a9020dcb11 +Id : /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1 +Type : Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies +Location : West US +Tags : { + "key1": "value1", + "key2": "value2" + } +Properties : { + "ingestionPolicy": { + "ingestionType": "IPFIX", + "ingestionSources": [ + { + "resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName", + "sourceType": "Resource" + } + ] + }, + "emissionPolicies": [ + { + "emissionType": "IPFIX", + "emissionDestinations": [ + { + "destinationType": "AzureMonitor" + } + ] + } + ], + "provisioningState": "Succeeded" + } +``` + +This cmdlet updates a collector policy tag. + +## PARAMETERS + +### -AzureTrafficCollectorName +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CollectorPolicyName +Collector Policy Name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +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). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionTrafficCollector.md new file mode 100644 index 000000000000..500b4105aeed --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionTrafficCollector.md @@ -0,0 +1,225 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctiontrafficcollector +schema: 2.0.0 +--- + +# Update-AzNetworkFunctionTrafficCollector + +## SYNOPSIS +Creates or updates a Azure Traffic Collector resource + +## SYNTAX + +``` +Update-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location + [-SubscriptionId ] [-CollectorPolicy ] [-Tag ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates a Azure Traffic Collector resource + +## EXAMPLES + +### Example 1: Updates a traffic collector +```powershell +Update-AzNetworkFunctionTrafficCollector -name atctestps -resourcegroupname test -location eastus | Format-List +``` + +```output +CollectorPolicies : {} +Etag : cf0336a2-7454-4aa4-add9-1de3e2291143 +Id : /subscriptions/62364504-2406-418e-971c-05822ff72fad/resourceGroups/test/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atctestps +Location : eastus +Name : atctestps +ProvisioningState : Succeeded +Tags : Microsoft.Azure.PowerShell.Cmdlets.AzureTrafficCollector.Models.ResourceTags +Type : Microsoft.NetworkFunction/AzureTrafficCollectors +``` + +This cmdlet updates a traffic collector. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CollectorPolicy +Collector Policies for Azure Traffic Collector. +To construct, see NOTES section for COLLECTORPOLICY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: AzureTrafficCollectorName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +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). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionTrafficCollectorTag.md b/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionTrafficCollectorTag.md new file mode 100644 index 000000000000..f73e22f76fc9 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/help/Update-AzNetworkFunctionTrafficCollectorTag.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.NetworkFunction +online version: https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctiontrafficcollectortag +schema: 2.0.0 +--- + +# Update-AzNetworkFunctionTrafficCollectorTag + +## SYNOPSIS +Updates the specified Azure Traffic Collector tags. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzNetworkFunctionTrafficCollectorTag -AzureTrafficCollectorName -ResourceGroupName + [-SubscriptionId ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzNetworkFunctionTrafficCollectorTag -InputObject [-Tag ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates the specified Azure Traffic Collector tags. + +## EXAMPLES + +### Example 1: Updates a traffic collector tag +```powershell +Update-AzNetworkFunctionTrafficCollectorTag -azuretrafficcollectorname atc -resourcegroupname rg1 | Format-List +``` + +```output +Name : atc +Etag : cf0336a2-7454-4aa4-add9-1de3e2291143 +Id : /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc +Type : Microsoft.NetworkFunction/azureTrafficCollectors +Location : West US +Tags : { + "key1": "value1", + "key2": "value2" + } +Properties : { + "collectorPolicies": [], + "provisioningState": "Succeeded" + } +``` + +This cmdlet updates a traffic collector tag. + +## PARAMETERS + +### -AzureTrafficCollectorName +Azure Traffic Collector name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +Azure Subscription ID. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +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). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.INetworkFunctionIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.IAzureTrafficCollector + +## NOTES + +## RELATED LINKS + diff --git a/src/NetworkFunction/NetworkFunction.Autorest/internal/New-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/internal/New-AzNetworkFunctionCollectorPolicy.ps1 index f31ce882ef60..13b0f7a21434 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/internal/New-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/internal/New-AzNetworkFunctionCollectorPolicy.ps1 @@ -71,15 +71,17 @@ https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfu #> function New-AzNetworkFunctionCollectorPolicy { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy])] -[CmdletBinding(DefaultParameterSetName='CreateViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # Azure Traffic Collector name ${AzureTrafficCollectorName}, [Parameter(ParameterSetName='Create', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Alias('CollectorPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] @@ -87,12 +89,14 @@ param( ${Name}, [Parameter(ParameterSetName='Create', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # The name of the resource group. ${ResourceGroupName}, [Parameter(ParameterSetName='Create')] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -115,12 +119,14 @@ param( # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] [System.String] # Resource location. ${Location}, + [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] @@ -129,6 +135,7 @@ param( # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. ${EmissionPolicy}, + [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] @@ -137,6 +144,7 @@ param( # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. ${IngestionPolicyIngestionSource}, + [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] @@ -144,6 +152,7 @@ param( # The ingestion type. ${IngestionPolicyIngestionType}, + [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ITrackedResourceTags]))] @@ -222,11 +231,18 @@ begin { $mapping = @{ Create = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_Create'; + CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateExpanded'; CreateViaIdentity = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateViaIdentityExpanded'; } - if (('Create') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/internal/New-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/internal/New-AzNetworkFunctionTrafficCollector.ps1 index 91c844616c9e..236913edda3e 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/internal/New-AzNetworkFunctionTrafficCollector.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/internal/New-AzNetworkFunctionTrafficCollector.ps1 @@ -180,7 +180,13 @@ begin { CreateViaIdentityExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionTrafficCollector_CreateViaIdentityExpanded'; } if (('Create') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/internal/ProxyCmdletDefinitions.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/internal/ProxyCmdletDefinitions.ps1 index ad13ac9550c0..e745fe408c18 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -181,15 +181,17 @@ https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfu #> function New-AzNetworkFunctionCollectorPolicy { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ICollectorPolicy])] -[CmdletBinding(DefaultParameterSetName='CreateViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Create', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # Azure Traffic Collector name ${AzureTrafficCollectorName}, [Parameter(ParameterSetName='Create', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Alias('CollectorPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] @@ -197,12 +199,14 @@ param( ${Name}, [Parameter(ParameterSetName='Create', Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [System.String] # The name of the resource group. ${ResourceGroupName}, [Parameter(ParameterSetName='Create')] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -225,12 +229,14 @@ param( # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] [System.String] # Resource location. ${Location}, + [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] @@ -239,6 +245,7 @@ param( # To construct, see NOTES section for EMISSIONPOLICY properties and create a hash table. ${EmissionPolicy}, + [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] @@ -247,6 +254,7 @@ param( # To construct, see NOTES section for INGESTIONPOLICYINGESTIONSOURCE properties and create a hash table. ${IngestionPolicyIngestionSource}, + [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Support.IngestionType])] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] @@ -254,6 +262,7 @@ param( # The ingestion type. ${IngestionPolicyIngestionType}, + [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Models.Api20221101.ITrackedResourceTags]))] @@ -332,11 +341,18 @@ begin { $mapping = @{ Create = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_Create'; + CreateExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateExpanded'; CreateViaIdentity = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateViaIdentity'; CreateViaIdentityExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionCollectorPolicy_CreateViaIdentityExpanded'; } - if (('Create') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + if (('Create', 'CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -535,7 +551,13 @@ begin { CreateViaIdentityExpanded = 'Az.NetworkFunction.private\New-AzNetworkFunctionTrafficCollector_CreateViaIdentityExpanded'; } if (('Create') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -763,7 +785,13 @@ begin { UpdateExpanded = 'Az.NetworkFunction.private\Set-AzNetworkFunctionCollectorPolicy_UpdateExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -945,7 +973,13 @@ begin { UpdateExpanded = 'Az.NetworkFunction.private\Set-AzNetworkFunctionTrafficCollector_UpdateExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -1115,7 +1149,13 @@ begin { UpdateViaIdentity = 'Az.NetworkFunction.private\Update-AzNetworkFunctionCollectorPolicyTag_UpdateViaIdentity'; } if (('Update') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -1279,7 +1319,13 @@ begin { UpdateViaIdentity = 'Az.NetworkFunction.private\Update-AzNetworkFunctionTrafficCollectorTag_UpdateViaIdentity'; } if (('Update') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/internal/Set-AzNetworkFunctionCollectorPolicy.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/internal/Set-AzNetworkFunctionCollectorPolicy.ps1 index f9b4f0e3ee36..c87a8e907154 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/internal/Set-AzNetworkFunctionCollectorPolicy.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/internal/Set-AzNetworkFunctionCollectorPolicy.ps1 @@ -209,7 +209,13 @@ begin { UpdateExpanded = 'Az.NetworkFunction.private\Set-AzNetworkFunctionCollectorPolicy_UpdateExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/internal/Set-AzNetworkFunctionTrafficCollector.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/internal/Set-AzNetworkFunctionTrafficCollector.ps1 index d452340ef5ad..d215147940c9 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/internal/Set-AzNetworkFunctionTrafficCollector.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/internal/Set-AzNetworkFunctionTrafficCollector.ps1 @@ -163,7 +163,13 @@ begin { UpdateExpanded = 'Az.NetworkFunction.private\Set-AzNetworkFunctionTrafficCollector_UpdateExpanded'; } if (('Update', 'UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/internal/Update-AzNetworkFunctionCollectorPolicyTag.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/internal/Update-AzNetworkFunctionCollectorPolicyTag.ps1 index d73758a65b66..a13803a08df4 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/internal/Update-AzNetworkFunctionCollectorPolicyTag.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/internal/Update-AzNetworkFunctionCollectorPolicyTag.ps1 @@ -151,7 +151,13 @@ begin { UpdateViaIdentity = 'Az.NetworkFunction.private\Update-AzNetworkFunctionCollectorPolicyTag_UpdateViaIdentity'; } if (('Update') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/internal/Update-AzNetworkFunctionTrafficCollectorTag.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/internal/Update-AzNetworkFunctionTrafficCollectorTag.ps1 index 74e81d24a175..da58fa1c47aa 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/internal/Update-AzNetworkFunctionTrafficCollectorTag.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/internal/Update-AzNetworkFunctionTrafficCollectorTag.ps1 @@ -145,7 +145,13 @@ begin { UpdateViaIdentity = 'Az.NetworkFunction.private\Update-AzNetworkFunctionTrafficCollectorTag_UpdateViaIdentity'; } if (('Update') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkFunction.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if ($testPlayback) { + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') + } else { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/NetworkFunction/NetworkFunction.Autorest/test-module.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/test-module.ps1 index 1daedb6a7a98..1a4782db1113 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/test-module.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/test-module.ps1 @@ -74,13 +74,14 @@ try if ($TestMode -ne 'playback') { setupEnv + } else { + $env:AzPSAutorestTestPlaybackMode = $true } $testFolder = Join-Path $PSScriptRoot 'test' if ($null -ne $TestName) { Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") - } else - { + } else { Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") } } Finally @@ -89,6 +90,9 @@ try { cleanupEnv } + else { + $env:AzPSAutorestTestPlaybackMode = '' + } } Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/test/New-AzNetworkFunctionCollectorPolicy.Tests.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/test/New-AzNetworkFunctionCollectorPolicy.Tests.ps1 index 3a2d8caab562..570054154703 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/test/New-AzNetworkFunctionCollectorPolicy.Tests.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/test/New-AzNetworkFunctionCollectorPolicy.Tests.ps1 @@ -15,19 +15,33 @@ if(($null -eq $TestName) -or ($TestName -contains 'New-AzNetworkFunctionCollecto } Describe 'New-AzNetworkFunctionCollectorPolicy' { - It 'CreateExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'CreateExpanded' { + { + { New-AzNetworkFunctionCollectorPolicy -collectorpolicyname $env.collectorPolicyName -azuretrafficcollectorname $env.azureTrafficCollectorName -resourcegroupname $env.resourceGroup -location $env.location -IngestionPolicyIngestionSource @{ResourceId = $env.ResourceId1G} -IngestionPolicyIngestionType $env.IngestionType } | Should -Not -Throw + } } - It 'Create' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'CreateExpanded1' { + { + { New-AzNetworkFunctionCollectorPolicy -collectorpolicyname $env.collectorPolicyName -azuretrafficcollectorname $env.azureTrafficCollectorName -resourcegroupname $env.resourceGroup -location $env.location -IngestionPolicyIngestionSource @{ResourceId = $env.ResourceIdLessThan1G} -IngestionPolicyIngestionType $env.IngestionType } | Should -Throw -ExpectedMessage "CollectorPolicy can not be updated because circuit has bandwidth less than 1G. Circuit size with a bandwidth of 1G or more is supported." + } } - It 'CreateViaIdentityExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'Create' { + { + { New-AzNetworkFunctionCollectorPolicy -collectorpolicyname $env.collectorPolicyName -azuretrafficcollectorname $env.azureTrafficCollectorName -resourcegroupname $env.resourceGroup -location $env.location -IngestionPolicyIngestionSource @{ResourceId = $env.ResourceId1G} -IngestionPolicyIngestionType $env.IngestionType } | Should -Not -Throw + } } - It 'CreateViaIdentity' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'CreateViaIdentityExpanded' { + { + { New-AzNetworkFunctionCollectorPolicy -collectorpolicyname $env.collectorPolicyName -azuretrafficcollectorname $env.azureTrafficCollectorName -resourcegroupname $env.resourceGroup -location $env.location -IngestionPolicyIngestionSource @{ResourceId = $env.ResourceId1G} -IngestionPolicyIngestionType $env.IngestionType } | Should -Not -Throw + } + } + + It 'CreateViaIdentity' { + { + { New-AzNetworkFunctionCollectorPolicy -collectorpolicyname $env.collectorPolicyName -azuretrafficcollectorname $env.azureTrafficCollectorName -resourcegroupname $env.resourceGroup -location $env.location -IngestionPolicyIngestionSource @{ResourceId = $env.ResourceId1G} -IngestionPolicyIngestionType $env.IngestionType } | Should -Not -Throw + } } } diff --git a/src/NetworkFunction/NetworkFunction.Autorest/test/Update-AzNetworkFunctionCollectorPolicy.Tests.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/test/Update-AzNetworkFunctionCollectorPolicy.Tests.ps1 index ec1a10585699..b3423040fbe1 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/test/Update-AzNetworkFunctionCollectorPolicy.Tests.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/test/Update-AzNetworkFunctionCollectorPolicy.Tests.ps1 @@ -15,7 +15,15 @@ if(($null -eq $TestName) -or ($TestName -contains 'Update-AzNetworkFunctionColle } Describe 'Update-AzNetworkFunctionCollectorPolicy' { - It 'UpdateExpanded' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'UpdateExpanded' { + { + { Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname $env.collectorPolicyName -azuretrafficcollectorname $env.azureTrafficCollectorName -resourcegroupname $env.resourceGroup -location $env.location -IngestionPolicyIngestionSource @{ResourceId = $env.ResourceId1G} -IngestionPolicyIngestionType $env.IngestionType } | Should Not Throw + } } -} + + It 'UpdateExpanded1' { + { + { Update-AzNetworkFunctionCollectorPolicy -collectorpolicyname $env.collectorPolicyName -azuretrafficcollectorname $env.azureTrafficCollectorName -resourcegroupname $env.resourceGroup -location $env.location -IngestionPolicyIngestionSource @{ResourceId = $env.ResourceIdLessThan1G} -IngestionPolicyIngestionType $env.IngestionType } | Should Throw -ExpectedMessage "CollectorPolicy can not be updated because circuit has bandwidth less than 1G. Circuit size with a bandwidth of 1G or more is supported." + } + } +} \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/test/env.json b/src/NetworkFunction/NetworkFunction.Autorest/test/env.json new file mode 100644 index 000000000000..2b89573db682 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/test/env.json @@ -0,0 +1,10 @@ +{ + "collectorPolicyName": "cp1", + "azureTrafficCollectorName": "UTPSatc", + "resourceGroup": "DO_NOT_DELETE_ATC_PS_Tests", + "location": "eastus", + "SubscriptionId": "05f401ac-885f-4ba4-b2d6-7c5444596230", + "ResourceId1G": "/subscriptions/05f401ac-885f-4ba4-b2d6-7c5444596230/resourceGroups/DO_NOT_DELETE_ATC_PS_Tests/providers/Microsoft.Network/expressRouteCircuits/DO_NOT_DELETE_ATC_PS_Test_Ckt", + "ResourceIdLessThan1G": "/subscriptions/05f401ac-885f-4ba4-b2d6-7c5444596230/resourceGroups/DO_NOT_DELETE_ATC_PS_Tests/providers/Microsoft.Network/expressRouteCircuits/DO_NOT_DELETE_ATC_PS_Test_Ckt_1", + "IngestionType": "IPFIX" +} \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/test/loadEnv.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/test/loadEnv.ps1 index 5f079e89615e..6a7c385c6b7d 100644 --- a/src/NetworkFunction/NetworkFunction.Autorest/test/loadEnv.ps1 +++ b/src/NetworkFunction/NetworkFunction.Autorest/test/loadEnv.ps1 @@ -25,5 +25,5 @@ if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { $env = @{} if (Test-Path -Path $envFilePath) { $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json - $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} + $PSDefaultParameterValues=@{"*:Tenant"=$env.Tenant} } \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 b/src/NetworkFunction/NetworkFunction.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 new file mode 100644 index 000000000000..5319862d3372 --- /dev/null +++ b/src/NetworkFunction/NetworkFunction.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 @@ -0,0 +1,7 @@ +param() +if ($env:AzPSAutorestTestPlaybackMode) { + $loadEnvPath = Join-Path $PSScriptRoot '..' 'test' 'loadEnv.ps1' + . ($loadEnvPath) + return $env.SubscriptionId +} +return (Get-AzContext).Subscription.Id \ No newline at end of file diff --git a/src/NetworkFunction/NetworkFunction/Az.NetworkFunction.psd1 b/src/NetworkFunction/NetworkFunction/Az.NetworkFunction.psd1 index 51fbf6f1279b..ac614da13b4d 100644 --- a/src/NetworkFunction/NetworkFunction/Az.NetworkFunction.psd1 +++ b/src/NetworkFunction/NetworkFunction/Az.NetworkFunction.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 12/5/2023 +# Generated on: 4/7/2024 # @{ @@ -51,7 +51,7 @@ DotNetFrameworkVersion = '4.7.2' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.10.3'; }) +RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.17.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'NetworkFunction.Autorest/bin/Az.NetworkFunction.private.dll' diff --git a/src/NetworkFunction/NetworkFunction/ChangeLog.md b/src/NetworkFunction/NetworkFunction/ChangeLog.md index 443841569a9d..e40966fe80f8 100644 --- a/src/NetworkFunction/NetworkFunction/ChangeLog.md +++ b/src/NetworkFunction/NetworkFunction/ChangeLog.md @@ -18,7 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release - +* Added validation in New/Update collector policy cmdlets to throw exception if ExpressRoute Circuit bandwidth is less than 1G. ## Version 0.1.2 * Updated api version to 2022-11-01 * Added new cmdlet: `Update-AzNetworkFunctionCollectorPolicyTag` diff --git a/src/NetworkFunction/NetworkFunction/help/Get-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/NetworkFunction/help/Get-AzNetworkFunctionCollectorPolicy.md index 6df1e463f421..910a9d827673 100644 --- a/src/NetworkFunction/NetworkFunction/help/Get-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/NetworkFunction/help/Get-AzNetworkFunctionCollectorPolicy.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctioncollectorpolicy schema: 2.0.0 @@ -15,19 +15,21 @@ Gets the collector policy in a specified Traffic Collector ### List (Default) ``` Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [] + [-SubscriptionId ] [-DefaultProfile ] [-ProgressAction ] + [] ``` ### Get ``` Get-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name - -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] + [-ProgressAction ] [] ``` ### GetViaIdentity ``` Get-AzNetworkFunctionCollectorPolicy -InputObject [-DefaultProfile ] - [] + [-ProgressAction ] [] ``` ## DESCRIPTION @@ -78,7 +80,7 @@ Azure Traffic Collector name ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -135,12 +137,27 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -155,7 +172,7 @@ Azure Subscription ID. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -178,19 +195,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`INPUTOBJECT `: Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[Id ]`: Resource identity path - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/Get-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/NetworkFunction/help/Get-AzNetworkFunctionTrafficCollector.md index af2c32302d9e..8ba76c8121ec 100644 --- a/src/NetworkFunction/NetworkFunction/help/Get-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/NetworkFunction/help/Get-AzNetworkFunctionTrafficCollector.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/get-aznetworkfunctiontrafficcollector schema: 2.0.0 @@ -15,25 +15,25 @@ Gets the specified Azure Traffic Collector in a specified resource group ### List (Default) ``` Get-AzNetworkFunctionTrafficCollector [-SubscriptionId ] [-DefaultProfile ] - [] + [-ProgressAction ] [] ``` ### Get ``` Get-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] - [-DefaultProfile ] [] + [-DefaultProfile ] [-ProgressAction ] [] ``` -### GetViaIdentity +### List1 ``` -Get-AzNetworkFunctionTrafficCollector -InputObject [-DefaultProfile ] - [] +Get-AzNetworkFunctionTrafficCollector -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-ProgressAction ] [] ``` -### List1 +### GetViaIdentity ``` -Get-AzNetworkFunctionTrafficCollector -ResourceGroupName [-SubscriptionId ] - [-DefaultProfile ] [] +Get-AzNetworkFunctionTrafficCollector -InputObject [-DefaultProfile ] + [-ProgressAction ] [] ``` ## DESCRIPTION @@ -153,6 +153,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -173,7 +188,7 @@ Azure Subscription ID. ```yaml Type: System.String[] -Parameter Sets: Get, List, List1 +Parameter Sets: List, Get, List1 Aliases: Required: False @@ -196,19 +211,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`INPUTOBJECT `: Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[Id ]`: Resource identity path - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/New-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/NetworkFunction/help/New-AzNetworkFunctionCollectorPolicy.md index 8b767a72632d..ce38eba56d05 100644 --- a/src/NetworkFunction/NetworkFunction/help/New-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/NetworkFunction/help/New-AzNetworkFunctionCollectorPolicy.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctioncollectorpolicy schema: 2.0.0 @@ -14,11 +14,11 @@ Creates or updates a Collector Policy resource ``` New-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name - -ResourceGroupName -Location [-SubscriptionId ] + -ResourceGroupName [-SubscriptionId ] -Location [-EmissionPolicy ] [-IngestionPolicyIngestionSource ] [-IngestionPolicyIngestionType ] [-Tag ] [-DefaultProfile ] [-AsJob] - [-NoWait] [-Confirm] [-WhatIf] [] + [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -95,8 +95,7 @@ Accept wildcard characters: False ``` ### -DefaultProfile -The DefaultProfile parameter is not functional. -Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml Type: System.Management.Automation.PSObject @@ -202,6 +201,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -289,21 +303,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`EMISSIONPOLICY `: Emission policies. - - `[EmissionDestination ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - -`INGESTIONPOLICYINGESTIONSOURCE `: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/New-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/NetworkFunction/help/New-AzNetworkFunctionTrafficCollector.md index 5e0892d7a8e1..4c11dfe226b1 100644 --- a/src/NetworkFunction/NetworkFunction/help/New-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/NetworkFunction/help/New-AzNetworkFunctionTrafficCollector.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/new-aznetworkfunctiontrafficcollector schema: 2.0.0 @@ -13,9 +13,9 @@ Creates or updates a Azure Traffic Collector resource ## SYNTAX ``` -New-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location - [-SubscriptionId ] [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] - [-WhatIf] [] +New-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] + -Location [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -119,6 +119,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -206,7 +221,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -ALIASES - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/Remove-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/NetworkFunction/help/Remove-AzNetworkFunctionCollectorPolicy.md index 8ce82d5a0ecd..c717726e85ad 100644 --- a/src/NetworkFunction/NetworkFunction/help/Remove-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/NetworkFunction/help/Remove-AzNetworkFunctionCollectorPolicy.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctioncollectorpolicy schema: 2.0.0 @@ -16,13 +16,13 @@ Deletes a specified Collector Policy resource. ``` Remove-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### DeleteViaIdentity ``` Remove-AzNetworkFunctionCollectorPolicy -InputObject [-DefaultProfile ] - [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] + [-AsJob] [-NoWait] [-PassThru] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -146,6 +146,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -220,19 +235,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`INPUTOBJECT `: Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[Id ]`: Resource identity path - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/Remove-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/NetworkFunction/help/Remove-AzNetworkFunctionTrafficCollector.md index e8932157d88e..de46f857d40a 100644 --- a/src/NetworkFunction/NetworkFunction/help/Remove-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/NetworkFunction/help/Remove-AzNetworkFunctionTrafficCollector.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/remove-aznetworkfunctiontrafficcollector schema: 2.0.0 @@ -15,13 +15,14 @@ Deletes a specified Azure Traffic Collector resource. ### Delete (Default) ``` Remove-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-ProgressAction ] [-WhatIf] + [-Confirm] [] ``` ### DeleteViaIdentity ``` Remove-AzNetworkFunctionTrafficCollector -InputObject [-DefaultProfile ] - [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] + [-AsJob] [-NoWait] [-PassThru] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -130,6 +131,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -204,19 +220,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`INPUTOBJECT `: Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[Id ]`: Resource identity path - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionCollectorPolicy.md b/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionCollectorPolicy.md index be52a955bed6..01f0374a9ff1 100644 --- a/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionCollectorPolicy.md +++ b/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionCollectorPolicy.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctioncollectorpolicy schema: 2.0.0 @@ -14,11 +14,11 @@ Creates or updates a Collector Policy resource ``` Update-AzNetworkFunctionCollectorPolicy -AzureTrafficCollectorName -Name - -ResourceGroupName -Location [-SubscriptionId ] + -ResourceGroupName [-SubscriptionId ] -Location [-EmissionPolicy ] [-IngestionPolicyIngestionSource ] [-IngestionPolicyIngestionType ] [-Tag ] [-DefaultProfile ] [-AsJob] - [-NoWait] [-Confirm] [-WhatIf] [] + [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -201,6 +201,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -288,21 +303,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`EMISSIONPOLICY `: Emission policies. - - `[EmissionDestination ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - -`INGESTIONPOLICYINGESTIONSOURCE `: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionCollectorPolicyTag.md b/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionCollectorPolicyTag.md index ca219897b01e..14a11f2fd856 100644 --- a/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionCollectorPolicyTag.md +++ b/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionCollectorPolicyTag.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctioncollectorpolicytag schema: 2.0.0 @@ -16,13 +16,13 @@ Updates the specified Collector Policy tags. ``` Update-AzNetworkFunctionCollectorPolicyTag -AzureTrafficCollectorName -CollectorPolicyName -ResourceGroupName [-SubscriptionId ] [-Tag ] [-DefaultProfile ] - [-Confirm] [-WhatIf] [] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### UpdateViaIdentityExpanded ``` Update-AzNetworkFunctionCollectorPolicyTag -InputObject [-Tag ] - [-DefaultProfile ] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -135,6 +135,21 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -224,19 +239,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`INPUTOBJECT `: Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[Id ]`: Resource identity path - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionTrafficCollector.md b/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionTrafficCollector.md index 06a07fff5d12..c1dc91db2bce 100644 --- a/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionTrafficCollector.md +++ b/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionTrafficCollector.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctiontrafficcollector schema: 2.0.0 @@ -13,9 +13,9 @@ Creates or updates a Azure Traffic Collector resource ## SYNTAX ``` -Update-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName -Location - [-SubscriptionId ] [-CollectorPolicy ] [-Tag ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +Update-AzNetworkFunctionTrafficCollector -Name -ResourceGroupName [-SubscriptionId ] + -Location [-CollectorPolicy ] [-Tag ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -134,6 +134,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -221,30 +236,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`COLLECTORPOLICY `: Collector Policies for Azure Traffic Collector. - - `Location `: Resource location. - - `[SystemDataCreatedAt ]`: The timestamp of resource creation (UTC). - - `[SystemDataCreatedBy ]`: The identity that created the resource. - - `[SystemDataCreatedByType ]`: The type of identity that created the resource. - - `[SystemDataLastModifiedBy ]`: The identity that last modified the resource. - - `[SystemDataLastModifiedByType ]`: The type of identity that last modified the resource. - - `[Tag ]`: Resource tags. - - `[(Any) ]`: This indicates any property can be added to this object. - - `[EmissionPolicy ]`: Emission policies. - - `[EmissionDestination ]`: Emission policy destinations. - - `[DestinationType ]`: Emission destination type. - - `[EmissionType ]`: Emission format type. - - `[IngestionPolicyIngestionSource ]`: Ingestion Sources. - - `[ResourceId ]`: Resource ID. - - `[SourceType ]`: Ingestion source type. - - `[IngestionPolicyIngestionType ]`: The ingestion type. - ## RELATED LINKS - diff --git a/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionTrafficCollectorTag.md b/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionTrafficCollectorTag.md index 2da6b8cfdb5c..fd18c907cffe 100644 --- a/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionTrafficCollectorTag.md +++ b/src/NetworkFunction/NetworkFunction/help/Update-AzNetworkFunctionTrafficCollectorTag.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.NetworkFunction-help.xml Module Name: Az.NetworkFunction online version: https://learn.microsoft.com/powershell/module/az.networkfunction/update-aznetworkfunctiontrafficcollectortag schema: 2.0.0 @@ -15,14 +15,14 @@ Updates the specified Azure Traffic Collector tags. ### UpdateExpanded (Default) ``` Update-AzNetworkFunctionTrafficCollectorTag -AzureTrafficCollectorName -ResourceGroupName - [-SubscriptionId ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] - [] + [-SubscriptionId ] [-Tag ] [-DefaultProfile ] + [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ### UpdateViaIdentityExpanded ``` Update-AzNetworkFunctionTrafficCollectorTag -InputObject [-Tag ] - [-DefaultProfile ] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-ProgressAction ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -102,6 +102,21 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: System.Management.Automation.ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The name of the resource group. @@ -191,19 +206,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -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. - - -`INPUTOBJECT `: Identity Parameter - - `[AzureTrafficCollectorName ]`: Azure Traffic Collector name - - `[CollectorPolicyName ]`: Collector Policy Name - - `[Id ]`: Resource identity path - - `[ResourceGroupName ]`: The name of the resource group. - - `[SubscriptionId ]`: Azure Subscription ID. - ## RELATED LINKS -