DEV Community

Discussion on: Write a simple but impactful script

Collapse
 
rafd123 profile image
Rafael Dowling Goodman • Edited

PowerShell

0..9999 | % { $_ -f 'D4' } | sort { Get-Random } > leaked_pins.txt

Send-MailMessage `
    -From 'me@fabrikam.com' `
    -To 'coworker@fabrikam.com' `
    -Subject 'These PIN numbers have been leaked' `
    -Body 'You should check whether your pin is in the file or not.' `
    -Attachments 'leaked_pins.txt' `
    -SmtpServer 'smtp.fabrikam.com'