镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

PSReadline Exception #5220

Open
Open

Description

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

### Environment
PSReadLine: 2.4.5
PowerShell: 7.6.6
OS: Microsoft Windows 10.0.26100
BufferWidth: 120
BufferHeight: 9001

Last 0 Keys:



### Exception

System.UnauthorizedAccessException: Access to the path 'PSReadLineHistoryFile_2300680655' is denied.
   at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, NamedWaitHandleOptionsInternal options, Boolean& createdNew)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)

Screenshot

Image

Environment data

PS Version: 7.6.6
PS HostName: ConsoleHost
PSReadLine Version: 2.4.5
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 9001

Steps to reproduce

Reproduction may be a little more complicated. I stumbled upon it while trying my agent-win-sandbox and modified the parameter of the launch-as.exe to --mode interactive.
Which then creates a interactive logon session for a different user profile via CreateProcessAsUser API.
Also this is run in a windows sandbox (WSB).

Expected behavior

no exception

Actual behavior

exception

Activity

  1. sbebrys commented on Oct 21, 2026

    @sbebrys

    Florian Mücke (@fmuecke) I run to the same problem. Seems its not related to PSReadline module, but .net used behind powershell, in my case I needed satisfy access to the .dotnet cache folder which previous wasn't needed. On Windows should be as default in %USERPROFILE%.dotnet path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions