Instead of typing all of the commands required to instantiate the Exchange service object, it makes much more sense to put this code into a reusable function. Call AutoDiscover, create the email message object, and set all of the required properties. Consider the following example:
function Send-EWSMailMessage { param( [Parameter( Position=0, Mandatory=$true, ValueFromPipelineByPropertyName=$true )] [String[]] $PrimarySmtpAddress, [Parameter( Position=1, Mandatory=$true )] [String] $From, [Parameter( Position=2, Mandatory=$true )] [String] $Subject, [Parameter( Position=3, Mandatory=$true )] [String] $Body, [Parameter( Position=4, Mandatory=$false )] [String[]] $Cc, [Parameter( Position=5, Mandatory=$false )] [String[]] $Bcc ...