Skip to content

pwsh.exe does not start on Windows 10 IOT (arm32) #6750

@adityapatwardhan

Description

@adityapatwardhan

pwsh does not start on Windows 10 IOT arm32 and nanoserver amd64. The issue is with the usage of GetSaferPolicy, which is not supported on Windows IOT. The other issue with setting up remoting endpoint is with usage of
[System.Environment+SpecialFolder] in Install-PowerShellRemoting.ps1 script.

The error shown is:

.\pwsh.exe : Cannot load PSReadline module.  Console is running without PSReadline.
    + CategoryInfo          : NotSpecified: (Cannot load PSR...out PSReadline.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

FailFast:
This function is not supported on this system
   at System.Environment.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.ComponentModel.Win32Exception: This function is not supported on this system
   at System.Management.Automation.Internal.SecuritySupport.GetSaferPolicy(String path, SafeHandle handle) in
C:\PowerShell\src\System.Management.Automation\security\SecuritySupport.cs:line 558
   at System.Management.Automation.Security.SystemPolicy.TestSaferPolicy(String testPathScript, String testPathModule)
in C:\PowerShell\src\System.Management.Automation\security\wldpNativeMethods.cs:line 331
   at System.Management.Automation.Security.SystemPolicy.GetAppLockerPolicy(String path, SafeHandle handle) in
C:\PowerShell\src\System.Management.Automation\security\wldpNativeMethods.cs:line 209
   at System.Management.Automation.Security.SystemPolicy.GetLockdownPolicy(String path, SafeHandle handle) in
C:\PowerShell\src\System.Management.Automation\security\wldpNativeMethods.cs:line 94
   at System.Management.Automation.Security.SystemPolicy.GetSystemLockdownPolicy() in
C:\PowerShell\src\System.Management.Automation\security\wldpNativeMethods.cs:line 56
   at Microsoft.PowerShell.ConsoleHost.DoRunspaceInitialization(Boolean skipProfiles, String initialCommand, String
configurationName, Collection`1 initialCommandArgs) in
C:\PowerShell\src\Microsoft.PowerShell.ConsoleHost\host\msh\ConsoleHost.cs:line 1705
   at Microsoft.PowerShell.ConsoleHost.DoCreateRunspace(String initialCommand, Boolean skipProfiles, Boolean staMode,
String configurationName, Collection`1 initialCommandArgs) in
C:\PowerShell\src\Microsoft.PowerShell.ConsoleHost\host\msh\ConsoleHost.cs:line 1652
   at Microsoft.PowerShell.ConsoleHost.CreateRunspace(Object runspaceCreationArgs) in
C:\PowerShell\src\Microsoft.PowerShell.ConsoleHost\host\msh\ConsoleHost.cs:line 1532
   at Microsoft.PowerShell.ConsoleHost.DoRunspaceLoop(String initialCommand, Boolean skipProfiles, Collection`1
initialCommandArgs, Boolean staMode, String configurationName) in
C:\PowerShell\src\Microsoft.PowerShell.ConsoleHost\host\msh\ConsoleHost.cs:line 1453
   at Microsoft.PowerShell.ConsoleHost.Run(CommandLineParameterParser cpp, Boolean isPrestartWarned) in
C:\PowerShell\src\Microsoft.PowerShell.ConsoleHost\host\msh\ConsoleHost.cs:line 1402
   at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText, String[] args) in
C:\PowerShell\src\Microsoft.PowerShell.ConsoleHost\host\msh\ConsoleHost.cs:line 270
   at Microsoft.PowerShell.ConsoleShell.Start(String bannerText, String helpText, String[] args) in
C:\PowerShell\src\Microsoft.PowerShell.ConsoleHost\host\msh\ConsoleShell.cs:line 29
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String[] args, Int32 argc) in
C:\PowerShell\src\Microsoft.PowerShell.ConsoleHost\host\msh\ManagedEntrance.cs:line 64

Steps to reproduce

Install PowerShell 6.1.0-preview.2 and start pwsh.exe

Expected behavior

pwsh starts

Actual behavior

Failure to start

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.1.0-preview.2
PSEdition                      Core
GitCommitId                    v6.1.0-preview.2

Metadata

Metadata

Assignees

Labels

Area-Maintainers-Buildspecific to affecting the buildIssue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions