Skip to content

Commit 9f54180

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Turtle.Save() ( Fixes #105 )
Using splatting to avoid trying to save a blank property
1 parent ed56aca commit 9f54180

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Turtle.types.ps1xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,14 +961,20 @@ return $this
961961
Save-Turtle
962962
#>
963963
param(
964+
[Parameter(Mandatory)]
964965
[string]
965966
$FilePath,
966967

967968
[string]
968969
$Property
969970
)
970971

971-
return $this | Save-Turtle $FilePath -Property $Property
972+
$saveSplat = [Ordered]@{FilePath = $FilePath}
973+
if ($Property) {
974+
$saveSplat.Property = $property
975+
}
976+
977+
return $this | Save-Turtle @saveSplat
972978

973979
</Script>
974980
</ScriptMethod>

0 commit comments

Comments
 (0)