d365collaborative / d365fo.tools

Tools used for Dynamics 365 Finance and Operations
MIT License
246 stars 101 forks source link

Get-D365Module throwing Cannot bind argument to parameter 'Path' #679

Closed goshoom closed 1 year ago

goshoom commented 1 year ago

I got into situation when Get-D365Module failed with Cannot bind argument to parameter 'Path' because it is an empty string.. Get-D365Module calls Get-FileVersion -Path (Get-ChildItem $modulepath -Filter "Dynamics.AX.$($obj.Name).dll").FullName and it tries to use an empty path if the DLL file doesn't exist. This happened when a re-compilation failed before completion. The folder exists, but the file doesn't. This isn't a correct state of the environment, but it shouldn't prevent me from getting a list of modules (that I want to compile). An extra check for the file existence is needed.

FH-Inway commented 1 year ago

Seems easy enough, there is already a check in place if the folder exists. We could either replace it with the check for the file or add it as an additional check.

https://github.com/d365collaborative/d365fo.tools/blob/c34e0fd70311f7b368c618f0a54c29a917428d53/d365fo.tools/functions/get-d365module.ps1#L168-L176

Splaxi commented 1 year ago

@goshoom

Did your PR's solve this issue or do we still have some work to do?

goshoom commented 1 year ago

@Splaxi I haven't done anything on it, at least not yet.

FH-Inway commented 1 year ago

@Splaxi I think this issue can be closed.