$recipients = "Marcel <marcel@turie.eu>, Marcelt <marcel@nbs.sk>"
is type of string
you need pass to send-mailmessage
a string[]
type (an array):
[string[]]$recipients = "Marcel <marcel@turie.eu>", "Marcelt <marcel@nbs.sk>"
I think that not casting to string[] do the job for the coercing rules of powershell:
$recipients = "Marcel <marcel@turie.eu>", "Marcelt <marcel@nbs.sk>"
is object[]
type but can do the same job.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…