Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Project/Send_MailKitMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ public class Send_MailKitMessage : PSCmdlet
Mandatory = false)]
public string[] AttachmentList { get; set; }

[Parameter(
Mandatory = false)]
public string OutMessageVariable { get; set; }

// This method gets called once for each cmdlet in the pipeline when the pipeline starts executing
protected override void BeginProcessing()
{
Expand Down Expand Up @@ -162,6 +166,12 @@ protected override void ProcessRecord()
}
Client.Send(Message);

//output
if (!string.IsNullOrWhiteSpace(OutMessageVariable))
{
this.SessionState.PSVariable.Set(OutMessageVariable, Message);
}

}
catch (Exception e)
{
Expand Down