January 8, 2023

Powershell - Find My Ip Address

Clear
$currIpAddress = (Invoke-WebRequest -uri https://ifconfig.me/ip).Content
$prevIpAddress = "155.171.12.2"
Write-Output ""
Write-Output "My current  IP address: $($currIpAddress)"
Write-Output "My previous IP address: $($prevIpAddress)"
Write-Output "if it changes, re-run ~\Scripts\IpRestrictionTool\allow-my-ip.ps1"

No comments: