From d21a06424b976fc2513c2032cfdbde4ac3d339d4 Mon Sep 17 00:00:00 2001 From: Padsala Tushal <57517785+padsalatushal@users.noreply.github.com> Date: Wed, 17 May 2023 22:43:53 +0530 Subject: [PATCH] add reset network with netsh (#768) --- functions/public/Invoke-WPFButton.ps1 | 1 + functions/public/Invoke-WPFFixesNetwork.ps1 | 11 +++++++++++ winutil.ps1 | 19 ++++++++++++++++--- xaml/inputXML.xaml | 1 + 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 functions/public/Invoke-WPFFixesNetwork.ps1 diff --git a/functions/public/Invoke-WPFButton.ps1 b/functions/public/Invoke-WPFButton.ps1 index a140f99a..536d9c3a 100644 --- a/functions/public/Invoke-WPFButton.ps1 +++ b/functions/public/Invoke-WPFButton.ps1 @@ -45,6 +45,7 @@ function Invoke-WPFButton { "WPFPaneluser" {Invoke-WPFControlPanel -Panel $button} "WPFUpdatesdefault" {Invoke-WPFUpdatesdefault} "WPFFixesUpdate" {Invoke-WPFFixesUpdate} + "WPFFixesNetwork" {Invoke-WPFFixesNetwork} "WPFUpdatesdisable" {Invoke-WPFUpdatesdisable} "WPFUpdatessecurity" {Invoke-WPFUpdatessecurity} "WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil"} diff --git a/functions/public/Invoke-WPFFixesNetwork.ps1 b/functions/public/Invoke-WPFFixesNetwork.ps1 new file mode 100644 index 00000000..980c67bf --- /dev/null +++ b/functions/public/Invoke-WPFFixesNetwork.ps1 @@ -0,0 +1,11 @@ +function Invoke-WPFFixesNetwork { + <# + + .DESCRIPTION + PlaceHolder + + #> + Write-Host "Reseting Network with netsh" + netsh int ip reset + netsh winsock reset +} \ No newline at end of file diff --git a/winutil.ps1 b/winutil.ps1 index ef0239c1..f21ef454 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,7 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 23.05.16 + Version : 23.05.17 #> Start-Transcript $ENV:TEMP\Winutil.log -Append @@ -21,7 +21,7 @@ Add-Type -AssemblyName System.Windows.Forms # variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "23.05.16" +$sync.version = "23.05.17" $sync.configs = @{} $sync.ProcessRunning = $false Function Get-WinUtilCheckBoxes { @@ -871,6 +871,7 @@ function Invoke-WPFButton { "WPFPaneluser" {Invoke-WPFControlPanel -Panel $button} "WPFUpdatesdefault" {Invoke-WPFUpdatesdefault} "WPFFixesUpdate" {Invoke-WPFFixesUpdate} + "WPFFixesNetwork" {Invoke-WPFFixesNetwork} "WPFUpdatesdisable" {Invoke-WPFUpdatesdisable} "WPFUpdatessecurity" {Invoke-WPFUpdatessecurity} "WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil"} @@ -966,6 +967,17 @@ function Invoke-WPFFeatureInstall { [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon) } } +function Invoke-WPFFixesNetwork { + <# + + .DESCRIPTION + PlaceHolder + + #> + Write-Host "Reseting Network with netsh" + netsh int ip reset + netsh winsock reset +} function Invoke-WPFFixesUpdate { <# @@ -2332,6 +2344,7 @@ $inputXML = '