I have a server where I create a certain type of files that I have to send by email on a daily basis to the same email receiver. Sending an email with Powershell is not complicated, just use Send-MailMessage. But since I had to do this a lot, I decided to create a function to do this job including a search window to find and attach the file. I added the following function to my PowerShell profile: #Send email with Attachment(s) Function Send-CustomMailMessage { [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null $FileLocation = New-Object System.Windows.Forms.OpenFileDialog $FileLocation.initialDirectory = 'd:\' #Or any other location $FileLocation.Multiselect = $true $Dialog = $FileLocation.ShowDialog() If ($Dialog -eq 'Cancel') { Return #End Function ...