Nice! I didn't know about DefaultParameterSetName. Makes things much easier; thanks for sharing.
As a side note, when I was playing with string validation yesterday, I ran across this article http://blog.whatsupduck.net/2012/02/powershell-validatenotnullorempty-bug.html On Sat, Apr 13, 2013 at 8:15 PM, Ben Scott <mailvor...@gmail.com> wrote: > On Sat, Apr 13, 2013 at 7:17 PM, Michael B. Smith <mich...@smithcons.com> > wrote: > > What you are missing is the DefaultParameterSetName. > > Ahhh... that did it! Thanks for the clue! > > Finished code, for those so interested: > > http://pastebin.com/dQbDDqKN > > It even treats -mailTo as optional when -smtpHost is present (a > valid, albeit useless, scenario). > > > RTFM. :) > > > > Payette, Second Edition, section 8.2. > > My copy of Payette is at work on my desk, and was open during this > exercise. This is one of those "It's easy to find, if you know the > answer" situations. :-) > > Thanks again! > > -- Ben > > ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ > ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ > > --- > To manage subscriptions click here: > http://lyris.sunbelt-software.com/read/my_forums/ > or send an email to listmana...@lyris.sunbeltsoftware.com > with the body: unsubscribe ntsysadmin > ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to listmana...@lyris.sunbeltsoftware.com with the body: unsubscribe ntsysadmin