powershell function 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.
# Powershell processes in order (top-down),
# so the function definition needs to be before the function call:
function email($text){
#email $text
}
#Do things |
foreach{
email($_)
}