Skip to content

Commit

Permalink
Update Get-PublicIP
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Sep 8, 2023
1 parent a4d2ae1 commit b0b690a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/PublicIP/PublicIP.psm1
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Function Get-PublicIP {
#Invoke-RestMethod -Uri https://api.myip.com/
Invoke-RestMethod -Uri https://ipinfo.io/json
$script:providerMap = @{
MyIP = 'https://api.myip.com/'
IPInfo = 'https://ipinfo.io/json'
}

Function Get-PublicIP {
param(
[Parameter(Mandatory = $false)]
[ValidateScript({$providerMap.Keys})]
$Provider = 'IPInfo'
)

Invoke-RestMethod -Uri $providerMap[$Provider]
}

Function Get-IPConfig {
Expand Down

0 comments on commit b0b690a

Please sign in to comment.