Created
November 14, 2018 21:50
-
-
Save GFoley83/5c3a3df369e523372786666bfc40277d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# POST method: $req | |
$requestBody = Get-Content $req -Raw | ConvertFrom-Json | |
$name = $requestBody.name | |
# GET method: each querystring parameter is its own variable | |
if ($req_query_name) | |
{ | |
$name = $req_query_name | |
} | |
$destinationKey = "GhwhBLu62Mcys+STUP9AmhHJ1StXv817T559kS2U69QSIuI5jQiGd+nS47XTlPKAc8Cvx/RYcH9odwCiW4qATg=="; | |
$sourceUri = "https://gavinfblobs.blob.core.windows.net/folder1"; | |
$destinationUri = "https://gavinfblobs.blob.core.windows.net/folder2"; | |
D:\devtools\AzCopy\AzCopy.exe /Source:$sourceUri /Dest:$destinationUri /DestKey:$destinationKey /Pattern:topo.png /S /Y | |
if ($LastExitCode -ne 0) { | |
throw "Error - azcopy returned code $($LastExitCode)" | |
} | |
$Result = [string]::Format('{{ "Status": 204, "Body": "" }}') | |
Out-File -Encoding Ascii $res -inputObject $Result; | |
#Out-File -Encoding Ascii -FilePath $res -inputObject $Result | ConvertTo-Json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment