Skip to content

Build on Windows #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Workshopshed opened this issue Apr 23, 2020 · 5 comments · May be fixed by #12
Open

Build on Windows #11

Workshopshed opened this issue Apr 23, 2020 · 5 comments · May be fixed by #12

Comments

@Workshopshed
Copy link

Workshopshed commented Apr 23, 2020

You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at 
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ./build.ps1
+ ~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
The terminal process terminated with exit code: 1

Solution is to open an elevated privileges Powershell prompt and issue:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted
@alistairjevans
Copy link
Contributor

You can also change the policy for the process without escalation:

Set-ExecutionPolicy Bypass -Scope Process

I think this is what CI process does.

That said, perhaps we should update the readme with this instruction?

@Workshopshed
Copy link
Author

This also seems to work - PowerShell.exe -ExecutionPolicy Bypass -File .\build.ps1

@Workshopshed
Copy link
Author

Workshopshed commented Apr 23, 2020

I configured tasks.json as follows and that seems to work for windows. Not sure about other O/S

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "Set-ExecutionPolicy Bypass -Scope Process; ./build.ps1"
        }
    ]
}

@alistairjevans
Copy link
Contributor

You want to raise a PR for the change to tasks.json?

Also, Github tip, if you paste code or console content into here, putting three backticks above and below it makes the spacing make sense.

Like so:

code
   formatting

I've updated your comments to fix the formatting.

@Workshopshed
Copy link
Author

Workshopshed commented Apr 25, 2020 via email

@alistairjevans alistairjevans linked a pull request May 7, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants