mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-15 07:05:51 -06:00
74 lines
2.0 KiB
Markdown
74 lines
2.0 KiB
Markdown
|
# Reset Network
|
||
|
|
||
|
Last Updated: 2024-08-07
|
||
|
|
||
|
|
||
|
!!! info
|
||
|
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||
|
|
||
|
|
||
|
<!-- BEGIN CUSTOM CONTENT -->
|
||
|
|
||
|
<!-- END CUSTOM CONTENT -->
|
||
|
|
||
|
<details>
|
||
|
<summary>Preview Code</summary>
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"Content": "Reset Network",
|
||
|
"category": "Fixes",
|
||
|
"Order": "a042_",
|
||
|
"panel": "1",
|
||
|
"Type": "Button",
|
||
|
"ButtonWidth": "300",
|
||
|
"link": "https://christitustech.github.io/winutil/dev/features/Fixes/Network"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
</details>
|
||
|
|
||
|
## Function: Invoke-WPFFixesNetwork
|
||
|
|
||
|
```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 "=========================================="
|
||
|
}
|
||
|
|
||
|
```
|
||
|
|
||
|
|
||
|
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
||
|
|
||
|
<!-- END SECOND CUSTOM CONTENT -->
|
||
|
|
||
|
|
||
|
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/feature.json)
|
||
|
|