Cloud.Ready.Software.PowerShell icon indicating copy to clipboard operation
Cloud.Ready.Software.PowerShell copied to clipboard

Script ends with error messages

Open malue19 opened this issue 6 years ago • 13 comments

Hey @waldo1001 , when I exectue your script: https://github.com/waldo1001/Cloud.Ready.Software.PowerShell/blob/master/PSScripts/NAV%20Docker/LocalDocker/_ExportObjectsAsAL.ps1

I get the following errors. Unfortunately the output is partially in German. If you need the whole text, I can translate it for you.

ErrorMessages

And here is you adjusted script:

ExecutedScript

Thank you :)

malue19 avatar Aug 05 '19 05:08 malue19

Few questions:

  • are you running this on the insider-build? if so - won't work, because no C/AL anymore - the objects are already in AL
  • did you install my powershell-cmdlets on the container? can be done by:
Install-NCHDependentModules `
        -ContainerName $ContainerName `
        -ContainerModulesOnly

waldo1001 avatar Aug 06 '19 14:08 waldo1001

Unfortunately it is not possible for me to install your powershell-cmdlets...

grafik

I opened Windows Powershell ISE and copied your code from above. Then I executed it and I got the error message:

grafik

Here the error message in English: The file was not recognized as the name of a cmdlet, function, script file, or executable program.

Can you explain me, how to solve this?

malue19 avatar Sep 10 '19 10:09 malue19

I think you didn't install the "CRS.NavContainerHelperExtension" module?

you can do that with:

install-module 'CRS.NavContainerHelperExtension' -force

waldo1001 avatar Sep 10 '19 12:09 waldo1001

Ok, your advice helped me to install the modules, but when I execute your script from here:

https://github.com/waldo1001/Cloud.Ready.Software.PowerShell/blob/master/PSScripts/NAV%20Docker/LocalDocker/_ExportObjectsAsAL.ps1

I get the following error output in the PowerShell:

grafik

Where is my mistake?

malue19 avatar Sep 10 '19 12:09 malue19

nav container 0.5.0.2 ... current version is 0.6.4.0 --- maybe that's the problem with at least the last message.

KristofKlein avatar Sep 10 '19 13:09 KristofKlein

And how can I solve this?

malue19 avatar Sep 10 '19 14:09 malue19

Update it:

install-module navcontainerhelper -force

waldo1001 avatar Sep 10 '19 14:09 waldo1001

What I tend to do If it does not end up to be working: I remove all possible sources of the module from the harddrive (that would be in the program files folder and under Documents\WindowsPowerShell\Modules) and than run install-module again. I even start my scripts with uninstall-Module -Name NavContainerHelper -Force Install-Module -Name NavContainerHelper -Force Import-Module -Name NavContainerHelper -Force just to make sure I only have the latest version of the module and not some older versions somewhere.

KristofKlein avatar Sep 11 '19 06:09 KristofKlein

I updated the navcontainerhelper, but again I get an error message:

grafik

And here the error message for the Join-Path: "The argument can not be bound to the parameter Path because it is an empty string."

malue19 avatar Sep 11 '19 08:09 malue19

For this script, you can comment the first line - it doesn't need settings.. . Your first error will disappear.

Second error is a mistery. I don't know how your setup is, but it just works in a default docker container (just tried). You'll have to find out why you are not able to export that file.

Try to debug?

waldo1001 avatar Sep 11 '19 08:09 waldo1001

You were right, first error message has disappeared ;)

malue19 avatar Sep 11 '19 08:09 malue19

are you running as admin?

KristofKlein avatar Sep 11 '19 08:09 KristofKlein

The WindowsPowerShell I am running as Admin.

I thought the reason for the error message could be, that my container was unhealthy, that is why I created a new one with the following image: microsoft/bcsandbox:latest-ltsc2016

Then I ran all your commands from above, but again I get the same error message...

malue19 avatar Sep 11 '19 08:09 malue19