Check Public IP with PowerShell Script

A straightforward PowerShell script that lets you quickly determine your current public IP address in a simple and hassle-free way.

Click to view script…
# Get-PublicIP.ps1
# This script retrieves and displays your public IP address

# Query the API to get your public IP address in JSON format.
$response = Invoke-RestMethod -Uri "https://api.ipify.org?format=json"

# Display the IP address.
Write-Host "Your public IP address is: $($response.ip)"