2023-07-13 15:46:00 -05:00
|
|
|
function Invoke-WPFFixesNetwork {
|
|
|
|
|
<#
|
2023-10-19 17:12:55 -05:00
|
|
|
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Resets various network configurations
|
|
|
|
|
|
2023-07-13 15:46:00 -05:00
|
|
|
#>
|
2023-07-15 10:42:11 -05:00
|
|
|
|
2023-08-02 19:43:52 -05:00
|
|
|
Write-Host "Resetting Network with netsh"
|
2023-10-19 17:12:55 -05:00
|
|
|
|
2025-06-26 20:35:03 +02:00
|
|
|
Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo"
|
2023-10-19 17:12:55 -05:00
|
|
|
# Reset WinSock catalog to a clean state
|
2023-07-15 10:42:11 -05:00
|
|
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winsock", "reset"
|
2025-06-26 20:35:03 +02:00
|
|
|
|
|
|
|
|
Set-WinUtilTaskbaritem -state "Normal" -value 0.35 -overlay "logo"
|
2023-10-19 17:12:55 -05:00
|
|
|
# Resets WinHTTP proxy setting to DIRECT
|
2023-07-15 10:42:11 -05:00
|
|
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winhttp", "reset", "proxy"
|
2025-06-26 20:35:03 +02:00
|
|
|
|
|
|
|
|
Set-WinUtilTaskbaritem -state "Normal" -value 0.7 -overlay "logo"
|
2023-10-19 17:12:55 -05:00
|
|
|
# Removes all user configured IP settings
|
2023-07-15 10:42:11 -05:00
|
|
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "int", "ip", "reset"
|
|
|
|
|
|
2025-06-26 20:35:03 +02:00
|
|
|
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
|
|
|
|
|
2023-07-15 10:42:11 -05:00
|
|
|
Write-Host "Process complete. Please reboot your computer."
|
|
|
|
|
|
|
|
|
|
$ButtonType = [System.Windows.MessageBoxButton]::OK
|
|
|
|
|
$MessageboxTitle = "Network Reset "
|
|
|
|
|
$Messageboxbody = ("Stock settings loaded.`n Please reboot your computer")
|
|
|
|
|
$MessageIcon = [System.Windows.MessageBoxImage]::Information
|
|
|
|
|
|
|
|
|
|
[System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
2023-10-19 17:12:55 -05:00
|
|
|
Write-Host "=========================================="
|
|
|
|
|
Write-Host "-- Network Configuration has been Reset --"
|
|
|
|
|
Write-Host "=========================================="
|
2024-08-06 23:35:17 +03:00
|
|
|
}
|