Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Functions/Update-GoogleDynamicDNS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ Function Update-GoogleDynamicDNS {
$params = @{}
$splitDomain = $domainName.split(".")

if ($splitDomain.Length -ne 2) {
if ($splitDomain.Length -lt 1) {
throw "Please enter a valid top-level domain name (yourdomain.tld)"
}

$subAndDomain = $subDomainName + "." + $domainName
$splitDomain = $subAndDomain.split(".")

if ($splitDomain.Length -ne 3) {
if ($splitDomain.Length -lt 1) {
throw "Please enter a valid host and domain name (subdomain.yourdomain.tld)"
}

Expand All @@ -95,7 +95,7 @@ Function Update-GoogleDynamicDNS {
}

if ($PSCmdlet.ShouldProcess("$subAndDomain","Adding IP")) {
$response = Invoke-WebRequest -uri $webRequestURI -Method Post -Body $params -Credential $credential
$response = Invoke-WebRequest -uri $webRequestURI -UseBasicParsing -Method Post -Body $params -Credential $credential
$Result = $Response.Content
$StatusCode = $Response.StatusCode
switch ($Result) {
Expand Down