PowerShell ISE Error on Import Module

jordi79
Member Posts: 280
When I run the code below:
to import NAVAdminTool.ps1 in PowerShell ISE, I get the following error:
I did not get this error when running the same script in PowerShell. I only get this error when running it in PowerShell ISE.
I have also tried running PowerShell ISE as administrator. I still get the same error.
import-module 'C:\Program Files\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1'
to import NAVAdminTool.ps1 in PowerShell ISE, I get the following error:
Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Microsoft\Microsoft Dynamics NAV\90\Service' because it does not exist. At C:\Program Files\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1:12 char:32 + $snapInAssembly = Join-Path (Get-ItemProperty -path $nstPath).Path "\$snapIn.p ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (HKLM:\SOFTWARE\... NAV\90\Servi ce:String) [Get-ItemProperty], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetIt emPropertyCommand Join-Path : Cannot bind argument to parameter 'Path' because it is null. At C:\Program Files\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1:12 ......
I did not get this error when running the same script in PowerShell. I only get this error when running it in PowerShell ISE.
I have also tried running PowerShell ISE as administrator. I still get the same error.
0
Answers
-
Hi,
It seems you have multiple version installed and registry entries are mapped to other version that is installed.
Do you have multiple NAV Version Installed?
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
I have. But I have uninstalled previous versions before I installed the latest NAV2016.0
-
Hi,
You can create the key by manual at Registry. I use below cmdlet for import-module instead of "ps1"Import-Module "${env:ProgramFiles}\Microsoft Dynamics NAV\x0\Service\Microsoft.Dynamics.Nav.Management.dll" Import-Module "${env:ProgramFiles(x86)}\Microsoft Dynamics NAV\x0\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.dll"
Make Simple & Easy0 -
Hi,
Then if you repair your NAV 2016 installation then Navision Installer will do all Registry Updates.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
There are x86 and x64 versions of both, the PowerShell console and PowerShell ISE. The x86 versions access the virtualized registry, hiding the x64 parts and mapping the WOW6432Node instead. Therefor they can't see the registry path in question. So, just use the 64-bit versions.0
-
Thanks vaprog, using the x64 version of powershell ise was the solution0
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