nvs icon indicating copy to clipboard operation
nvs copied to clipboard

Unable to use in Powershell due to absence of digital signature

Open Deilan opened this issue 5 years ago • 2 comments

Administrator: Windows Powershell output:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\windows\system32> nvs
nvs : File C:\Users\user\AppData\Local\nvs\nvs.ps1 cannot be loaded. The file C:\Users\user\AppData\Local
\nvs\nvs.ps1 is not digitally signed. You cannot run this script on the current system. For more information about runn
ing scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170
.
At line:1 char:1
+ nvs
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Windows 10 x64 nvs 1.6.0 installed from GitHub Releases

Deilan avatar Jan 05 '21 11:01 Deilan

Your PowerShell execution policy must be set to AllSigned, which requires all scripts to be signed. I could look into signing the nvs.ps1 script, though that's actually not a very common practice as far as I know.

If you're an administrator, you can change the PS execution policy to RemoteSigned or Unrestricted and that will resolve the issue:

Set-ExecutionPolicy RemoteSigned

jasongin avatar Jan 05 '21 17:01 jasongin

@jasongin Thank you for the explanation. Using any of aforementioned execution policies resolves the issue.

Signing the script would be nice and in some cases could be useful, but of course it is at your discretion.

Deilan avatar Jan 06 '21 08:01 Deilan