2016-08-09 171 views
3

Ich versuche, einen NuGet Feed hier einzurichten, und das hat gut funktioniert. Ich installierte ein Modul aus meinem Feed überPowershell nicht importieren Funktionen von Modul

Install-Module -Name MyCmdlets -Repository $RepoName -Scope CurrentUser -Force 
Import-Module -Name MyCmdlets 

Allerdings, wenn ich laufe Get-Module, ich keine Funktionen bekommen und es ist ein Manifest?

ModuleType Version Name        ExportedCommands         
---------- ------- ----        ----------------         
Manifest 1.0  MyCmdlets   

Wenn ich manuell auf die installierte Ort gehen und manuell importieren

Import-Module <my-path>\1.0\MyCmdlets.psm1     

ModuleType Version Name        ExportedCommands         
---------- ------- ----        ----------------      
Script  0.0  MyCmdlets      {Create-Project, Get-AuditLogs, Get-..    

Mein Manifest-Datei diese Zeilen hat, so verstehe ich nicht, warum Import-Module nicht richtig funktioniert.

FunctionsToExport = '*'

CmdletsToExport = '*'

Antwort

3

ich Sie erraten haben nicht das Root-Modul in Ihrem PSD1 gesetzt wie diese so

# 
# Module manifest for module 'YourModule' 
# 

@{ 

# Script module or binary module file associated with this manifest 
RootModule = 'YourModule.psm1' 

# Version number of this module. 
ModuleVersion = '1.0.0' 

... 

ist notwendig, damit beim Importieren Ihres Manifestmoduls auch das Skriptmodul geladen wird

+0

Vielen Dank Sie! Ich kann nicht glauben, dass ich das verpasst habe. Ich muss die Manifest-Dateien in Zukunft genauer überprüfen. – user1869558

+0

Ich wusste das, weil ich vor ein paar Wochen dasselbe gemacht habe: D – DAXaholic