Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
iSazonov merged 1 commit intoPowerShell:masterfrom
wesholton84:patch-1
May 24, 2018
Merged

Add line break to set-executionpolicy access denied error message#6803
iSazonov merged 1 commit intoPowerShell:masterfrom
wesholton84:patch-1

Conversation

@wesholton84
Copy link
Contributor

@wesholton84 wesholton84 commented May 2, 2018

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
Collaborator

iSazonov commented May 3, 2018

@wesholton84 Thanks for your contribution!

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

@iSazonov iSazonov requested a review from SteveL-MSFT May 22, 2018 10:08
@iSazonov
Copy link
Collaborator

@SteveL-MSFT Do you agree with the formatting change?

@iSazonov iSazonov self-assigned this May 22, 2018
@SteveL-MSFT
Copy link
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 @jpsnover has made to add newlines to error messages.

@iSazonov iSazonov merged commit 5263875 into PowerShell:master May 24, 2018
@iSazonov
Copy link
Collaborator

@wesholton84 Thanks for your contribution!

@wesholton84
Copy link
Contributor Author

Thanks, glad to help!

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