Public/Reset-NetworkAdapter.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function Reset-NetworkAdapter {

    <#
    .DESCRIPTION
    Reset a specified interface

    .Parameter Interface
    Interface to be disabled and enabled

    .EXAMPLE
    Reset-NetworkAdapter -interface "Local Area Connection"

    .Link
    Reset-NetworkStack
    #>


    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]$Interface
    )

    #Check For Admin Privleges
    Get-Elevation

    netsh.exe interface set interface $Interface admin=disable
    netsh.exe interface set interface $Interface admin=enable
}