Skip to content

Commit 445a699

Browse files
committed
💥 Shorthand string specification: Change @ to =
1 parent a43f0f8 commit 445a699

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ModuleFast.psm1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,10 @@ class ModuleFastSpec {
900900
$this.Initialize($moduleSpec)
901901
break
902902
}
903+
#There should be no more @{ after the string representation so end here if not parseable
904+
($Name.contains('@{')) {
905+
throw [ArgumentException]"Cannot convert $Name to a ModuleFastSpec, it does not confirm to the ModuleSpecification syntax but has '@{' in the string."
906+
}
903907
($Name.contains('>=')) {
904908
$moduleName, [NugetVersion]$lower = $Name.Split('>=')
905909
$this.Initialize($moduleName, $lower, [guid]::Empty)
@@ -910,8 +914,8 @@ class ModuleFastSpec {
910914
$this.Initialize($moduleName, [VersionRange]::Parse("(,$upper]"), [guid]::Empty)
911915
break
912916
}
913-
($Name.contains('@')) {
914-
$moduleName, $exactVersion = $Name.Split('@')
917+
($Name.contains('=')) {
918+
$moduleName, $exactVersion = $Name.Split('=')
915919
$this.Initialize($moduleName, [VersionRange]::Parse("[$exactVersion]"), [guid]::Empty)
916920
break
917921
}

ModuleFast.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Describe 'Get-ModuleFastPlan' -Tag 'E2E' {
158158
}
159159
},
160160
@{
161-
Spec = 'Az.Accounts@2.7.3'
161+
Spec = 'Az.Accounts=2.7.3'
162162
Check = {
163163
$actual.ModuleVersion | Should -Be '2.7.3'
164164
}

0 commit comments

Comments
 (0)