GithubProvider icon indicating copy to clipboard operation
GithubProvider copied to clipboard

Cannot use Import-Module GH:\...

Open vors opened this issue 10 years ago • 1 comments

I would love to be able to do that, so I would have the latest dev version of modules that I'm working on

Currently I get an error

> Import-Module GH:\vors\ZLocation\ZLocation\ZLocation.psd1
Import-Module : The current provider (GithubProvider\Github) cannot open a file.
At line:1 char:1
+ Import-Module GH:\vors\ZLocation\ZLocation\ZLocation.psd1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (GH:\vors\ZLocat...\ZLocation.psd1:String) [Import-Module], RuntimeExc
   eption
    + FullyQualifiedErrorId : FileOpenError,Microsoft.PowerShell.Commands.ImportModuleCommand

vors avatar Jul 17 '15 22:07 vors

In the meantime, you should be able to import simple modules (ie, doesn't depend on other gh modules) like so:

gc GH:\vors\ZLocation\ZLocation\ZLocation.psd1 | Import-Module

Import-Module not supporting non-fs providers is a similar issue to Out-File not supporting non-fs providers (and there's probably more). In theory I could alias over it and polyfill the functionality in a similar way... but it might not be possible, since included modules depend on things like $PSScriptRoot being set in a meaningful way. I'll need to see if there's a way to work around that.

weswigham avatar Jul 17 '15 23:07 weswigham