Import specified version of NAV modules
It would be great if you where able to import a specified version of the NAV modules with Import-NAVModules e.g.
Import-NAVModules -navVersion 10
would import whatever version of NAV 2017 you have installed.
At the moment it seems the parameter is not used for anything.
Thanks! Will look into it when time permits!
Hi again, I move the discussion from Twitter here. I paste my question and your response here:
@Koubek What does mean "version 10" exactly? In the case of multiple CUs deployed...
@kaspermoerch If you have multiple installs with the same major version, it should list those. It should be like a filter so could also include build no.
Actually, the idea behind was to give the possibility to load a specific version+CU and offer so the script to be used in a fully automated process. Right now (and in whatever situation similar you describe) is required user interaction.
So, my opinion is we need to consider:
Support (or not) the scenarios when the script should behave in a fully automated manner.
In case the previous response is YES, we need to decide what value can be passed in but users (build no. vs. major version no.). I can see the decision here is pretty important.
If you specify build no. it should be pretty easy. But in case you can specify major version no. I would also recommend using of -Force parameter and there should be some algorithm that will choose which version (latest???) will be imported.
At that moment I didn`t implement the algorithm correctly exactly for the doubts I had and I have presented here right now. And later I actually forgot, sorry for that.
Maybe my thoughts are wrong so in this case sorry in advance ;)
To honour the Unix philosophy of "one thing well", which PowerShell appears to have adopted in its built-in cmdlets, I would suggest creating a separate, (probably parameterless) cmdlet that returns the installed NAV versions. This cmdlet (~Get-InstalledNAVVersion) would be available for stand-alone use (although I cannot come up with a practical use-case right now...), but would also be used from the PowerShell argument completer/dynamic parameters of e.g. the Import-NAVModules cmdlet.
I guess my point is - create separate cmdlets as much as meaningfully possible. :-)
@jhoek Maybe this is not exactly what you have on your mind but you could use Start-NAVVersionModuleSearch as a starting point.