Skip to content

Commit f4e7b8e

Browse files
committed
erroraction stop
1 parent 683579a commit f4e7b8e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Support/Support.Autorest/custom/New-AzSupportFileAndUpload.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ param(
103103
)
104104

105105
process {
106-
$ErrorActionPreference = 'Stop'
107106
#Write-Output "file path: " + $FilePath
108107
$FileName = Split-Path $FilePath -Leaf
109108
Write-Output "file name: " $FileName
@@ -132,7 +131,7 @@ process {
132131
}
133132
# Write-Output "Number of chunks: " $NumberOfChunks
134133
$PSBoundParameters.Remove('FilePath') | Out-Null
135-
New-AzSupportFile -SubscriptionId $SubscriptionId -Name $FileName -WorkspaceName $WorkspaceName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters
134+
New-AzSupportFile -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters
136135

137136
Write-Output "successfully created file"
138137
$chunkIndex = 0
@@ -147,7 +146,7 @@ process {
147146
# Write-Output "end index: " + $endIndex
148147
$FileContent = [convert]::ToBase64String($FileContentByteArray[$startIndex..$endIndex])
149148

150-
Invoke-AzSupportUploadFile -SubscriptionId $SubscriptionId -FileName $FileName -FileWorkspaceName $WorkspaceName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
149+
Invoke-AzSupportUploadFile -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
151150
$chunkIndex++
152151
$startIndex = $endIndex + 1
153152
$endIndex = $FileSize - 1

src/Support/Support.Autorest/custom/New-AzSupportFileAndUploadNoSubscription.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ process {
123123
Write-Output "Number of chunks: " $NumberOfChunks
124124

125125
$PSBoundParameters.Remove('FilePath') | Out-Null
126-
New-AzSupportFilesNoSubscription -Name $FileName -WorkspaceName $WorkspaceName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters
126+
New-AzSupportFilesNoSubscription -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters
127127

128128
Write-Output "successfully created file"
129129
$chunkIndex = 0
@@ -138,7 +138,7 @@ process {
138138
Write-Output "end index: " + $endIndex
139139
$FileContent = [convert]::ToBase64String($FileContentByteArray[$startIndex..$endIndex])
140140

141-
Invoke-AzSupportUploadFilesNoSubscription -FileName $FileName -FileWorkspaceName $WorkspaceName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
141+
Invoke-AzSupportUploadFilesNoSubscription -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
142142
$chunkIndex++
143143
$startIndex = $endIndex + 1
144144
$endIndex = $FileSize - 1

0 commit comments

Comments
 (0)