Tuesday, November 19, 2019

No Port Parameter in Send-MailMessage when trying to send mail

Send-Mail doesn't support this functionality till powershell version 3.

Source: Microsoft Documentation

Windows 7 comes with powershell version 2.

 $PSVERSIONTABLE

Name                           Value
----                           -----
CLRVersion                     2.0.50727.8806
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1


So, install it by using the WMF available at Link

At this link, you have two download option for build 6.0 and 6.1

You can check your build number using $PSVERSIONTABLE output above

In my machine, it shows 6.1.x so I used Windows6.1-KB2506143-x64.msu

Reference

No comments:

Post a Comment