locked
Store temp file in powershell to an folder in blob RRS feed

  • Question

  •  

    Hi Guys,

    We use below command to save an temp file generate to store in blob container

    Set-AzureStorageBlobContent -File ($Env:temp+"\filename" + (Get-Date -Format 

    "yyyy-MM-dd")+".csv") -Container "containername" -BlobType "Block" 

    -Context $context  -Force

     

    But its storing the file at root level, but now we want to store the file

    in an folder for organizing; how can we store the file in an folder called folder 1 instead of root of container?

    Regards,

    Navin


    Navin.D http://dnavin.wordpress.com



    • Edited by Navind Thursday, May 14, 2020 6:42 PM
    Thursday, May 14, 2020 6:12 PM

Answers

  • Set-AzureStorageBlobContent -File ($Env:temp+"\xyz" + (Get-Date -Format "yyyy-MM-dd")+".csv") -Container "TestInfo" -Blob ("FileStore"+"\xyz" + (Get-Date -Format "yyyy-MM-dd")+".csv") -BlobType "Block" -Context $context  -Force

    Navin.D http://dnavin.wordpress.com

    • Marked as answer by Navind Saturday, May 16, 2020 4:27 AM
    Saturday, May 16, 2020 4:27 AM

All replies

  • Set-AzureStorageBlobContent -File ($Env:temp+"\xyz" + (Get-Date -Format "yyyy-MM-dd")+".csv") -Container "TestInfo" -Blob ("FileStore"+"\xyz" + (Get-Date -Format "yyyy-MM-dd")+".csv") -BlobType "Block" -Context $context  -Force

    Navin.D http://dnavin.wordpress.com

    • Marked as answer by Navind Saturday, May 16, 2020 4:27 AM
    Saturday, May 16, 2020 4:27 AM
  • Thank you for letting us know the solution that worked for you and sharing the document with the Community. Which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

    Tuesday, May 19, 2020 9:54 AM