@@ -23,36 +23,30 @@ function Resolve-ModuleVersionString {
2323 It is not intended for direct use outside of the Plaster context.
2424 #>
2525 param (
26- [Parameter (Mandatory )]
26+ [Parameter (Mandatory , Position = 0 )]
2727 [ValidateNotNullOrEmpty ()]
28- [string ]
29- $versionString
28+ $VersionString
3029 )
31- $parsedVersion = $null
3230
33- if ($versionString ) {
34- # We're targeting Semantic Versioning 2.0 so make sure the version has
35- # at least 3 components (X.X.X). This logic ensures that the "patch"
36- # (third) component has been specified.
37- $versionParts = $versionString.Split (' .' )
38- if ($versionParts.Length -lt 3 ) {
39- $versionString = " $versionString .0"
40- }
31+ # We're targeting Semantic Versioning 2.0 so make sure the version has
32+ # at least 3 components (X.X.X). This logic ensures that the "patch"
33+ # (third) component has been specified.
34+ $versionParts = $VersionString.Split (' .' )
35+ if ($versionParts.Length -lt 3 ) {
36+ $VersionString = " $VersionString .0"
37+ }
4138
42- if ($PSVersionTable.PSEdition -eq " Core" ) {
43- $newObjectSplat = @ {
44- TypeName = " System.Management.Automation.SemanticVersion"
45- ArgumentList = $versionString
46- }
47- $parsedVersion = New-Object @newObjectSplat
48- } else {
49- $newObjectSplat = @ {
50- TypeName = " System.Version"
51- ArgumentList = $versionString
52- }
53- $parsedVersion = New-Object @newObjectSplat
39+ if ($PSVersionTable.PSEdition -eq " Core" ) {
40+ $newObjectSplat = @ {
41+ TypeName = " System.Management.Automation.SemanticVersion"
42+ ArgumentList = $VersionString
5443 }
44+ return New-Object @newObjectSplat
45+ } else {
46+ $newObjectSplat = @ {
47+ TypeName = " System.Version"
48+ ArgumentList = $VersionString
49+ }
50+ return New-Object @newObjectSplat
5551 }
56-
57- return $parsedVersion
5852}
0 commit comments