From c54a2a928e25b205d71df2d7656ee005f9f4f18d Mon Sep 17 00:00:00 2001 From: Andrew Stowell Date: Thu, 21 Sep 2023 17:42:30 -0400 Subject: [PATCH] optional input was defaulting to blank string, so checking against null was not working, fixed. --- Dynv6.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dynv6.ps1 b/Dynv6.ps1 index 46a577c..5d0c562 100644 --- a/Dynv6.ps1 +++ b/Dynv6.ps1 @@ -59,8 +59,8 @@ param( [string] $token = $(throw "-token is required"), [string] $netmask = "128", [string] $logfile = "$env:USERPROFILE\\.dynv6.log", - [string] $ipv4 = $null, - [string] $ipv6 = $null + [string] $ipv4 = "", + [string] $ipv6 = "" ) # we store ip addresses in files, so we only update when there is a change @@ -88,12 +88,12 @@ $update6 = [System.Uri]'https://dynv6.com/api/update' Get-Date | Tee-Object -FilePath $logfile -Append | Out-Host # lookup IPv4, will be skipped if variable already set -if ($ipv4 -eq $null) { +if ($ipv4 -eq "") { $ipv4 = Invoke-RestMethod -Method Get -Uri $lookup4 } # lookup IPv6, will be skipped if variable already set -if ($ipv6 -eq $null) { +if ($ipv6 -eq "") { $ipv6 = Invoke-RestMethod -Method Get -Uri $lookup6 }