Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
cf8e4ac
init add powershell cmdlet
grhuangmsft Dec 1, 2023
6a3baa3
add customization for filedetails
grhuangmsft Dec 18, 2023
1b15859
correct readme to include file workspace create
grhuangmsft Jan 11, 2024
c2e620c
add custom cmdlet for creating and uploading the file
grhuangmsft Jan 12, 2024
e2cc76e
chunking logic for larger files
grhuangmsft Jan 17, 2024
07ace3d
add error for custom cmdlet when file too big
grhuangmsft Jan 19, 2024
69b3443
combined cmdlets
grhuangmsft Jan 19, 2024
f414931
edit custom file upload command to not use default subscriptionid
grhuangmsft Jan 19, 2024
a7546e4
no default value for subid in custom file upload
grhuangmsft Jan 19, 2024
1f7f741
separate subscription and no subscription commands
grhuangmsft Jan 23, 2024
a22e254
remove comments from combined cmd for file
grhuangmsft Jan 23, 2024
5dea32a
fix cmd
grhuangmsft Jan 23, 2024
a5b213d
custom no subscription file upload commands
grhuangmsft Jan 23, 2024
b953811
autogen docs for no sub file upload
grhuangmsft Jan 23, 2024
276498c
hide individual file commands
grhuangmsft Jan 23, 2024
487bef6
add back workspace commands
grhuangmsft Jan 23, 2024
ef75f6b
add name as alias for fileworkspacename fileworkspacesnosubscription
grhuangmsft Jan 24, 2024
ec6d597
remove update files and add alias for nosubscription file commands
grhuangmsft Jan 24, 2024
9715b15
tests for get service
grhuangmsft Jan 26, 2024
b1b98b7
tests for problem classification
grhuangmsft Jan 26, 2024
d19fb89
try adding erroractionpreference = stop
grhuangmsft Jan 29, 2024
1d8bed2
tests for new file workspace
grhuangmsft Jan 29, 2024
41e373b
tests for get file workspace
grhuangmsft Jan 30, 2024
f41fe6c
more tests
grhuangmsft Jan 30, 2024
1313bdc
add tests for new file and upload, removefile name as a parameter
grhuangmsft Jan 31, 2024
5332d08
remove new files no subscription
grhuangmsft Jan 31, 2024
683579a
tests for get file
grhuangmsft Jan 31, 2024
f4e7b8e
erroraction stop
grhuangmsft Feb 1, 2024
60b7341
remove unnecessary comments and print statements
grhuangmsft Feb 1, 2024
7bdc9aa
Merge pull request #1 from grhuangmsft/users/grhuang/azsupport-autore…
grhuangmsft Feb 6, 2024
913b1bb
docs for get support service
grhuangmsft Feb 7, 2024
452e2d0
problem classification docs
grhuangmsft Feb 7, 2024
54c1f1d
add titles
grhuangmsft Feb 7, 2024
5878a49
documentation for file workspace commands
grhuangmsft Feb 8, 2024
c41fec4
documentation for file/file workspace cmdlets
grhuangmsft Feb 9, 2024
3851a1d
documentation for checkNameAvailability
grhuangmsft Feb 13, 2024
762b446
Merge pull request #2 from grhuangmsft/users/grhuang/azsupport-autore…
grhuangmsft Feb 16, 2024
79208ba
added tests and documentation for operations, support ticket, communi…
shreyakumar3093 Feb 22, 2024
6bcf34e
added examples for operations, support ticket, communication and chat…
shreyakumar3093 Feb 22, 2024
7ddff6c
resolve merge conflicts
shreyakumar3093 Feb 22, 2024
39253ec
resolved PR comments
shreyakumar3093 Feb 23, 2024
3bad989
get conflict file changes from grhuang/azsupport-autorest
shreyakumar3093 Feb 23, 2024
0d18131
Merge branch 'users/grhuang/azsupport-autorest' into users/shreyakuma…
shreyakumar3093 Feb 23, 2024
b59b1ff
resolved merge conflict
shreyakumar3093 Feb 23, 2024
ccbfdee
removed update communication sub and no sub scenarios
shreyakumar3093 Feb 23, 2024
1a32d3b
Revert "removed update communication sub and no sub scenarios"
shreyakumar3093 Feb 23, 2024
1a21b88
removed update communication sub and no sub scenarios , updated readme
shreyakumar3093 Feb 23, 2024
de3fcf5
Merge pull request #4 from shreyakumar3093/users/shreyakumar/grhuang/…
grhuangmsft Feb 26, 2024
194a139
make communiation and support ticket properties required in readme, e…
grhuangmsft Mar 5, 2024
4f79e30
fix documentation
grhuangmsft Mar 5, 2024
cc100ad
fix top query
grhuangmsft Mar 5, 2024
8a00ab3
add custom error handler
grhuangmsft Mar 6, 2024
962bda3
consolidate list and get communicationsnosubscription and chattranscr…
grhuangmsft Mar 6, 2024
eec230e
init changes to allow no subscription recording tests-need to use csp…
grhuangmsft Mar 7, 2024
7643b1c
changes to not create new resources in playback
grhuangmsft Mar 7, 2024
ef100cc
remove custom error handler csharp
grhuangmsft Mar 7, 2024
da3c0a6
Merge pull request #5 from grhuangmsft/users/grhuang/azsupport-autore…
grhuangmsft Mar 7, 2024
68944c1
Merge branch 'users/grhuang/azsupport-autorest' into users/grhuang/up…
grhuangmsft Mar 7, 2024
d953d52
init add changes to split subscription and no subscription tests
grhuangmsft Mar 7, 2024
d7835cf
update skip
grhuangmsft Mar 7, 2024
ff79587
Update recordings
grhuangmsft Mar 8, 2024
2362e86
update recordings
grhuangmsft Mar 8, 2024
06323ee
add more examples to new-azsupportticket documentation
grhuangmsft Mar 8, 2024
4f2e4bc
update documentation and readme
grhuangmsft Mar 11, 2024
862ddd7
add directive back in
grhuangmsft Mar 11, 2024
4600eba
make advanced diagnostic consent required
grhuangmsft Mar 12, 2024
1e7f414
Merge pull request #8 from grhuangmsft/users/grhuang/documentation-an…
grhuangmsft Mar 12, 2024
8e5227f
Merge pull request #6 from grhuangmsft/users/grhuang/update-tests
grhuangmsft Mar 14, 2024
615e1c5
Add custom error handling for New- and Update- cmdlets to print full …
grhuangmsft Mar 15, 2024
112512e
Add default filter to retrieve tickets from the past week for Get-AzS…
grhuangmsft Mar 15, 2024
9e778f0
make transformations in swagger in readme to make enrollment id not r…
grhuangmsft Mar 19, 2024
c6b7740
Add argument completer (#12)
grhuangmsft Mar 22, 2024
6f2684b
Regenerate powershell module with GA swagger (#13)
grhuangmsft Apr 25, 2024
5363e1e
Rerecord tests using GA version (#14)
grhuangmsft Apr 25, 2024
13e2423
Fix documentation
grhuangmsft Apr 26, 2024
08806a0
fix url for file upload
grhuangmsft Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unnecessary comments and print statements
  • Loading branch information
grhuangmsft committed Feb 1, 2024
commit 60b734104eb4df3167be54f003fffc4197c95fcf
3 changes: 0 additions & 3 deletions src/Support/Support.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ commit: 99b27b136352e2f16c3f868857fa33157ace895f
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
# - $(repo)/specification/support/resource-manager/readme.md
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
# - (this-folder)/relative-path-to-your-local-readme.md
input-file:
- $(repo)/specification/support/resource-manager/Microsoft.Support/preview/2022-09-01-preview/support.json
# try-require:
# - $(repo)/specification/support/resource-manager/readme.powershell.md

# For new RP, the version is 0.1.0
module-version: 0.1.0
Expand Down
22 changes: 6 additions & 16 deletions src/Support/Support.Autorest/custom/New-AzSupportFileAndUpload.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,49 +103,39 @@ param(
)

process {
#Write-Output "file path: " + $FilePath
$FileName = Split-Path $FilePath -Leaf
Write-Output "file name: " $FileName
$MaxChunkSize = 2.5 * 1024 * 1024 #2.5 MB
$MaxFileSize = 5 * 1024 * 1024 #5 MB
Write-Output "about to get file content"
$FileContentBytes = Get-Content -Path $FilePath -Raw
Write-Output "got file content"

if($FileContentBytes -eq $Null){
throw "File cannot be empty"
}

$FileContentByteArray = [System.Text.Encoding]::UTF8.GetBytes($FileContentBytes)
$FileSize = $FileContentByteArray.Length
Write-Output "file size: " $FileSize

if($FileSize -gt $MaxFileSize){
throw "File size is greater than the maximum file size of 5 MB"
}

$ChunkSize = If($FileSize -gt $MaxChunkSize) {$MaxChunkSize} Else {$FileSize}
# Write-Output "Length of byte array: " $FileSize
# Write-Output "Max chunk size: " $MaxChunkSize
# Write-Output "Chunk Size: " $ChunkSize
$NumberOfChunks = [int][Math]::Floor($FileSize / $ChunkSize);

If($FileSize % $ChunkSize -gt 0)
{
$NumberOfChunks++
}
# Write-Output "Number of chunks: " $NumberOfChunks

$PSBoundParameters.Remove('FilePath') | Out-Null
New-AzSupportFile -ErrorAction Stop -Name $FileName -FileSize $FileSize -ChunkSize $ChunkSize -NumberOfChunk $NumberOfChunks @PSBoundParameters

Write-Output "successfully created file"
$chunkIndex = 0
$startIndex = 0
$endIndex = $ChunkSize - 1

# $FileContent = [convert]::ToBase64String((Get-Content -path $FilePath -Encoding byte))

while($chunkIndex -lt $NumberOfChunks){
# Write-Output "chunk index: " + $chunkIndex
# Write-Output "start index: " + $startIndex
# Write-Output "end index: " + $endIndex
$FileContent = [convert]::ToBase64String($FileContentByteArray[$startIndex..$endIndex])

Invoke-AzSupportUploadFile -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
$chunkIndex++
$startIndex = $endIndex + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,47 +97,39 @@ param(


process {
Write-Output "file path: " $FilePath
$FileName = Split-Path $FilePath -Leaf
Write-Output "file name: " + $FileName
$MaxChunkSize = 2.5 * 1024 * 1024 #2.5 MB
$MaxFileSize = 5 * 1024 * 1024 #5 MB
$FileContentBytes = Get-Content -Path $FilePath -Raw

if($FileContentBytes -eq $Null){
throw "File cannot be empty"
}

$FileContentByteArray = [System.Text.Encoding]::UTF8.GetBytes($FileContentBytes)
$FileSize = $FileContentByteArray.Length

if($FileSize -gt $MaxFileSize){
throw "File size is greater than the maximum file size of 5 MB"
}

$ChunkSize = If($FileSize -gt $MaxChunkSize) {$MaxChunkSize} Else {$FileSize}
Write-Output "Length of byte array: " $FileSize
Write-Output "Max chunk size: " $MaxChunkSize
Write-Output "Chunk Size: " $ChunkSize
$NumberOfChunks = [int][Math]::Floor($FileSize / $ChunkSize);

If($FileSize % $ChunkSize -gt 0)
{
$NumberOfChunks++
}
Write-Output "Number of chunks: " $NumberOfChunks

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

Write-Output "successfully created file"
$chunkIndex = 0
$startIndex = 0
$endIndex = $ChunkSize - 1

# $FileContent = [convert]::ToBase64String((Get-Content -path $FilePath -Encoding byte))

while($chunkIndex -lt $NumberOfChunks){
Write-Output "chunk index: " + $chunkIndex
Write-Output "start index: " + $startIndex
Write-Output "end index: " + $endIndex
$FileContent = [convert]::ToBase64String($FileContentByteArray[$startIndex..$endIndex])

Invoke-AzSupportUploadFilesNoSubscription -ErrorAction Stop -FileName $FileName -ChunkIndex $chunkIndex -Content $FileContent @PSBoundParameters
$chunkIndex++
$startIndex = $endIndex + 1
Expand Down