Hello All
I am working on a small Powershell script that will run a NAV codeunit. I recently installed NAV2016 (9.0) as a test before our upgrade sometime next year (we are now running NAV2013r2 (7.1)), so I have two versions running.
Powershell ISE automatically runs the 9.0 version (apparantly because that is the most recently installed?), but I want it to automatically run the 7.1 version.
So my question is: Where is the setting where you which NAV-version it uses as standard? Or alternatively: Can I define somewhere in a script that it should use one version instead of the other?
I have found a workaround, which is easy but not optimal: If I just take the "71" folder in "C:\Program Files (x86)\Microsoft Dynamics NAV" and rename it to"90", the PowerShell ISE program will run the exe-file in 90-folder, althorugh it contains the 71-version. But I whould much rather that the program just started NAV-version in the 71 folder.
Thank you so much in advance.
Regards,
Maria
0
Answers
No, if I use Import-Module 'C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1' it will stil try to run the exe-file in the 90-folder, so the imported NavAdminTool-file does not influence which folder the subsequent powershell script uses.
FYI, I am following Waldo's guide to running af codeunit from Powershell (http://www.waldo.be/2015/07/09/start-nav-object-in-rtc-with-powershell/), and this is my code
select HKEY_LOCAL_MACHINE\SOFTWARE\Classes\DYNAMICSNAV\Shell\Open\Command
Change path from 90 to 71...
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Thank you again