View send-myip-gmail.ps1
# Quick powershell script to :
# Get the IPv4 and send it using gmail smtp server. Handy when there is no local SMTP server available
# !! Warning !! You need to provide your credentials in plain text ...
$date = (get-date).ToString()
# Get IPv4. Quick filter with -like "1*" to exclude IPv6. There should be a better way to do it ...
$IP = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -filter "ipenabled=true" |
Where { $_.IPAddress -like "1*"} |
Select -ExpandProperty IPAddress | select -First 1