Skip to content

Instantly share code, notes, and snippets.

@GFoley83
Created November 14, 2018 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GFoley83/5c3a3df369e523372786666bfc40277d to your computer and use it in GitHub Desktop.
Save GFoley83/5c3a3df369e523372786666bfc40277d to your computer and use it in GitHub Desktop.
# 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