Please feel free to provide feedback or file bugs here.

BUG: binary module loading fails silently on Fall Creators update on some machines

occurs in PS 5.1 on Windows 10, Fall Creators update
First observed with SqlServer module 21.0.17199
Also occurs with PsWindowsUpdate v2.0.0.0 , SqlServer 21.0.17224

Pretty much what it says - with either autoload or Import-Module, the module loads with no complaints but the cmdlets aren't there. The assemblies _do_ get loaded into the appdomain. I found no obvious clues poking around with ProcMon and Trace-Command (obvious to me, anyway). Happens on some machines, not others. Reported by 3 users (that I know of), in each case after updating to the Fall Creators update. If you have any debugging hints, they'd be appreciated.

Originally reported here: https://www.powershellgallery.com/packages/SqlServer/21.0.17199#lf-content=193467826:746604807
PsWindowsUpdate issue reported here: https://www.powershellgallery.com/packages/SqlServer/21.0.17199#lf-content=193467826:755426344
Possibly related to: https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11088816-cannot-build-a-binary-module-referencing-3-0-sma-d ??

3 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    unbob shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • unbob commented  ·   ·  Flag as inappropriate

        Workaround (fix?) works for me (the original poster). @pwesten - I'm interested in how you made the connection from an ASP.Net Core issue to this one.

        Also interesting - If you chase all the links that people have kindly left behind in their comments, it takes you all the way back to August of 2012: https://stackoverflow.com/questions/12060460/using-powershell-2-as-the-default-version-on-windows-8. I guess even Fusion won't keep you completely out of DLL ****.

        Is there some way to downgrade this from BUG to bug-with-known-workaround?

      • pwesten commented  ·   ·  Flag as inappropriate

        riegelj posted a fix on https://github.com/aspnet/Tooling/issues/755 that worked for me:

        ----

        adding this registry entry fixed my problem. Thanks @n777ty for figuring this out.

        Windows Registry Editor Version 5.00

        [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\PublisherPolicy\Default\v4.0_Policy.1.0.System.Management.Automation__31bf3856ad364e35]

        [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\PublisherPolicy\Default\v4.0_Policy.1.0.System.Management.Automation__31bf3856ad364e35\1]

        [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\PublisherPolicy\Default\v4.0_Policy.1.0.System.Management.Automation__31bf3856ad364e35\1\1.0.0.0]
        "ConfigFilePath"="C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Policy.1.0.System.Management.Automation\v4.0_1.0.0.0__31bf3856ad364e35\Policy.1.0.System.Management.Automation.config"

        hope you'll find this useful

      Feedback and Knowledge Base