scriptcs-contrib / svm

scriptcs version manager
Apache License 2.0
43 stars 13 forks source link

Cannot pass script args in PowerShell #70

Closed adamralph closed 8 years ago

adamralph commented 9 years ago
C:\Adam\Apps\Scripts> scriptcs .\ubs_export.csx -- export.csv
Unexpected unnamed argument: export.csv

This is because scriptcs is resolving to scriptcs.ps1 and -- doesn't work with PowerShell because, er, it has some kind of special meaning?

If I force use of the batch file scriptcs.cmd .\ubs_export.csx -- export.csv then it works just fine.

I wonder if it may be better to call scriptcs.ps1 something else, so that PS resolves scriptcs to scriptcs.cmd?

paulbouwer commented 9 years ago

Thanks @adamralph !

I've always run via the Windows Console where the .ps1 file does not get resolved but rather the .cmd. This was a subtlety that I had not even considered before.

A number of people who have been wanting to be able to run without issues in the PowerShell Console will be very happy with this.

I've got a fix teed up for this.

ryanrousseau commented 8 years ago

I found a work around for passing arguments in powershell until the issue is resolved.

If you use two sets of "--", the arguments are passed correctly.

image

image

adamralph commented 8 years ago

Thanks @ryanrousseau, good to know!

paulbouwer commented 8 years ago

Fixed in bf28290314531074aef75ceb74e1b2bf10580e34 - finally getting around to releasing now. Thanks @adamralph and @ryanrousseau.