mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-07 13:34:55 -06:00
30 lines
1.1 KiB
PowerShell
30 lines
1.1 KiB
PowerShell
function Invoke-WPFFixesNetwork {
|
|
<#
|
|
|
|
.SYNOPSIS
|
|
Resets various network configurations
|
|
|
|
#>
|
|
|
|
Write-Host "Resetting Network with netsh"
|
|
|
|
# Reset WinSock catalog to a clean state
|
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winsock", "reset"
|
|
# Resets WinHTTP proxy setting to DIRECT
|
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "winhttp", "reset", "proxy"
|
|
# Removes all user configured IP settings
|
|
Start-Process -NoNewWindow -FilePath "netsh" -ArgumentList "int", "ip", "reset"
|
|
|
|
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)
|
|
Write-Host "=========================================="
|
|
Write-Host "-- Network Configuration has been Reset --"
|
|
Write-Host "=========================================="
|
|
}
|