Skip to content

Commit d9e0c91

Browse files
Fix #3: Including Empty Array in Manifest (#5)
This change fixes an issue where adding the first command to a manifest using Add-CommandToManifest would add an empty array as an entry.
1 parent 64f1f8f commit d9e0c91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

module/Public/Add-CommandToManifest.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ function Add-CommandToManifest {
3535
function GetManifestField ([string]$Name) {
3636
$field = Find-Ast -First { $PSItem.Value -eq $Name } | Find-Ast -First
3737
# This transforms a literal string array expression into it's output without invoking.
38-
$valueString = $field.ToString() -split '[,\n\s]' `
38+
$valueString = $field.ToString() -replace '@\(\)' `
39+
-split '[,\n\s]' `
3940
-replace '['',\s]' `
4041
-match '.' `
4142
-as [List[string]]

0 commit comments

Comments
 (0)