You have written a function, but you are trying to execute the .ps1 file. You need to load the function into powershell using dot sourcing as seen below and then use the function. Looking at "about_Scripts" for more information will help you understand it better.

Just save your script as myscript.ps1 and do the following.

# dot sourcing. Note the preceding . (dot) followed by a space and then the .ps1 script.
PS> . c:\myscript.ps1
# now the function is loaded into powershell and you should be able to use it.
PS> Get-ValidEmails -Inputfile "C:\Brightsideemails.csv" -outputfile "c:\brightsideValid.csv"