@@ -127,52 +127,6 @@ param(
127127 ${ProxyUseDefaultCredentials}
128128)
129129
130- # begin {
131- # try {
132- # $outBuffer = $null
133- # if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
134- # $PSBoundParameters['OutBuffer'] = 1
135- # }
136- # $parameterSet = $PSCmdlet.ParameterSetName
137-
138- # if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
139- # [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
140- # }
141- # $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
142- # if ($preTelemetryId -eq '') {
143- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
144- # [Microsoft.Azure.PowerShell.Cmdlets.Support.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
145- # } else {
146- # $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
147- # if ($internalCalledCmdlets -eq '') {
148- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
149- # } else {
150- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
151- # }
152- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
153- # }
154-
155- # $mapping = @{
156- # CreateExpanded = 'Az.Support.private\New-AzSupportFile_CreateExpanded';
157- # }
158- # if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
159- # $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
160- # }
161- # $cmdInfo = Get-Command -Name $mapping[$parameterSet]
162- # [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
163- # 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)){
164- # [Microsoft.Azure.PowerShell.Cmdlets.Support.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
165- # [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
166- # }
167- # $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
168- # $scriptCmd = {& $wrappedCmd @PSBoundParameters}
169- # $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
170- # $steppablePipeline.Begin($PSCmdlet)
171- # } catch {
172- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
173- # throw
174- # }
175- # }
176130
177131process {
178132 Write-Output " file path: " $FilePath
@@ -195,20 +149,7 @@ process {
195149 }
196150 Write-Output " Number of chunks: " $NumberOfChunks
197151
198- # try{
199- if ($SubscriptionId )
200- {
201- Write-Output " going into subscription id if statement for create"
202- New-AzSupportFile - SubscriptionId $SubscriptionId - Name $Name - WorkspaceName $WorkspaceName - FileSize $FileSize - ChunkSize $ChunkSize - NumberOfChunk $NumberOfChunks
203- }
204- else {
205- New-AzSupportFile - Name $Name - WorkspaceName $WorkspaceName - FileSize $FileSize - ChunkSize $ChunkSize - NumberOfChunk $NumberOfChunks
206- }
207- # }
208- # catch{
209- # Write-Host $_
210- # throw
211- # }
152+ New-AzSupportFile - SubscriptionId $SubscriptionId - Name $Name - WorkspaceName $WorkspaceName - FileSize $FileSize - ChunkSize $ChunkSize - NumberOfChunk $NumberOfChunks
212153
213154 Write-Output " successfully created file"
214155 $chunkIndex = 0
@@ -222,49 +163,10 @@ process {
222163 Write-Output " start index: " + $startIndex
223164 Write-Output " end index: " + $endIndex
224165 $FileContent = [convert ]::ToBase64String($FileContentByteArray [$startIndex .. $endIndex ])
225- # Write-Output "contents of file: " $FileContent
226- if ($SubscriptionId ){
227- Write-Output " going into subscription id if statement for upload"
228- Invoke-AzSupportUploadFile - SubscriptionId $SubscriptionId - FileName $Name - FileWorkspaceName $WorkspaceName - ChunkIndex $chunkIndex - Content $FileContent
229- }
230- else {
231- Invoke-AzSupportUploadFile - FileName $Name - FileWorkspaceName $WorkspaceName - ChunkIndex $chunkIndex - Content $FileContent
232- }
166+
167+ Invoke-AzSupportUploadFile - SubscriptionId $SubscriptionId - FileName $Name - FileWorkspaceName $WorkspaceName - ChunkIndex $chunkIndex - Content $FileContent
233168 $chunkIndex ++
234169 $startIndex = $endIndex + 1
235170 $endIndex = $FileSize - 1
236171 }
237-
238-
239- # try {
240- # $steppablePipeline.Process($_)
241- # } catch {
242- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
243- # throw
244- # }
245-
246- # finally {
247- # $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
248- # $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
249- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
250- # }
251-
252- }
253- # end {
254- # try {
255- # $steppablePipeline.End()
256-
257- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
258- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
259- # if ($preTelemetryId -eq '') {
260- # [Microsoft.Azure.PowerShell.Cmdlets.Support.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
261- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
262- # }
263- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
264-
265- # } catch {
266- # [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
267- # throw
268- # }
269- # }
270172}
0 commit comments