Created
January 26, 2018 12:12
-
-
Save goyalmohit/1ef24ebb389abc0a07c11313abd177c9 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
# Uploads file to Azure Container without preserving file hierarchy | |
$localDir = "C:\Source\ConsoleApp01" | |
foreach($file in (Get-ChildItem $localDir -File -Recurse)){ | |
Set-AzureStorageBlobContent -Blob $($file.Name) -Container $containerName -File $($file.FullName) -Context $strcontext | |
} | |
# Uploads file to Azure Container with preserving file hierarchy | |
$localDir = "C:\Source\ConsoleApp01" | |
foreach($file in (Get-ChildItem $localDir -File -Recurse)){ | |
$blobName = $file.FullName.Remove(0,23).Replace("\","/") | |
Set-AzureStorageBlobContent -Blob $blobName -Container $containerName -File $($file.FullName) -Context $strcontext | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment