(Get-PSReadlineOption).HistorySavePath
or
Get-Content (Get-PSReadlineOption).HistorySavePath | more
or
notepad (Get-PSReadlineOption).HistorySavePath
(Get-PSReadlineOption).HistorySavePath
or
Get-Content (Get-PSReadlineOption).HistorySavePath | more
or
notepad (Get-PSReadlineOption).HistorySavePath
$Recipient = "contact@domain.com"
$Subject = "Hello, World!"
$Body = "This is the body of the email."
$credentials = Get-Credential
Send-MailMessage -To $Recipient -Subject $subject -Body $body -From $credentials.UserName -SmtpServer "smtp.office365.com" -Port 587 -UseSsl -Credential $credentials
-----------------
Using saved/exported password:
# $credentials.Password | ConvertFrom-SecureString | out-file L:\Downloads\senha.sec
$sen = Get-Content L:\Downloads\senha.sec | ConvertTo-SecureString
$us = "sender@mydomain.com"
$em = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $us,$sen
Send-MailMessage -To $Recipient -Subject $subject -Body $body -From $us -SmtpServer "smtp.office365.com" -Port 587 -UseSsl -Credential $em
openssl pkcs12 -export -out cert.pfx -inkey private.key -in cert.crt -certfile CACert.crt
List Checkpoint, Configuration and Snapshot File Locations:
get-vm | select id,name,*location | ft -AutoSize
List the HardDrives attached into the Virtual Machines
get-vm | Get-VMHardDiskDrive | sort Path | select vmname,Path
fsutil file createnew c:\filess\FILE19.xlsx 1909900
$file = "c:\filess\FILE19.xlsx"
$mn = 2
do {
$id = "$mn"+' - Test Message #'+$mn
$id
$mn--
(Get-Mailbox zez*) | % {Send-MailMessage -SmtpServer (Get-ExchangeServer).Fqdn -To $_.primarysmtpaddress -From admin@domain.com -Subject $id -Body "ATTACHMENT TO FILL UP THE MAILBOX" -attachment $file}
}while($mn -gt '0')
start-transcript
$syncstats = Get-SyncRequestStatistics user@domain.com -IncludeReport -DiagnosticInfo verbose
$syncstats.Report.Failures | group failuretype
$syncstats.Report.Failures | select -last 2
$syncstats.Report.InternalFailures
$syncstats.DiagnosticInfo
$syncstats.Report.Entries | % {[string] $_}
stop-transcript
=LEFT(B2,LEN(B2)-2)/10^((MATCH(RIGHT(B2,2),{"PB","TB","GB","MB","KB"},0)-3)*3)
to MB, handling error
=IFERROR(LEFT(D2,LEN(D2)-2)/10^((MATCH(RIGHT(D2,2),{"PB","TB","GB","MB","KB"},0)-4)*3),0)