codyhosterman / powercli

VMware PowerCLI scripts with Pure Storage
GNU General Public License v2.0
72 stars 54 forks source link

Multiple errors running PureStorageVMwareStorageTool.ps1 #7

Closed dburkland closed 5 years ago

dburkland commented 5 years ago

At Z:\dburkland\Dropbox\Scripts\powershell\PureStorageVMwareStorageTool.ps1:687 char:123

Janachara commented 5 years ago

Hello!

I receive these same error message when I just copy and paste scrips from each PowerShell script's page on GitHub into my text editor of choice. I do not receive them when I click the 'Raw' button first, though.

When you have a minute, maybe try clicking the 'Raw' button first, copy and paste the script from the raw page, and then see if the problem persists?

NOTE: I don't work for Pure Storage in any capacity. I'm just a very satisfied customer. :)

codyhosterman commented 5 years ago

Thankss @Janachara! Did that help, that would be my guess is what is wrong as well. I have a few issues I am looking at fixing in this tool. Though I am planning on likely retiring it in favor of my PS module I have written

ourNCTapps commented 5 years ago

I have having the exact same errors and have tried both a copy and paste in Notepad++ and clicking the RAW button

dburkland commented 5 years ago

Same here, tried using Visual Studio Code as well (no luck).

codyhosterman commented 5 years ago

So I have figured out the root of this problem, it has to do with formatting when copy/pasting. If you copy it into something like Notepad first, then save it, it works fine. If you paste it directly into VS Code or something that preserves formatting it will fail. I am not quite sure why but this workaround does resolve this issue.

With that being said using the GitHub tools to clone/download the repo is the best option. Or something like wget to get a single file.