Skip to content

Cmdlets: Set -Subject parameter to non-mandatory on Send-MailMessage command - #4044

Closed
Trevor Sullivan (pcgeek86) wants to merge 1 commit into
PowerShell:masterfrom
pcgeek86:patch-1
Closed

Trevor Sullivan (pcgeek86) wants to merge 1 commit into
PowerShell:masterfrom
pcgeek86:patch-1

Conversation

@pcgeek86

Copy link
Copy Markdown

Fixes #4043

Cheers,
Trevor Sullivan

@pcgeek86

Copy link
Copy Markdown
Author

@SteveL-MSFT

Copy link
Copy Markdown
Member

Should it output a warning if no subject?

@pcgeek86

Copy link
Copy Markdown
Author

Hmm, good thought but my vote would be no.

@BitteringAgent

Copy link
Copy Markdown

Now that I think about it. It should work like any other email application where there is a warning for no subject. So there should be a warning, but also there should be a -Force to push past the warning of having no subject.

@SteveL-MSFT

Copy link
Copy Markdown
Member

Aubrey Nicklaus (@BitteringAgent) -force wouldn't be needed as a warning is just informational

@BitteringAgent

Copy link
Copy Markdown

Ah, I haven't dealt with too many cmdlets with warnings other than maybe doing a remote session into Exchange Online. Thanks.

@iSazonov

Copy link
Copy Markdown
Collaborator

Missing Subject is a very bad practice. By default, we must ask for it to present. Maybe add -IgnoreSubject?

@SteveL-MSFT

Copy link
Copy Markdown
Member

Another option is to prompt and allow -force

@TravisEz13

Copy link
Copy Markdown
Member

restarted mac tests due to random failure.

@TravisEz13

Copy link
Copy Markdown
Member

I agree with Ilya (@iSazonov) , but prefer Steve Lee (@SteveL-MSFT) 's proposal to fix the issue.

@iSazonov

Copy link
Copy Markdown
Collaborator

Trevor Sullivan (@pcgeek86) Could you please continue?

@dantraMSFT

Copy link
Copy Markdown
Contributor

I think a better user experience would be to leave Subject as mandatory and place it in a 'Subject' parameter set. Add a -NoSubject switch and place it in a 'NoSubject' parameter set, then set the default parameter set to 'Subject'.
This ensures the best practice is the default, avoids having to use an ambiguous -Force switch while still requiring an explicit choice to send without an subject.

@TravisEz13 Travis Plunk (TravisEz13) changed the title Set -Subject parameter to non-mandatory on Send-MailMessage command Cmdlets: Set -Subject parameter to non-mandatory on Send-MailMessage command Jan 3, 2018
@TravisEz13

Copy link
Copy Markdown
Member

Trevor Sullivan (@pcgeek86) comments haven't been addressed in a long time. At some point, if comments are not addressed, I'll close the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants