Checking to see if PowerShell Command worked, Crap Error

by MrAdmin   Last Updated August 13, 2019 19:26 PM

Needed to clean up a winmail.dat issue by adding a contact and setting a couple of parameters. All worked as shown, except the command to test that it worked.

Select-Object : A parameter cannot be found that matches parameter name 'UseMapiRichTextFormat'. At line:1 char:62 + ... t 1 Select [email protected] 1 Select -UseMapiRichTextFormat + ---------------------- + CategoryInfo : InvalidArgument: (:) [Select-Object], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SelectObjectCommand

What is the reason for this failure?

Get-MailContact | Select [email protected] | Select -UseMapiRichTextFormat
Tags : powershell


Answers 1


I think what you actually need is this:

Get-MailContact | 
    Where-Object {$_.ExternalEmailAddress -eq '[email protected]'} | 
    Select-Object -Property UseMapiRichTextFormat

Where-Object limits the result set by comparing each contact's ExternalEmailAddress property and only including the objects that match in the output (which should only be one)

Select-Object limits the output object members to a subset of the original members

Mason Schmidgall
Mason Schmidgall
August 13, 2019 19:18 PM

Related Questions


Updated June 22, 2018 01:26 AM

Updated November 28, 2018 14:26 PM

Updated July 08, 2017 02:26 AM

Updated May 14, 2018 03:26 AM