ouch icon indicating copy to clipboard operation
ouch copied to clipboard

Can't load completions: `_ouch.ps1 is not digitally signed`

Open yh-sb opened this issue 6 months ago • 4 comments

Version

0.6.1

Description

Add loading ouch completions into powershell by adding following line . "C:\Program Files\ouch\completions\_ouch.ps1" into C:\Users\y\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Current Behavior

During the Windows Terminal launch the following error message always appers:

. : File C:\Program Files\ouch\completions\_ouch.ps1 cannot be loaded. The file C:\Program
Files\ouch\completions\_ouch.ps1 is not digitally signed. You cannot run this script on the current system.
For more information about running scripts and setting execution policy, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At C:\Users\y\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:15 char:3
+ . "C:\Program Files\ouch\completions\_ouch.ps1"
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

There are no such errors with others completions files, for example with _yazi.ps1 or _rg.ps1.

Expected Behavior

Completions loads without error in the terminal.

Additional Information

No response

yh-sb avatar Jul 06 '25 17:07 yh-sb

I admittedly have no idea why completion files in Powershell need to be digitally signed, I'm open to receiving fixes for this, or guidance in case it's a problem in my packages.

marcospb19 avatar Jul 15 '25 17:07 marcospb19

@yh-sb Did you get ouch from some package manager? Like winget, chocolatey or such?

Or did you build it yourself?

vrmiguel avatar Nov 14 '25 15:11 vrmiguel

@vrmiguel, I downloaded ouch from the GitHub Releases (ouch-x86_64-pc-windows-gnu.zip).

yh-sb avatar Nov 15 '25 09:11 yh-sb

The .ps1 file was generated by clap but they don't have any issues referring to this.

I can't test or fix this, need someone to hop in and check it for you.

marcospb19 avatar Nov 21 '25 21:11 marcospb19