If you get this error:
Measure.count : The term 'Measure.count' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:15
+ $Recipients | Measure.count
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Measure.count:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I had to modify the line in script from:
# Get the object count and write it out to be used in esitmated time to completion + logging
[int]$ObjectCount = $Recipients.count
[int]$ObjectsProcessed = 0
To this
# Get the object count and write it out to be used in esitmated time to completion + logging
[int]$ObjectCount = @($Recipients).count
[int]$ObjectsProcessed = 0