Skip to content

Commit e1ad82c

Browse files
authored
Add -Static switch to Find-PSMDType
Add `-Static` switch to Find-PSMDType to filter on "static classes"
1 parent d95fdad commit e1ad82c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

PSModuleDevelopment/functions/assembly/Find-PSMDType.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
[switch]
7171
$Enum,
7272

73+
[switch]
74+
$Static,
75+
7376
[string]
7477
$Implements,
7578

@@ -84,6 +87,7 @@
8487
{
8588
$boundEnum = Test-PSFParameterBinding -ParameterName Enum
8689
$boundPublic = Test-PSFParameterBinding -ParameterName Public
90+
$boundStatic = Test-PSFParameterBinding -ParameterName Static
8791
}
8892
process
8993
{
@@ -114,6 +118,7 @@
114118
if ($boundEnum -and ($Enum -ne $type.IsEnum)) { continue }
115119
if ($InheritsFrom -and ($type.BaseType.FullName -notlike $InheritsFrom)) { continue }
116120
if ($Attribute -and ($type.CustomAttributes.AttributeType.Name -notlike $Attribute)) { continue }
121+
if ($boundStatic -and -not($type.IsAbstract -and $type.IsSealed)) { continue }
117122

118123
$type
119124
}
@@ -123,4 +128,4 @@
123128
{
124129

125130
}
126-
}
131+
}

0 commit comments

Comments
 (0)