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
Carlos Yuwono
0
Answers
Then run ISE again, but NOT as admin. Then run your script starting with the Import-Module line here.
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/
. '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'
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav