Powershell error : $NavIde was not correctly set.

cyuwono
Member Posts: 28
Has anyone came a cross this "$NavIde was not correctly set." error when when executing any functions on NavModelTools.ps1 through powershell ISE ? I think I missed a step or two but I don't know what that step is. When running the same function using the "Microsoft Dynamics NAV 2015 Development Shell" shortcut I did not get this error.
I would appreciate if someone can help me with this.
Carlos
I would appreciate if someone can help me with this.
Carlos
Carlos Yuwono
0
Best Answers
-
The Import-Module line is not correct.
Import-Module 'C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1' -WarningAction SilentlyContinue | out-null
It should be Microsoft.Dynamics.Nav.Model.Tools.psd1 at the end of the path. The WarningAction parameter is not required, but it suppresses the warnings that would show up otherwise.
If you want to avoid the fuss of typing that in, try this:
http://www.waldo.be/2015/07/20/load-dynamics-nav-cmdlets-in-powershell-ise-with-profiles/Kai Kowalewski5 -
or run
. 'C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\NavModelTools.ps1' -NavIde 'C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\finsql.exe'5
Answers
-
Run ISE as admin, type the Set-executionpolicy there, "Bypass" is somewhat dangerous, "RemoteSigned" is usually sufficient. Confirm the message that pops up. Do this both for the 64bit and 32bit (x86) version, but once is enough for all eternity on your system. Close the ISE admin session.
Then run ISE again, but NOT as admin. Then run your script starting with the Import-Module line here.Kai Kowalewski0 -
Hi Kowa thanks for the suggestion. I followed your steps but I am still getting the same error
I also tried on two different computer both gave me the same error.
Carlos Yuwono0 -
The Import-Module line is not correct.
Import-Module 'C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1' -WarningAction SilentlyContinue | out-null
It should be Microsoft.Dynamics.Nav.Model.Tools.psd1 at the end of the path. The WarningAction parameter is not required, but it suppresses the warnings that would show up otherwise.
If you want to avoid the fuss of typing that in, try this:
http://www.waldo.be/2015/07/20/load-dynamics-nav-cmdlets-in-powershell-ise-with-profiles/Kai Kowalewski5 -
or run
. 'C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\NavModelTools.ps1' -NavIde 'C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\finsql.exe'5 -
Thank you Kowa and mohana_cse06 problem solved.
Carlos Yuwono0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions