PowerShell Flashcards
1
Q
How to use credentials in Powershell?
A
$User = "username" $Password = ConvertTo-SecureString -string "password123" -AsPlainText -Force $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $Password
2
Q
How to send email in Powershell
A
Send-MailMessage -SmtpServer “emai-smtp.eu-central-1.amazonaws.com” -Port 587 -Credential $credential -From “noreply@fleetcomplete.com” -to “xyz@fleetcomplete.com” -Subject “adasdasd” -UseSsl