PowerShell script error: the string is missing the terminator:

前端 未结 2 1689
说谎
说谎 2021-01-12 23:34

Incredibly simple powershell script...

#Server side storage copy

$SourceStorageAccount = \"myStorageAccount\"
$SourceStorageKey = \"myKey\"

$SourceStorageC         


        
相关标签:
2条回答
  • 2021-01-13 00:16

    It's similar with this question.

    When you copy cmdlets from Web, maybe there are some special characters. I suggest you could copy the cmdlets to Notepad then copy to PowerShell.

    It's helpful to use cat filename.ps1 in the terminal you can see determine which characters are bad, it's not obvious in the editor.

    0 讨论(0)
  • 2021-01-13 00:20

    So parts of the code are copied and pasted from websites which have non-standard dash characters. I found it easier to see the characters when you use the cat command from the powershell command line to list the file

    Here's a screenshot of what it looks like listed in the powershell:-

    0 讨论(0)
提交回复
热议问题