Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to use new network tester method #99

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

1 participant