Skip to content

Some modules published for PowerShell core cannot be imported #1346

Closed

Description

Steps to reproduce

Import-Module AppxProvider
Import-Module CimCmdlets
Import-Module Microsoft.PowerShell.ODataUtils
Import-Module Microsoft.WSMan.Management

Expected behavior

Modules published for PowerShell core should be able to be imported

Actual behavior

Importing those 4 modules from the published 'Modules' folder fails

> Import-Module AppxProvider
Import-Module : The module to process 'Microsoft.Windows.Appx.PackageManager.Commands', listed in field
'ModuleToProcess/RootModule' of module manifest 'C:\windows\system32\WindowsPowerShell\v1.0\Modules\Appx\Appx.psd1'
was not processed because no valid module was found in any module directory.
At line:1 char:1
+ Import-Module AppxProvider
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Appx:String) [Import-Module], PSInvalidOperationException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

> Import-Module Microsoft.PowerShell.ODataUtils
Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\users\dongbow\downloads\ops\Modules\Microsoft.PowerShell.ODataUtils\Microsoft.PowerShell.ODataUtils.psm1:5
char:27
+ $ProcessorArchitecture = (Get-WmiObject -query "Select Architecture f ...
+                           ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

> Import-Module .\Modules\CimCmdlets
Import-Module : Could not load file or assembly
'C:\Users\dongbow\Downloads\ops\Modules\CimCmdlets\Microsoft.Management.Infrastructure.CimCmdlets.dll' or one of its
dependencies. The system cannot find the file specified.
At line:1 char:1
+ Import-Module .\Modules\CimCmdlets
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

> Import-Module .\Modules\Microsoft.WSMan.Management
Import-Module : The module to process 'Microsoft.WSMan.Management.dll', listed in field 'NestedModules' of module
manifest 'C:\Users\dongbow\Downloads\ops\Modules\Microsoft.WSMan.Management\Microsoft.WSMan.Management.psd1' was not
processed because no valid module was found in any module directory.
At line:1 char:1
+ Import-Module .\Modules\Microsoft.WSMan.Management
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (Microsoft.WSMan.Management:String) [Import-Module], PSInvalidOpera
   tionException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSRemotingProtocolVersion      2.3
CLRVersion
SerializationVersion           1.1.0.1
PSVersion                      5.1.10032.0
BuildVersion                   3.0.0.0
WSManStackVersion              3.0
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
GitCommitId                    v0.6.0

Activity

  1. added
    WG-Maintainers-Build
    Area-PackageManagement
    on Jul 13, 2016
  2. daxian-dbw commented on Jul 13, 2016

    @daxian-dbw
    MemberAuthor
  3. raghushantha commented on Jul 13, 2016

    @raghushantha
    Member

    Dongbo Wang (@daxian-dbw) AppxProvider is supported only on Nano. So yes - this must work on CorePS-Nano.

    farehar Can you validate that AppxProvider works on Nano? Also, we need to rebrand this to WSAProvider - since on Nano the package type is WSA

  4. daxian-dbw commented on Jul 13, 2016

    @daxian-dbw
    MemberAuthor

    Raghu Shantha (@raghushantha) AppxProvider is not an in-box module for NanoServer. Is it an optional module that already work in Nano powershell?
    BTW, do your team own the ODataUtils module? It's not compatible with CoreCLR PS, and thus need to be refactored to work in CoreCLR PS or moved to Full PS only module folder.

  5. daxian-dbw commented on Jul 13, 2016

    @daxian-dbw
    MemberAuthor

    AppxProvider is supported only on Nano

    Raghu Shantha (@raghushantha) Does this mean it's not supported for PowerShell (FullCLR or CoreCLR) on full windows? If that's the case, then we probably should not publish it along with PowerShell.
    cc sergei (@vors)

  6. farehar commented on Jul 13, 2016

    @farehar

    I tested wsaprovider on nano yesterday and it works fine. but you need to get it from powershell gallery.

    find-packageprovider wsaprovider | install-packageprovider

    we should remove the code from powershell repo code based. it is already available @ https://github.com/PowerShell/WSAProvider

  7. raghushantha commented on Jul 13, 2016

    @raghushantha
    Member

    Dongbo Wang (@daxian-dbw) On Nano - (Appx)WSAProvider is not in-box, but can be obtained from PowerShellGallery.
    find-packageprovider WSAProvider

    The code for WSAProvider is opensourced here
    And the ship vehicle is PowerShellGallery.

    So I will take out the AppxProvider code from PowerShell repi- does not make sense to ship with PowerShell Core

    To answer your question - WSAProvider will be applicable on Nano only (Inbox PS OR PowerShell Core from repo) - i.e CoreCLR only

  8. raghushantha commented on Jul 13, 2016

    @raghushantha
    Member
  9. vors commented on Jul 13, 2016

    @vors
    Collaborator

    We need to talk about this and few other cases offline.
    We have WSAProvider and ODataUtils as a separate modules on github.
    And we support upgrade from PSGallery.

    On the other hand, we have a desire to build a full package that we can build out of windows from here.
    It could be that keeping this code in the PS/PS repo and removing the redundent repos is the right approach. Could be vice verse. We should find what's the right approach and avoid duplication.

  10. vors commented on Jul 28, 2016

    @vors
    Collaborator

    All things, except OdataUtils already excluded via #1477. For the remaining module I created #1548

  11. changed the title [-]Some modules published for CoreCLR OPS cannot be imported[/-] [+]Some modules published for PowerShell core cannot be imported[/+] on Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-PackageManagementWG-Maintainers-Build

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions