Skip to content

Commit 865a779

Browse files
feat: Shape.ShapeType ( Fixes #9 )
1 parent a4a5be1 commit 865a779

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Types/Shape/get_ShapeType.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$shapeTypes = @(foreach ($in in $this.input) {
2+
if ($in -match $this.ShapeTypePattern) {
3+
$matches.0
4+
}
5+
})
6+
7+
8+
if (-not $shapeTypes) {
9+
return "shape"
10+
}
11+
if ($shapeTypes.Count -gt 1) {
12+
Write-Warning "There can be only one (shape type). Using $($shapeTypes[0])"
13+
}
14+
return $shapeTypes[0]

0 commit comments

Comments
 (0)