File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,12 @@ function Move-Turtle {
22 <#
33 . SYNOPSIS
44 Moves a turtle.
5- . DESCRIPTION
5+ . DESCRIPTION
66 Moves a turtle by invoking a method with any number of arguments.
7+
8+ This represents a single movement of the turtle.
9+
10+ To move the turtle multiple times in one command, use `Get-Turtle`.
711 . EXAMPLE
812 New-Turtle |
913 Move-Turtle Forward 10 |
@@ -15,6 +19,10 @@ function Move-Turtle {
1519 Move-Turtle Forward 10 |
1620 Move-Turtle Right 90 |
1721 Save-Turtle "./Square.svg"
22+ . LINK
23+ Get-Turtle
24+ . LINK
25+ Set-Turtle
1826 #>
1927 [CmdletBinding (PositionalBinding = $false )]
2028 param (
@@ -64,7 +72,10 @@ function Move-Turtle {
6472 Write-Error " Method '$method ' not found on Turtle object."
6573 return
6674 }
67-
68- $inputMethod.Invoke ($ArgumentList )
75+
76+ if ($inputMethod.Script ) {
77+ $this = $InputObject
78+ & $inputMethod.Script @ArgumentList
79+ }
6980 }
7081}
You can’t perform that action at this time.
0 commit comments