Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

PowerShell ISE Error on Import Module

$
0
0
When I run the code below:
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.

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>