Repository navigation
Closed
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.Resolution-AnsweredThe question is answered.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Run a script without altering permissions in Windows 11 - the following is returned (issue denoted in double asterisks):
yarn : File C:\Users\aidan\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at **https:/go.microsoft.com/fwlink/?LinkID=135170**.
At line:1 char:1
+ yarn
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Expected behavior
yarn : File C:\Users\aidan\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at **https://go.microsoft.com/fwlink/?LinkID=135170**.
At line:1 char:1
+ yarn
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
### Actual behavior
```console
yarn : File C:\Users\aidan\AppData\Roaming\npm\yarn.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at **https:/go.microsoft.com/fwlink/?LinkID=135170**.
At line:1 char:1
+ yarn
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
### Error details
_No response_
### Environment data
```powershell
Name Value
---- -----
PSVersion 5.1.22621.963
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.963
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Visuals
No response
Metadata
Metadata
Assignees
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.Resolution-AnsweredThe question is answered.
Activity
mklement0 commentedon Dec 20, 2022
Good catch, but note that this has since been fixed in PowerShell Core, which is what this repo is about.
As the issue template notes:
This repository is ONLY for PowerShell Core 6 and PowerShell 7+ issues.
aidanjuma commentedon Dec 20, 2022
Ah, perfect - thank you! Sorry about the unnecessary issue on this repo.
Best,
Aidan