forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests and documentation for operations, support ticket, communi…
…cation and chat transcript cmdlets
- Loading branch information
1 parent
6a3baa3
commit 79208ba
Showing
38 changed files
with
4,718 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
src/Support/Support.Autorest/custom/Get-AzSupportOperation_List.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
|
||
# ---------------------------------------------------------------------------------- | ||
# 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 | ||
Lists all the available Microsoft Support REST API operations. | ||
.Description | ||
Lists all the available Microsoft Support REST API operations. | ||
.Example | ||
{{ Add code here }} | ||
.Example | ||
{{ Add code here }} | ||
.Outputs | ||
Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation | ||
.Link | ||
https://learn.microsoft.com/powershell/module/az.support/new-azsupportfile | ||
#> | ||
function Get-AzSupportOperation_List { | ||
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Support.Models.IOperation])] | ||
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] | ||
param( | ||
[Parameter()] | ||
[Alias('AzureRMContext', 'AzureCredential')] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Azure')] | ||
[System.Management.Automation.PSObject] | ||
# The DefaultProfile parameter is not functional. | ||
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. | ||
${DefaultProfile}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Wait for .NET debugger to attach | ||
${Break}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] | ||
# SendAsync Pipeline Steps to be appended to the front of the pipeline | ||
${HttpPipelineAppend}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.SendAsyncStep[]] | ||
# SendAsync Pipeline Steps to be prepended to the front of the pipeline | ||
${HttpPipelinePrepend}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] | ||
[System.Uri] | ||
# The URI for the proxy server to use | ||
${Proxy}, | ||
|
||
[Parameter(DontShow)] | ||
[ValidateNotNull()] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] | ||
[System.Management.Automation.PSCredential] | ||
# Credentials for a proxy server to use for the remote call | ||
${ProxyCredential}, | ||
|
||
[Parameter(DontShow)] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Category('Runtime')] | ||
[System.Management.Automation.SwitchParameter] | ||
# Use the default credentials for the proxy | ||
${ProxyUseDefaultCredentials} | ||
) | ||
|
||
begin { | ||
try { | ||
$outBuffer = $null | ||
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { | ||
$PSBoundParameters['OutBuffer'] = 1 | ||
} | ||
$parameterSet = $PSCmdlet.ParameterSetName | ||
|
||
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { | ||
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() | ||
} | ||
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId | ||
if ($preTelemetryId -eq '') { | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) | ||
} else { | ||
$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets | ||
if ($internalCalledCmdlets -eq '') { | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name | ||
} else { | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name | ||
} | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' | ||
} | ||
|
||
$mapping = @{ | ||
List = 'Az.Support.private\Get-AzSupportOperation_List'; | ||
} | ||
# if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { | ||
# $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id | ||
# } | ||
$cmdInfo = Get-Command -Name $mapping[$parameterSet] | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.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.Support.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) | ||
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) | ||
} | ||
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) | ||
$scriptCmd = {& $wrappedCmd @PSBoundParameters} | ||
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) | ||
$steppablePipeline.Begin($PSCmdlet) | ||
} catch { | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() | ||
throw | ||
} | ||
} | ||
|
||
process { | ||
try { | ||
$steppablePipeline.Process($_) | ||
} catch { | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() | ||
throw | ||
} | ||
|
||
finally { | ||
$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId | ||
$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() | ||
} | ||
|
||
} | ||
end { | ||
try { | ||
$steppablePipeline.End() | ||
|
||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets | ||
if ($preTelemetryId -eq '') { | ||
[Microsoft.Azure.PowerShell.Cmdlets.Support.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() | ||
} | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId | ||
|
||
} catch { | ||
[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() | ||
throw | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.