Please feel free to provide feedback or file bugs here.

Set-AuthenticodeSignature fails to release file handle after error

When attempting to use Set-AuthenticodeSignature to sign an unsupported file type, such as a .txt file with unstructured text, the cmdlet throws an error as expected, but then the PowerShell host process holds open a handle to that file, preventing the file from being deleted or edited. The PowerShell host process must be terminated to close the handle, or another external tool, like Process Hacker, must be used to close the handle manually.

The error thrown is:

"Status: UnknownError; StatusMessage: The form specified for the subject is not one supported or known by the specified trust provider"

The problem was observed on Windows 10 Pro version 10.0.14393, using PowerShell version 5.1.14393.953.

The open file handle can be seen using Sysinternals handle.exe or with Process Hacker.

2 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Jason FossenJason Fossen shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base