aaronpowell / ps-nvm

PowerShell module for managing multiple Node.js versions

Repository from Github https://github.comaaronpowell/ps-nvmRepository from Github https://github.comaaronpowell/ps-nvm

-Version parameter should have a type

hobelinm opened this issue · comments

$Version parameter should be of type [System.Version]

Will that have much of an impact? What's the overall goal in this change?

Also, changing to System.Version would mean that you can't Install-NoteVersion -Version latest

We should always enforce parameter validation imo, this guarantees the right input

Validation is enforced by the use of a regex on the parameter bindings

i'm working a lot with Powershell-Scripts that are handling versions.
my long time experience:

arguments typed as strings => regex is a good idea
internally probably converted into System.Version....

BUT: the prefix "v" in the version label should be removed from the Argument-Value or at least, it should be optional (backward compatibility)

Happy to drop the v from being required

Closing as there's been no activity on this for over 6 months.