Skip to content

Add line break to set-executionpolicy access denied error message - #6803

Merged
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
wesholton84:patch-1
May 24, 2018
Merged

Add line break to set-executionpolicy access denied error message#6803
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
wesholton84:patch-1

Conversation

@wesholton84

@wesholton84 wesholton84 commented May 2, 2018

Copy link
Copy Markdown
Contributor

PR Summary

PR Checklist

@wesholton84 wesholton84 changed the title Added line break to access denied error message Add line break to set-executionpolicy access denied error message May 2, 2018
@iSazonov

Copy link
Copy Markdown
Collaborator

wesholton84 Thanks for your contribution!

Please add PR summary and how the message looks before and after the change.

@iSazonov

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) Do you agree with the formatting change?

@iSazonov Ilya (iSazonov) self-assigned this May 22, 2018
@SteveL-MSFT

Copy link
Copy Markdown
Member

On PSCore6, I get an error like:

Set-ExecutionPolicy : Access to the path 'C:\Program Files\PowerShell\6-preview\powershell.config.json' is denied. To change the execution policy for the default (LocalMachine) scope, start PowerShell with the "Run as administrator" option. To change the execution policy for the current user, run "Set-ExecutionPolicy -Scope CurrentUser".
At line:1 char:1
+ Set-ExecutionPolicy -Scope LocalMachine Unrestricted
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand

I think adding the newline will make this more readable and consistent with some changes Jeffrey Snover (@jpsnover) has made to add newlines to error messages.

@iSazonov
Ilya (iSazonov) merged commit 5263875 into PowerShell:master May 24, 2018
@iSazonov

Copy link
Copy Markdown
Collaborator

wesholton84 Thanks for your contribution!

@wesholton84

Copy link
Copy Markdown
Contributor Author

Thanks, glad to help!

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants