Skip to content

Commit ed56aca

Browse files
author
James Brundage
committed
feat: Turtle.Save() ( Fixes #105 )
Using splatting to avoid trying to save a blank property
1 parent 8495dc7 commit ed56aca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Types/Turtle/Save.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@
77
Save-Turtle
88
#>
99
param(
10+
[Parameter(Mandatory)]
1011
[string]
1112
$FilePath,
1213

1314
[string]
1415
$Property
1516
)
1617

17-
return $this | Save-Turtle $FilePath -Property $Property
18+
$saveSplat = [Ordered]@{FilePath = $FilePath}
19+
if ($Property) {
20+
$saveSplat.Property = $property
21+
}
22+
23+
return $this | Save-Turtle @saveSplat

0 commit comments

Comments
 (0)