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.