Public/Utilities/IsTestableAttribute.ps1
# custom attributes derive from the type "Attribute": class IsTestableAttribute : Attribute { [String]$SettingsNameValue = "Default" [Boolean]$IsContinuousValue = $false # field becomes an optional named argument later: [int]$Level = 0 # field becomes an optional named argument later: [bool]$IsParam = $false # constructor with one argument, # this argument becomes a mandatory positional argument later: IsTestableAttribute(){ $this.SettingsNameValue = "Default" $this.IsContinuousValue = $false } IsTestableAttribute([String]$SettingsName) { $this.SettingsNameValue = $SettingsName $this.IsContinuousValue = $false } IsTestableAttribute([String]$SettingsName, [Boolean]$IsContinuous) { $this.SettingsNameValue = $SettingsName $this.IsContinuousValue = $IsContinuous } IsTestableAttribute([Boolean]$IsContinuous) { $this.IsContinuousValue = $IsContinuous $this.SettingsNameValue = "Default" } } |