Skip to content

Instantly share code, notes, and snippets.

@Braytiner
Braytiner / Windows Defender Exclusions VS 2022.ps1
Last active June 21, 2024 13:29
Adds Windows Defender exclusions for Visual Studio 2022
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\Downloads\HeidiSQL_11.3_64_Portable') > $null
$pathExclusions.Add($userPath + '\.dotnet') > $null
@Albert221
Albert221 / ToggleEthernet.ps1
Created April 15, 2020 01:06
PowerShell script to toggle (enable/disable) Ethernet net adapter
# Run as administrator - https://stackoverflow.com/a/57035712/3158312
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process PowerShell -Verb RunAs "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
exit;
}
$adapterName = 'Ethernet'
$status = Get-NetAdapter -Name $adapterName | Format-List -Property "Status" | Out-String