Summary
PropertySet.AddProperty calls $this.Properties.Add($Property) with a single argument. Hashtable.Add requires two arguments (key, value). This throws at runtime. The method has never been successfully invoked.
File
Gatekeeper/Classes/Property.ps1:148-151
Reproduction
$ps = [PropertySet]::new('Test')
$prop = [PropertyDefinition]::new('Env', @{ Type = 'string' })
$ps.AddProperty($prop)
# Throws: Method invocation failed because [System.Collections.Hashtable] does not
# contain a method named 'Add' with 1 argument
Fix
[PropertySet]AddProperty([PropertyDefinition]$Property) {
$this.Properties.Add($Property.Name, $Property) # was: .Add($Property)
return $this
}
Notes
- Good first issue — single-line fix
- Found by Jordan B., Sage Nakamura, Chip Torres, and Glenn
Summary
PropertySet.AddPropertycalls$this.Properties.Add($Property)with a single argument.Hashtable.Addrequires two arguments (key, value). This throws at runtime. The method has never been successfully invoked.File
Gatekeeper/Classes/Property.ps1:148-151Reproduction
Fix
Notes