Functions/Public/Disconnect-WiFi.ps1
function Disconnect-WiFi { [CmdletBinding()] param ( [string] $Interface ) $Command = 'netsh wlan disconnect' switch ($true) { $Interface { $Command += ' interface="{0}"' -f $Interface } } Invoke-Expression -Command $Command Write-Verbose -Message 'Disconnected WiFi' } |