PSReadline Exception #5220
Copy link
Copy link
Open
Labels
Needs-Triage 🔍It's a new issue that core contributor team needs to triage.It's a new issue that core contributor team needs to triage.
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
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: 9001Steps 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs-Triage 🔍It's a new issue that core contributor team needs to triage.It's a new issue that core contributor team needs to triage.
Activity
sbebrys commentedon Oct 21, 2026
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.