Fix infinite loop in PowerShell script: Rename function to avoid collision

- Rename Test-Connection function to Test-NetworkConnection
- Fix PowerShell function name collision with built-in cmdlet
- Use fully qualified names for PowerShell Test-Connection cmdlet
- Resolves infinite recursion in network verification

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
시골약사 2025-09-11 01:03:40 +09:00
parent 176c6bb1c2
commit bd33604982

View File

@ -85,7 +85,7 @@ function Test-Requirements {
# Check internet connection # Check internet connection
try { try {
Test-Connection "8.8.8.8" -Count 1 -Quiet | Out-Null Microsoft.PowerShell.Management\Test-Connection "8.8.8.8" -Count 1 -Quiet | Out-Null
} }
catch { catch {
Write-Warning "Please check your internet connection." Write-Warning "Please check your internet connection."
@ -295,7 +295,7 @@ function Configure-Firewall {
# ================================ # ================================
# Verify Connection # Verify Connection
# ================================ # ================================
function Test-Connection { function Test-NetworkConnection {
Write-Status "Verifying network connection..." Write-Status "Verifying network connection..."
Start-Sleep -Seconds 5 Start-Sleep -Seconds 5
@ -333,7 +333,7 @@ function Test-Connection {
Write-Status "Testing network connectivity..." Write-Status "Testing network connectivity..."
try { try {
Test-Connection "100.64.0.1" -Count 2 -Quiet | Out-Null Microsoft.PowerShell.Management\Test-Connection "100.64.0.1" -Count 2 -Quiet | Out-Null
Write-Success "FARMQ network ($FarmqNetwork) connection successful!" Write-Success "FARMQ network ($FarmqNetwork) connection successful!"
} }
catch { catch {
@ -433,7 +433,7 @@ function Main {
if ($registerSuccess) { if ($registerSuccess) {
Configure-Firewall Configure-Firewall
Test-Connection Test-NetworkConnection
Complete-Installation Complete-Installation
Show-FinalInfo Show-FinalInfo
} else { } else {