Powershell currently crashes because it's trying to get the computer boot time, which can be unavailable (for example on Android). I don't see having access to the computer boot time being a requirement to launch powershell, this could either record the boot time as unavailable or crash when we actually need that value.
Get a powershell prompt
FailFast:
Access to the path '/proc/stat' is denied.
at System.Environment.FailFast(System.String, System.Exception)
at Internal.Runtime.Augments.EnvironmentAugments.FailFast(System.String, System.Exception)
at System.Environment.FailFast(System.String, System.Exception)
at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String, System.String[], Int32)
at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
Exception details:
System.UnauthorizedAccessException: Access to the path '/proc/stat' is denied. ---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks)
at System.IO.File.InternalReadAllText(String path, Encoding encoding)
at System.IO.File.ReadAllText(String path)
at System.Diagnostics.Process.get_BootTime()
at System.Diagnostics.Process.BootTimeToDateTime(TimeSpan timespanAfterBoot)
at System.Diagnostics.Process.get_StartTimeCore()
at System.Diagnostics.Process.get_StartTime()
at Microsoft.PowerShell.ConsoleHost.DoCreateRunspace(String initialCommand, Boolean skipProfiles, Boolean staMode, String configurationName, Collection`1 initialCommandArgs) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs:line 1618
at Microsoft.PowerShell.ConsoleHost.CreateRunspace(Object runspaceCreationArgs) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs:line 1506
at Microsoft.PowerShell.ConsoleHost.DoRunspaceLoop(String initialCommand, Boolean skipProfiles, Collection`1 initialCommandArgs, Boolean staMode, String configurationName) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs:line 1421
at Microsoft.PowerShell.ConsoleHost.Run(CommandLineParameterParser cpp, Boolean isPrestartWarned) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs:line 1383
at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText, String[] args) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs:line 1
at Microsoft.PowerShell.ConsoleShell.Start(String bannerText, String helpText, String[] args) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs:line 299
at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String[] args, Int32 argc) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs:line 72
Aborted
N/A
Looks like that call is unnecessary and that data isn't being used. Will make a fix.
:tada:This issue was addressed in #10294, which has now been successfully released as v7.0.0-preview.3.:tada:
Handy links:
Hey, I just wanted to let you know that after this, I can the successfully launch PowerShell on arm64 using UserLAnd. Thanks!
Most helpful comment
Hey, I just wanted to let you know that after this, I can the successfully launch PowerShell on arm64 using UserLAnd. Thanks!