I have a script that accepts one or more subdomains, I want to validate them but [ValidatePattern()] seems to only check the first item in the array.
The code:
param(
[ValidatePattern('\w*\.domain\.com')][string]$subdomain
)
This input gets accepted:
.\script.ps1 -subdomain "test.domain.com", "randomstring"
Is there a way to validate every entry in the array?