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

Added check for Internet connectivity #504

Merged
merged 2 commits into from
Oct 12, 2023
Merged
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
17 changes: 17 additions & 0 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ if (-not $noChecks.IsPresent) {
Write-Host "`t[+] Hint: https://support.microsoft.com/en-us/windows/prevent-changes-to-security-settings-with-tamper-protection-31d51aaa-645d-408e-6ce7-8d7f8e593f87" -ForegroundColor Yellow
Write-Host "`t[+] Hint: https://www.tenforums.com/tutorials/123792-turn-off-tamper-protection-windows-defender-antivirus.html" -ForegroundColor Yellow
Write-Host "`t[+] Hint: https://github.com/jeremybeaume/tools/blob/master/disable-defender.ps1" -ForegroundColor Yellow
Write-Host "`t[+] Hint: https://lazyadmin.nl/win-11/turn-off-windows-defender-windows-11-permanently/" -ForegroundColor Yellow
Write-Host "`t[+] You are welcome to continue, but may experience errors downloading or installing packages" -ForegroundColor Yellow
Write-Host "`t[-] Do you still wish to proceed? (Y/N): " -ForegroundColor Yellow -NoNewline
$response = Read-Host
Expand Down Expand Up @@ -239,6 +240,22 @@ if (-not $noChecks.IsPresent) {
} else {
Write-Host "`t[+] Username '$extractedUsername' does not contain any spaces." -ForegroundColor Green
}

# Check Internet connectivity and return boolean value, exit if value is 'false'
Ana06 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be indented. But I think it is better to add a linter for this: #507

Write-Host "[+] Checking for Internet connectivity..."
$connectionStatus = Test-Connection github.com -Quiet
if ($connectionStatus -eq $false)
{
Write-Host "`t[!] Internet connectivity not detected" -ForegroundColor Red
Write-Host "`t[!] Exiting..." -ForegroundColor Red
Start-Sleep 3
exit 1
}
else
{
Write-Host "`t[+] Internet connectivity detected" -ForegroundColor Green
}

}

if (-not $noPassword.IsPresent) {
Expand Down