Skip to content

Commit

Permalink
Fix #3: Including Empty Array in Manifest (#5)
Browse files Browse the repository at this point in the history
This change fixes an issue where adding the first command to a manifest
using Add-CommandToManifest would add an empty array as an entry.
  • Loading branch information
SeeminglyScience authored Jul 21, 2017
1 parent 64f1f8f commit d9e0c91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/Public/Add-CommandToManifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ function Add-CommandToManifest {
function GetManifestField ([string]$Name) {
$field = Find-Ast -First { $PSItem.Value -eq $Name } | Find-Ast -First
# This transforms a literal string array expression into it's output without invoking.
$valueString = $field.ToString() -split '[,\n\s]' `
$valueString = $field.ToString() -replace '@\(\)' `
-split '[,\n\s]' `
-replace '['',\s]' `
-match '.' `
-as [List[string]]
Expand Down

0 comments on commit d9e0c91

Please sign in to comment.