### 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)
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
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).
Prerequisites
Exception report
Screenshot
Environment data
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.exeto--mode interactive.Which then creates a interactive logon session for a different user profile via
CreateProcessAsUserAPI.Also this is run in a windows sandbox (WSB).
Expected behavior
no exception
Actual behavior
exception