Powershell not importing functions from module











up vote
3
down vote

favorite












I'm trying to setup a NuGet Feed here, and that worked ok. I installed a module from my feed via



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


However when I run Get-Module, I get no functions and it's a manifest?



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


If I manually go to the installed location and import manually



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

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


My manifest file does have these lines so I don't understand why Import-Module isn't working correctly.




FunctionsToExport = '*'



CmdletsToExport = '*'











share|improve this question




























    up vote
    3
    down vote

    favorite












    I'm trying to setup a NuGet Feed here, and that worked ok. I installed a module from my feed via



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


    However when I run Get-Module, I get no functions and it's a manifest?



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


    If I manually go to the installed location and import manually



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

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


    My manifest file does have these lines so I don't understand why Import-Module isn't working correctly.




    FunctionsToExport = '*'



    CmdletsToExport = '*'











    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I'm trying to setup a NuGet Feed here, and that worked ok. I installed a module from my feed via



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


      However when I run Get-Module, I get no functions and it's a manifest?



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


      If I manually go to the installed location and import manually



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

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


      My manifest file does have these lines so I don't understand why Import-Module isn't working correctly.




      FunctionsToExport = '*'



      CmdletsToExport = '*'











      share|improve this question















      I'm trying to setup a NuGet Feed here, and that worked ok. I installed a module from my feed via



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


      However when I run Get-Module, I get no functions and it's a manifest?



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


      If I manually go to the installed location and import manually



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

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


      My manifest file does have these lines so I don't understand why Import-Module isn't working correctly.




      FunctionsToExport = '*'



      CmdletsToExport = '*'








      powershell module cmdlets powershell-module powershellget






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 9 '16 at 15:39









      DAXaholic

      19.6k33749




      19.6k33749










      asked Aug 9 '16 at 15:30









      user1869558

      3291314




      3291314
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          I guess you haven't set the root module in your .psd1 like 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'

          ...


          This is necessary so that when you import your manifest module it also loads the script module






          share|improve this answer





















          • Thank you! Can't believe I missed that. I'll need to review the manifest files more in the future.
            – user1869558
            Aug 9 '16 at 15:45










          • I knew that because I did the same a couple of weeks ago :D
            – DAXaholic
            Aug 9 '16 at 15:45


















          up vote
          0
          down vote













          For anyone coming across this looking for why their module wont import check that RootModule = 'YourModule.psm1' isn't commented out.
          By default when creating a new manifest using New-ModuleManifest it throws a hash in front of this line..



          ugh I feel so stupid.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38854869%2fpowershell-not-importing-functions-from-module%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote



            accepted










            I guess you haven't set the root module in your .psd1 like 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'

            ...


            This is necessary so that when you import your manifest module it also loads the script module






            share|improve this answer





















            • Thank you! Can't believe I missed that. I'll need to review the manifest files more in the future.
              – user1869558
              Aug 9 '16 at 15:45










            • I knew that because I did the same a couple of weeks ago :D
              – DAXaholic
              Aug 9 '16 at 15:45















            up vote
            4
            down vote



            accepted










            I guess you haven't set the root module in your .psd1 like 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'

            ...


            This is necessary so that when you import your manifest module it also loads the script module






            share|improve this answer





















            • Thank you! Can't believe I missed that. I'll need to review the manifest files more in the future.
              – user1869558
              Aug 9 '16 at 15:45










            • I knew that because I did the same a couple of weeks ago :D
              – DAXaholic
              Aug 9 '16 at 15:45













            up vote
            4
            down vote



            accepted







            up vote
            4
            down vote



            accepted






            I guess you haven't set the root module in your .psd1 like 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'

            ...


            This is necessary so that when you import your manifest module it also loads the script module






            share|improve this answer












            I guess you haven't set the root module in your .psd1 like 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'

            ...


            This is necessary so that when you import your manifest module it also loads the script module







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 9 '16 at 15:34









            DAXaholic

            19.6k33749




            19.6k33749












            • Thank you! Can't believe I missed that. I'll need to review the manifest files more in the future.
              – user1869558
              Aug 9 '16 at 15:45










            • I knew that because I did the same a couple of weeks ago :D
              – DAXaholic
              Aug 9 '16 at 15:45


















            • Thank you! Can't believe I missed that. I'll need to review the manifest files more in the future.
              – user1869558
              Aug 9 '16 at 15:45










            • I knew that because I did the same a couple of weeks ago :D
              – DAXaholic
              Aug 9 '16 at 15:45
















            Thank you! Can't believe I missed that. I'll need to review the manifest files more in the future.
            – user1869558
            Aug 9 '16 at 15:45




            Thank you! Can't believe I missed that. I'll need to review the manifest files more in the future.
            – user1869558
            Aug 9 '16 at 15:45












            I knew that because I did the same a couple of weeks ago :D
            – DAXaholic
            Aug 9 '16 at 15:45




            I knew that because I did the same a couple of weeks ago :D
            – DAXaholic
            Aug 9 '16 at 15:45












            up vote
            0
            down vote













            For anyone coming across this looking for why their module wont import check that RootModule = 'YourModule.psm1' isn't commented out.
            By default when creating a new manifest using New-ModuleManifest it throws a hash in front of this line..



            ugh I feel so stupid.






            share|improve this answer

























              up vote
              0
              down vote













              For anyone coming across this looking for why their module wont import check that RootModule = 'YourModule.psm1' isn't commented out.
              By default when creating a new manifest using New-ModuleManifest it throws a hash in front of this line..



              ugh I feel so stupid.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                For anyone coming across this looking for why their module wont import check that RootModule = 'YourModule.psm1' isn't commented out.
                By default when creating a new manifest using New-ModuleManifest it throws a hash in front of this line..



                ugh I feel so stupid.






                share|improve this answer












                For anyone coming across this looking for why their module wont import check that RootModule = 'YourModule.psm1' isn't commented out.
                By default when creating a new manifest using New-ModuleManifest it throws a hash in front of this line..



                ugh I feel so stupid.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 9 at 5:18









                James Arber

                1




                1






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38854869%2fpowershell-not-importing-functions-from-module%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Guess what letter conforming each word

                    Port of Spain

                    Run scheduled task as local user group (not BUILTIN)