AArnott / Library.Template

A template for a NuGet package with tests, stylecop, fxcop, versioning, and Azure Pipelines build ready to go.
MIT License
131 stars 26 forks source link

Make it easier to run Expand-Template.ps1 from CMD window #25

Closed Eilon closed 4 years ago

Eilon commented 5 years ago

Right now if you run Expand-Template.ps1 from a CMD window you get the good old Execution Policy error message, and you have to run "cryptic" PowerShell commands to bypass the execution policy. What some people do is add a CMD file that runs the PS1 file with the appropriate bypass option to avoid the error, such as the ASP.NET team's repos:

https://github.com/aspnet/AspNetCore/blob/master/build.cmd#L3
AArnott commented 4 years ago

You mean what I already do here?

https://github.com/AArnott/Library.Template/blob/a2556bf66ce72ef84c33077b94a9c83100d88e37/init.cmd#L2

Sure: I'll apply that to Expand-Template.ps1 as well.

AArnott commented 4 years ago

Nevertheless, the link you shared was interesting as they took more care to communicate failure exit codes. Thanks for the tip.