Skip to content

PowerShell Core is Broken on Windows 7 After the Upgrade to .Net Core 2.0 #3747

Description

PowerShell Core no longer works on Windows 7 after the upgrade to .Net Core 2.0 due to missing API sets that are no longer shipped with .Net Core. The issue appeared between the Alpha.18 and Beta.1 releases. Alpha.18 is the last working release for Windows 7.

Builds after the upgrade will fail with the following message:

c:\Program Files\PowerShell>.\6.0.0-beta.1\powershell.exe
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. ---> System.DllNotFoundException: Un
able to load DLL 'api-ms-win-eventing-provider-l1-1-0.dll': The specified module
 could not be found. (Exception from HRESULT: 0x8007007E)
   at System.Management.Automation.Tracing.EtwActivity.UnsafeNativeMethods.Event
ActivityIdControl(ActivityControlCode controlCode, Guid& activityId)
   at System.Management.Automation.Tracing.EtwActivity.GetActivityId()
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String
[] args, Int32 argc)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments,
 Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Objec
t[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.Management.Automation.PowerShellAssemblyLoadContextInitializer.Init
ializeAndCallEntryMethod(String basePaths, AssemblyName entryAssemblyName, Strin
g entryTypeName, String entryMethodName, Object[] args)
   at Microsoft.PowerShell.ManagedPSEntry.Main(String[] args)

The issue is greater than this single API set because around 80 API sets are no longer shipped by .Net Core. Here is a comparison between .Net Core 1.6 (6.0.0.16) and .Net Core 2.0 (beta1):

c:\Program Files\PowerShell>dir /s api-*
Volume in drive C has no label.
Volume Serial Number is 9451-5721

Directory of c:\Program Files\PowerShell\6.0.0-beta.1

05/01/2017 08:42 PM 19,136 api-ms-win-core-console-l1-1-0.dll
05/01/2017 08:42 PM 18,112 api-ms-win-core-datetime-l1-1-0.dll
05/01/2017 08:42 PM 18,112 api-ms-win-core-debug-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-errorhandling-l1-1-0.dll
05/01/2017 08:42 PM 22,208 api-ms-win-core-file-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-file-l1-2-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-file-l2-1-0.dll
05/01/2017 08:42 PM 18,616 api-ms-win-core-handle-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-heap-l1-1-0.dll
05/01/2017 08:42 PM 18,616 api-ms-win-core-interlocked-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-core-libraryloader-l1-1-0.dll
05/01/2017 08:42 PM 21,184 api-ms-win-core-localization-l1-2-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-core-memory-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-namedpipe-l1-1-0.dll
05/01/2017 08:42 PM 19,648 api-ms-win-core-processenvironment-l1-1-0.dll
05/01/2017 08:42 PM 20,672 api-ms-win-core-processthreads-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-core-processthreads-l1-1-1.dll
05/01/2017 08:42 PM 18,112 api-ms-win-core-profile-l1-1-0.dll
05/01/2017 08:42 PM 18,616 api-ms-win-core-rtlsupport-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-string-l1-1-0.dll
05/01/2017 08:42 PM 20,672 api-ms-win-core-synch-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-core-synch-l1-2-0.dll
05/01/2017 08:42 PM 19,648 api-ms-win-core-sysinfo-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-timezone-l1-1-0.dll
05/01/2017 08:42 PM 18,624 api-ms-win-core-util-l1-1-0.dll
05/01/2017 08:42 PM 19,648 api-ms-win-crt-conio-l1-1-0.dll
05/01/2017 08:42 PM 22,720 api-ms-win-crt-convert-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-crt-environment-l1-1-0.dll
05/01/2017 08:42 PM 20,672 api-ms-win-crt-filesystem-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-crt-heap-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-crt-locale-l1-1-0.dll
05/01/2017 08:42 PM 27,840 api-ms-win-crt-math-l1-1-0.dll
05/01/2017 08:42 PM 26,296 api-ms-win-crt-multibyte-l1-1-0.dll
05/01/2017 08:42 PM 70,848 api-ms-win-crt-private-l1-1-0.dll
05/01/2017 08:42 PM 19,648 api-ms-win-crt-process-l1-1-0.dll
05/01/2017 08:42 PM 23,232 api-ms-win-crt-runtime-l1-1-0.dll
05/01/2017 08:42 PM 24,768 api-ms-win-crt-stdio-l1-1-0.dll
05/01/2017 08:42 PM 24,768 api-ms-win-crt-string-l1-1-0.dll
05/01/2017 08:42 PM 21,184 api-ms-win-crt-time-l1-1-0.dll
05/01/2017 08:42 PM 19,136 api-ms-win-crt-utility-l1-1-0.dll
40 File(s) 857,056 bytes

Directory of c:\Program Files\PowerShell\6.0.0.16

06/13/2016 10:46 PM 18,672 API-MS-Win-Base-Util-L1-1-0.dll
06/13/2016 10:46 PM 23,272 api-ms-win-core-com-l1-1-0.dll
06/13/2016 10:46 PM 18,696 api-ms-win-core-com-private-l1-1-0.dll
06/13/2016 10:46 PM 19,696 api-ms-win-core-comm-l1-1-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-console-l1-1-0.dll
06/13/2016 10:46 PM 21,248 api-ms-win-core-console-l2-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-datetime-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-datetime-l1-1-1.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-debug-l1-1-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-debug-l1-1-1.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-delayload-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-errorhandling-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-errorhandling-l1-1-1.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-fibers-l1-1-0.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-fibers-l1-1-1.dll
06/13/2016 10:46 PM 22,768 api-ms-win-core-file-l1-1-0.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-file-l1-2-0.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-file-l1-2-1.dll
06/13/2016 10:46 PM 19,184 api-ms-win-core-file-l2-1-0.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-file-l2-1-1.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-handle-l1-1-0.dll
06/13/2016 10:46 PM 19,184 api-ms-win-core-heap-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-heap-obsolete-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-interlocked-l1-1-0.dll
06/13/2016 10:46 PM 19,176 api-ms-win-core-io-l1-1-0.dll
06/13/2016 10:46 PM 18,664 api-ms-win-core-io-l1-1-1.dll
06/13/2016 10:46 PM 21,784 api-ms-win-core-kernel32-legacy-l1-1-0.dll
06/13/2016 10:46 PM 19,736 api-ms-win-core-kernel32-legacy-l1-1-1.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-kernel32-legacy-l1-1-2.dll
06/13/2016 10:46 PM 19,744 API-MS-Win-Core-Kernel32-Private-L1-1-0.dll
06/13/2016 10:46 PM 18,720 API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
06/13/2016 10:46 PM 19,744 API-MS-Win-Core-Kernel32-Private-L1-1-2.dll
06/13/2016 10:46 PM 19,728 api-ms-win-core-libraryloader-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-libraryloader-l1-1-1.dll
06/13/2016 10:46 PM 21,776 api-ms-win-core-localization-l1-2-0.dll
06/13/2016 10:46 PM 18,704 api-ms-win-core-localization-l1-2-1.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-localization-l2-1-0.dll
06/13/2016 10:46 PM 19,256 api-ms-win-core-localization-obsolete-l1-2-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-memory-l1-1-0.dll
06/13/2016 10:46 PM 19,704 api-ms-win-core-memory-l1-1-1.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-memory-l1-1-2.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-memory-l1-1-3.dll
06/13/2016 10:46 PM 19,200 api-ms-win-core-namedpipe-l1-1-0.dll
06/13/2016 10:46 PM 18,696 api-ms-win-core-namedpipe-l1-2-1.dll
06/13/2016 10:46 PM 18,712 api-ms-win-core-normalization-l1-1-0.dll
06/13/2016 10:46 PM 19,736 API-MS-Win-Core-PrivateProfile-L1-1-0.dll
06/13/2016 10:46 PM 18,712 api-ms-win-core-privateprofile-l1-1-1.dll
06/13/2016 10:46 PM 19,752 api-ms-win-core-processenvironment-l1-1-0.dll
06/13/2016 10:46 PM 18,728 api-ms-win-core-processenvironment-l1-2-0.dll
06/13/2016 10:46 PM 19,232 api-ms-win-core-processsecurity-l1-1-0.dll
06/13/2016 10:46 PM 21,272 api-ms-win-core-processthreads-l1-1-0.dll
06/13/2016 10:46 PM 19,736 api-ms-win-core-processthreads-l1-1-1.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-processthreads-l1-1-2.dll
06/13/2016 10:46 PM 19,272 API-MS-Win-Core-ProcessTopology-Obsolete-L1-1-0.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-profile-l1-1-0.dll
06/13/2016 10:46 PM 19,208 api-ms-win-core-psapi-ansi-l1-1-0.dll
06/13/2016 10:46 PM 19,696 api-ms-win-core-psapi-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-psapi-obsolete-l1-1-0.dll
06/13/2016 10:46 PM 19,200 api-ms-win-core-realtime-l1-1-0.dll
06/13/2016 10:46 PM 20,736 api-ms-win-core-registry-l1-1-0.dll
06/13/2016 10:46 PM 20,224 api-ms-win-core-registry-l2-1-0.dll
06/13/2016 10:46 PM 19,208 api-ms-win-core-rtlsupport-l1-1-0.dll
06/13/2016 10:46 PM 23,320 api-ms-win-core-shlwapi-legacy-l1-1-0.dll
06/13/2016 10:46 PM 21,280 api-ms-win-core-shlwapi-obsolete-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-shutdown-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-shutdown-l1-1-1.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-string-l1-1-0.dll
06/13/2016 10:46 PM 19,192 API-MS-Win-Core-String-L2-1-0.dll
06/13/2016 10:46 PM 19,232 api-ms-win-core-string-obsolete-l1-1-0.dll
06/13/2016 10:46 PM 19,232 api-ms-win-core-string-obsolete-l1-1-1.dll
06/13/2016 10:46 PM 19,208 API-MS-Win-Core-StringAnsi-L1-1-0.dll
06/13/2016 10:46 PM 18,704 api-ms-win-core-stringloader-l1-1-0.dll
06/13/2016 10:46 PM 18,704 api-ms-win-core-stringloader-l1-1-1.dll
06/13/2016 10:46 PM 20,720 api-ms-win-core-synch-l1-1-0.dll
06/13/2016 10:46 PM 19,696 api-ms-win-core-synch-l1-2-0.dll
06/13/2016 10:46 PM 19,712 api-ms-win-core-sysinfo-l1-1-0.dll
06/13/2016 10:46 PM 19,200 api-ms-win-core-sysinfo-l1-2-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-sysinfo-l1-2-1.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-sysinfo-l1-2-2.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-sysinfo-l1-2-3.dll
06/13/2016 10:46 PM 21,256 api-ms-win-core-threadpool-l1-2-0.dll
06/13/2016 10:46 PM 19,240 api-ms-win-core-threadpool-legacy-l1-1-0.dll
06/13/2016 10:46 PM 18,728 api-ms-win-core-threadpool-private-l1-1-0.dll
06/13/2016 10:46 PM 19,200 api-ms-win-core-timezone-l1-1-0.dll
06/13/2016 10:46 PM 20,200 api-ms-win-core-url-l1-1-0.dll
06/13/2016 10:46 PM 18,672 api-ms-win-core-util-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-core-version-l1-1-0.dll
06/13/2016 10:46 PM 19,728 api-ms-win-core-winrt-error-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-core-winrt-error-l1-1-1.dll
06/13/2016 10:46 PM 19,704 api-ms-win-core-winrt-l1-1-0.dll
06/13/2016 10:46 PM 19,240 api-ms-win-core-winrt-registration-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-core-winrt-robuffer-l1-1-0.dll
06/13/2016 10:46 PM 19,272 api-ms-win-core-winrt-roparameterizediid-l1-1-0.dll
06/13/2016 10:46 PM 20,240 api-ms-win-core-winrt-string-l1-1-0.dll
06/13/2016 10:46 PM 18,680 api-ms-win-core-wow64-l1-1-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-xstate-l1-1-0.dll
06/13/2016 10:46 PM 19,192 api-ms-win-core-xstate-l2-1-0.dll
06/13/2016 10:46 PM 21,256 API-MS-Win-devices-config-L1-1-0.dll
06/13/2016 10:46 PM 21,256 API-MS-Win-devices-config-L1-1-1.dll
06/13/2016 10:46 PM 19,248 API-MS-Win-Eventing-ClassicProvider-L1-1-0.dll
06/13/2016 10:46 PM 18,704 API-MS-Win-Eventing-Consumer-L1-1-0.dll
06/13/2016 10:46 PM 19,224 API-MS-Win-Eventing-Controller-L1-1-0.dll
06/13/2016 10:46 PM 19,208 API-MS-Win-Eventing-Legacy-L1-1-0.dll
06/13/2016 10:46 PM 19,216 API-MS-Win-Eventing-Provider-L1-1-0.dll
06/13/2016 10:46 PM 19,208 API-MS-Win-EventLog-Legacy-L1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-ro-typeresolution-l1-1-0.dll
06/13/2016 10:46 PM 24,832 api-ms-win-security-base-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-security-cpwl-l1-1-0.dll
06/13/2016 10:46 PM 20,760 api-ms-win-security-cryptoapi-l1-1-0.dll
06/13/2016 10:46 PM 19,224 api-ms-win-security-lsalookup-l2-1-0.dll
06/13/2016 10:46 PM 18,712 api-ms-win-security-lsalookup-l2-1-1.dll
06/13/2016 10:46 PM 19,728 API-MS-Win-Security-LsaPolicy-L1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-security-provider-l1-1-0.dll
06/13/2016 10:46 PM 19,200 api-ms-win-security-sddl-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-service-core-l1-1-0.dll
06/13/2016 10:46 PM 18,688 api-ms-win-service-core-l1-1-1.dll
06/13/2016 10:46 PM 19,224 api-ms-win-service-management-l1-1-0.dll
06/13/2016 10:46 PM 19,216 api-ms-win-service-management-l2-1-0.dll
06/13/2016 10:46 PM 19,720 api-ms-win-service-private-l1-1-0.dll
06/13/2016 10:46 PM 19,720 api-ms-win-service-private-l1-1-1.dll
06/13/2016 10:46 PM 20,232 api-ms-win-service-winsvc-l1-1-0.dll
121 File(s) 2,358,064 bytes

 Total Files Listed:
         161 File(s)      3,215,120 bytes
           0 Dir(s)  118,003,507,200 bytes free

Activity

  1. changed the title [-]PowerShell Core is Broken on Windows 7 After the Upgrade to .Net Core[/-] [+]PowerShell Core is Broken on Windows 7 After the Upgrade to .Net Core 2.0[/+] on May 10, 2017
  2. added this to the milestone on May 10, 2017
  3. lukegriffith commented on May 13, 2017

    @lukegriffith

    I have the same issue on MacOS, using System.Management.Automation.Language.Parser.ParseFile(...)

    netcoreapp2.0 + system.management.automation Version="6.0.0-beta.1"

  4. MaximoTrinidad commented on May 14, 2017

    @MaximoTrinidad

    FYI

    Documentation on v6.0.0-beta.1 release of PowerShellCore release notes states:
    "Note: Windows 7 support is currently broken, and we plan to release a working package in the future."

    I won't try to use .NET Core 2.0 Preview on any previous version for PowerShell Alpha.

    Windows 10, WSL BASH, and Ubuntu seems running OK!

  5. iSazonov commented on May 14, 2017

    @iSazonov
    Collaborator

    @lukemgriffith Please open new Issue with repo steps and full errors report.

  6. modified the milestones: , on May 15, 2017
  7. 2 remaining items

  8. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    I spoke too soon!!

    PowerShell 6.0.0-beta gets hung up in Windows 10 Bash Console but not when you use the Ubuntu Desktop under Xserver. (See attached Images)

    Bash Console:
    poshbeta_bashconsole_2017-05-17_10-28-40

    Bash in Ubuntu Desktop in Windows 10 Insider Build 16193:
    poshbeta_bashgui_2017-05-17_10-28-40

  9. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    I already logged it on WSL: PowerShell 6.0.0-beta hung up in Windows 10 Bash Console. #2124

  10. SteveL-MSFT commented on May 17, 2017

    @SteveL-MSFT
    Member

    Maximo Trinidad (@MaximoTrinidad) you have to use the full URL or include the org/repo since the issue is in a different repo: microsoft/WSL#2124

  11. MaximoTrinidad commented on May 17, 2017

    @MaximoTrinidad

    Thanks Steve Lee (@SteveL-MSFT) ! I update the link.
    :)

  12. MaximoTrinidad commented on May 18, 2017

    @MaximoTrinidad

    FYI
    I completed testing PowerShell 6.0.0-beta on my Window 10 Bash Console. I uninstall and did a clean Bash installation without .NET Core 2.0 Preview 1 and PowerShell is getting hung.

    1. lxrun /uninstall /full
    2. lxrun /install
    3. Open Bash Console.
    4. sudo su ##-> Prepare for PowerShell Beta Install
      curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
      curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
      exit
    5. sudo apt update
    6. sudo apt upgrade ##-> This command will also install PowerShell
    7. Open PowerShell ##-> But it hungs, the prompt won't come up.

    In my case, is was nothing to do with .NET Core installation.

  13. adityapatwardhan commented on Aug 4, 2017

    @adityapatwardhan
    Member

    Fixed with #4438

  14. iSazonov commented on Aug 6, 2017

    @iSazonov
    Collaborator

    Fixed with #4463.

  15. ferenczy commented on Aug 29, 2019

    @ferenczy

    Sorry, but it doesn't seem to be fixed. Two examples where a regular command causes the DLL load issue follow.

    1. Command Get-Item with -Stream option
    $ Get-Item *.* -Stream *.
    Get-Item : Unable to load DLL 'api-ms-win-core-file-l1-2-2.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    
    1. Command Start-Process with -Wait option
    $ Start-Process pwsh -Wait
    Start-Process : Unable to load DLL 'api-ms-win-core-job-l2-1-0.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    

    In both cases, it's caused by the mentioned option. Without those options, the commands are successful.

    Windows 7 Ultimate 64bit

    $ echo $PSVersionTable
    
    Name                           Value
    ----                           -----
    PSVersion                      6.2.2
    PSEdition                      Core
    GitCommitId                    6.2.2
    OS                             Microsoft Windows 6.1.7601 S
    Platform                       Win32NT
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    

    Should I create a new issue or is it the same cause?

  16. iSazonov commented on Aug 29, 2019

    @iSazonov
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Resolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimeWG-Maintainers-Buildspecific to affecting the build

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions