Skip to content

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

Closed

Description

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

Activity

  1. added
    WG-Maintainers-Build
    on Apr 27, 2018
  2. SteveL-MSFT commented on Apr 29, 2018

    @SteveL-MSFT
    Member

    Tried private build w/ dotnetcore2.1-rc1 and it starts up on Win10 IoT

  3. adityapatwardhan commented on Jun 13, 2018

    @adityapatwardhan
    MemberAuthor

    Updated the error message.

  4. adityapatwardhan commented on Jun 13, 2018

    @adityapatwardhan
    MemberAuthor

    Another issue is [System.Environment+SpecialFolder] is not supported on Windows IOT Windows PowerShell.

    https://github.com/PowerShell/PowerShell/blob/master/src/powershell-native/Install-PowerShellRemoting.ps1#L166

  5. TravisEz13 commented on Jun 15, 2018

    @TravisEz13
    Member

    This is breaking nanoserver as well for preview.3

    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)
         at System.Management.Automation.Security.SystemPolicy.TestSaferPolicy(String testPathScript, String testPathModule)
         at System.Management.Automation.Security.SystemPolicy.GetAppLockerPolicy(String path, SafeHandle handle)
         at System.Management.Automation.Security.SystemPolicy.GetLockdownPolicy(String path, SafeHandle handle)
         at System.Management.Automation.Security.SystemPolicy.GetSystemLockdownPolicy()
         at Microsoft.PowerShell.ConsoleHost.DoRunspaceInitialization(Boolean skipProfiles, String initialCommand, String configurationName, Collection`1 initialCommandArgs)
         at Microsoft.PowerShell.ConsoleHost.DoCreateRunspace(String initialCommand, Boolean skipProfiles, Boolean staMode, String configurationName, Collection`1 initialCommandArgs)
         at Microsoft.PowerShell.ConsoleHost.CreateRunspace(Object runspaceCreationArgs)
         at Microsoft.PowerShell.ConsoleHost.DoRunspaceLoop(String initialCommand, Boolean skipProfiles, Collection`1 initialCommandArgs, Boolean staMode, String configurationName)
         at Microsoft.PowerShell.ConsoleHost.Run(CommandLineParameterParser cpp, Boolean isPrestartWarned)
         at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText, String[] args)
         at Microsoft.PowerShell.ConsoleShell.Start(String bannerText, String helpText, String[] args)
         at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String[] args, Int32 argc)  ).
    
  6. added
    Issue-Bug
    Resolution-Fixed
    on Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-BugResolution-FixedWG-Maintainers-Build

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions