Skip to content

Conversation

@Alan-Huntress
Copy link
Contributor

New network tester method is more compatible with legacy machines, this method was already present in our PoSh deploy it just hadn't been moved to this script yet.

New network tester method is more compatible with legacy machines, this method was already present in our PoSh deploy

# Convert from bytes, if necessary
if ($Response.Content.GetType() -eq [System.Byte[]]) {
$StrContent = [System.Text.Encoding]::UTF8.GetString($Response.Content)

Check warning

Code scanning / Psscriptanalyzer (reported by Codacy)

Line has trailing whitespace Warning

Line has trailing whitespace

# Remove all newlines from the content
$StrContent = [string]::join("",($StrContent.Split("`n")))

Check warning

Code scanning / Psscriptanalyzer (reported by Codacy)

Line has trailing whitespace Warning

Line has trailing whitespace

if ($StatusCode -ne 200) {
$err = "WARNING, connectivity to Huntress URL's is being interrupted. You MUST open port 443 for $($URL) in order for the Huntress agent to function."
LogMessage $err

Check warning

Code scanning / Psscriptanalyzer (reported by Codacy)

Line has trailing whitespace Warning

Line has trailing whitespace
$connectivityTolerance --
} elseif (!$ContentMatch) {
$err = "WARNING, successful connection to Huntress URL, however, content did not match expected. Ensure no proxy or content filtering is preventing access!"
LogMessage $err

Check warning

Code scanning / Psscriptanalyzer (reported by Codacy)

Line has trailing whitespace Warning

Line has trailing whitespace
if ($connectivityTolerance -lt 0) {
Write-Output "Please fix the closed port 443 for the above domains before attempting to install" -ForegroundColor white -BackgroundColor red
$err = "Too many connections failed $($connectivityTolerance), exiting"
LogMessage "$($err), $($SupportMessage)"

Check warning

Code scanning / Psscriptanalyzer (reported by Codacy)

Line has trailing whitespace Warning

Line has trailing whitespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants