Powershall script

Rohit Kulkarni 691 Reputation points
2021-03-03T17:24:33.357+00:00

Hello Team, Please refer my Powershell version: ![73913-image.png][1] I want to copying the file from local system to Azure blob storage .I am using the command 'azCopy Copy C:\File\CustomerDisplaysDirect.txt https://storageaccount.blob.core.windows.net/container1/staging-zone/Testfile/'. Error : ![73932-image.png][2] [1]: /api/attachments/73913-image.png?platform=QnA [2]: /api/attachments/73932-image.png?platform=QnA Thanks RK

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,538 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ian Xue 37,286 Reputation points Microsoft Vendor
    2021-03-04T08:57:45.567+00:00

    Hi,

    As the suggestion in your screenshot said, type ".\azcopy" instead of "azcopy". It means running the executable azcopy in the current directory.

    .\azcopy copy C:\File\CustomerDisplaysDirect.txt https://storageaccount.blob.core.windows.net/container1/staging-zone/Testfile/  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


4 additional answers

Sort by: Most helpful
  1. Rich Matheisen 46,796 Reputation points
    2021-03-03T19:18:03.427+00:00

    Why is there a period at the end of the command line (outside the ending single quote)? Why is the command line enclosed in single quotes?

    Shouldn't the command look something like this?

    azCopy Copy C:\File\CustomerDisplaysDirect.txt https://storageaccount.blob.core.windows.net/container1/staging-zone/Testfile/
    
    0 comments No comments

  2. Hamid Sadeghpour Saleh 1 Reputation point MVP
    2021-03-03T19:44:13.913+00:00

    Hello,

    Thank you for your question.

    I was able to find a topic in Docs which exactly about Az Copy command instructions and Syntaxes which are used for copying files to Azure and from.

    https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-files

    Please let us know if it solves your question.

    Stay safe,


  3. Ian Xue 37,286 Reputation points Microsoft Vendor
    2021-03-04T03:57:56.413+00:00

    Hi,

    The quotation marks and the last dot should be removed or the command is treated as a string and a property of the string is expected after the dot.

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  4. Rohit Kulkarni 691 Reputation points
    2021-03-04T07:43:29.847+00:00

    Hello Team, Thanks for your response. I have tried all the scenario by Keeping and removing the comma. But still i am facing the same issue .Please refer the below screenshot : ![74221-image.png][1] [1]: /api/attachments/74221-image.png?platform=QnA

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.