Hello
I am not able to open any PowerShell script using notepad or PS ISE or PS ISE or PrimalScript IDE as and Admin from D Drive. I am not able to any of the PowerShell script. I am using Windows 10 and PS Version is 5.0.
I am getting following errors
- Unable to load "d:\ps\userscript.ps1". Access to "d:\ps\userscript.ps1" is denied.
Something wrong only with PowerShell scripts. I can open all other type of files.
When I checked Get-ExecutionPolicy –List, getting following output
MachinePolicy Restricted
UserPolicy Undefined
Process Undefined
CurrentUser Bypass
LocalMachine RemoteSigned
Looks like problem with MachinePolicy. Then I tried
Set-ExecutionPolicy -Scope MachinePolicy Unrestricted
but getting following error
Set-ExecutionPolicy : Cannot set execution policy. Execution policies at the MachinePolicy or UserPolicy scopes must be set through Group Policy.
At line:1 char:1
+ Set-ExecutionPolicy -Scope MachinePolicy Unrestricted
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Set-ExecutionPolicy], InvalidOperationException
+ FullyQualifiedErrorId : CantSetGroupPolicy,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
Please let me know what I am missing here.
AK
Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?
"Cannot set execution policy. Execution policies at the MachinePolicy or UserPolicy scopes must be set through Group Policy."
This is a pretty obvious message.
To set the global policy you must be an admin running elevated.
Set-ExecutionPolicy RemoteSigned[\b]
"- Unable to load "d:\ps\userscript.ps1". Access to "d:\ps\userscript.ps1" is denied."
This means that you do not have access permission on the file or folder. It has nothing to do with execution policy.
This is a pretty obvious message.
To set the global policy you must be an admin running elevated.
Set-ExecutionPolicy RemoteSigned[\b]
"- Unable to load "d:\ps\userscript.ps1". Access to "d:\ps\userscript.ps1" is denied."
This means that you do not have access permission on the file or folder. It has nothing to do with execution policy.
Re: Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?
jvierra
I understand and agree with your point.
I am wondering how it is suddenly stopped working when I am working from some different country, earlier I was working from my company office that time I was not facing issue.
I can not do any development work, Is there any way to fix it?
AK
I understand and agree with your point.
I am wondering how it is suddenly stopped working when I am working from some different country, earlier I was working from my company office that time I was not facing issue.
I can not do any development work, Is there any way to fix it?
AK
Re: Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?
Fix what? There is no way for us to know what your system issue is. The errors are clear. You need permission on the file which you don't have. What does that have to do with a country?
Re: Not able to open or execute PowerShell script using notepad or PS ISE, PS ISE as and Admin?
As per my understanding it is look like group policy issue. However I already did gpupdate /force.
However If I logged in with different account I am able to access script without any issue. for the time being it is ok for me.
However If I logged in with different account I am able to access script without any issue. for the time being it is ok for me.