Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

powershell Import-Module does not import module

Posted on by 190

Hello,

I try to import NavAdminTool.ps1 into powersell but I get the following error:

Import-Module : The specified module 'C:\Program Files (x86)\Microsoft Dynamics NAV\110\Service\NavAdminTool.ps1' was not loaded because no valid module file was found i
n any module directory.

Please help me with this issue!

Regards,

Galina

*This post is locked for comments

  • Suggested answer
    jcastro Profile Picture
    jcastro 2,245 on at
    RE: powershell Import-Module does not import module

    Besides what the others have said, can you check the module is not blocked by Windows? Right click it and check it's not blocked.

  • Suggested answer
    Olister Rumao Profile Picture
    Olister Rumao 3,957 on at
    RE: powershell Import-Module does not import module

    Hi,

    Firstly you need to check your Execution Policy.

    Also I had noticed that PowerShell modules file extension is .psm1

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: powershell Import-Module does not import module

    Is NAV Server installed on your machine, only client? if the NAV server is on another machine then you don't have those folders and you get that error.  You need to execute it where the service is installed.

  • Galina Georgieva Profile Picture
    Galina Georgieva 190 on at
    RE: powershell Import-Module does not import module

    Thank you.

    The problem is that I although I enter

    Import-Module "${env:ProgramFiles}\Microsoft Dynamics NAV\110\Service\NavAdminTool.ps1"

    I get the same error:

    Import-Module : The specified module 'C:\Program Files (x86)\Microsoft Dynamics NAV\110\Service\NavAdminTool.ps1' was not loaded because no valid module file was found in any module directory.

    Regards,

    Galina

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: powershell Import-Module does not import module

    The folder should C:\Program Files, not C:\Program Files (x86)

    Try this 

    Import-Module "$env:ProgramFiles\Microsoft Dynamics NAV\110\Service\NavAdminTool.ps1"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans