79669226

Date: 2025-06-17 14:07:45
Score: 1
Natty:
Report link

Change your parameter type to object instead of psobject. That way PowerShell won't try to loop over the contents during validation.

function testme {
    param(
        [ValidateScript({ $_ -is [array] -or $_ -is [hashtable] })]
        [object]$args
    )
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: OUTATIME121GW