Created
November 13, 2017 09:22
-
-
Save bcnzer/3d62fb37a094dd454b7da21af94877a3 to your computer and use it in GitHub Desktop.
Upload resultant files to Azure blog storage
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
| # Azure subscription-specific variables. | |
| $storageAccountName = "spotterazurelogs" | |
| $containerName = "robotframework-logs" | |
| # Upload files in data subfolder to Azure. | |
| $localfolder = "$(OutputFolder)" | |
| $destfolder = "$(Release.ReleaseName)" | |
| $blobContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $(SpotterLogStorageKey) | |
| $files = Get-ChildItem $localFolder | |
| foreach($file in $files) | |
| { | |
| $fileName = "$localFolder\$file" | |
| $blobName = "$(Release.ReleaseName)/$file" | |
| write-host "copying $fileName to $blobName" | |
| Set-AzureStorageBlobContent -File $filename -Container $containerName -Blob $blobName -Context $blobContext -Force | |
| } | |
| write-host "All files in $localFolder uploaded to $containerName!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment