Skip to content
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

Digitally sign tsp.ps1 #3512

Closed
3 tasks done
archerzz opened this issue Jun 4, 2024 · 6 comments
Closed
3 tasks done

Digitally sign tsp.ps1 #3512

archerzz opened this issue Jun 4, 2024 · 6 comments
Assignees

Comments

@archerzz
Copy link
Member

archerzz commented Jun 4, 2024

Clear and concise description of the problem

I met the following error when trying to install vs code plugin for typespec.

PS C:\Users\xxx> tsp code install
tsp : File C:\Users\xxx\AppData\Roaming\npm\tsp.ps1 cannot be loaded. The file
C:\Users\xxx\AppData\Roaming\npm\tsp.ps1 is not digitally signed. 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
+ tsp code install
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

It would be better if we could digitally sign tsp.ps1. Otherwise, customers have to downgrade the execution policy.


My local execution policy is set to AllSigned by default.

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@timotheeguerin
Copy link
Member

This is not created by us, where did you get this ps1 file?

@timotheeguerin timotheeguerin added the needs-info Mark an issue that needs reply from the author or it will be closed automatically label Jun 4, 2024
@bterlson
Copy link
Member

bterlson commented Jun 4, 2024

This is likely the PS1 wrapper generated by npm on windows and placed in the bin folder. I don't think we can do anything to sign it.

@timotheeguerin
Copy link
Member

Issue from npm npm/cli#470 about this

@archerzz
Copy link
Member Author

archerzz commented Jun 5, 2024

This is likely the PS1 wrapper generated by npm on windows and placed in the bin folder. I don't think we can do anything to sign it.

Thanks. Per conclusion of solutions here, looks like we need to add a doc to let users delete the tsp.ps1?

@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-info Mark an issue that needs reply from the author or it will be closed automatically label Jun 5, 2024
@timotheeguerin
Copy link
Member

I don't think so, the conclusion is to loosen the script execution policy or use npx. And not sure this is really for us to show the docs on this

@archerzz
Copy link
Member Author

close since there is no easy solution for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants