This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install all Windows updates | |
function Install-PSModule { | |
param( | |
[Parameter(Position = 0, Mandatory = $true)] | |
[String[]]$Modules | |
) | |
Write-Output "`nChecking for necessary PowerShell modules..." | |
try { | |
# Set PowerShell to TLS 1.2 (https://devblogs.microsoft.com/powershell/powershell-gallery-tls-support/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cleans up default start menu and taskbar (some settings require Windows Pro) | |
function Install-PSModule { | |
param( | |
[Parameter(Position = 0, Mandatory = $true)] | |
[String[]]$Modules | |
) | |
Write-Output "`nChecking for necessary PowerShell modules..." | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Runs an update check for Microsoft Store apps | |
###Requires -RunSilent | |
$namespaceName = "root\cimv2\mdm\dmmap" | |
$className = "MDM_EnterpriseModernAppManagement_AppManagement01" | |
$wmiObj = Get-WmiObject -Namespace $namespaceName -Class $className | |
$result = $wmiObj.UpdateScanMethod() | |
if ($result.ReturnValue -ne 0) { $result } | |
else { Write-Output 'Microsoft Store update scan started.' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove unnecessary packages | |
$Allowlist = @( | |
'DellCommandUpdate', # Dell Command Update app | |
'HPPrinterControl' # HP Smart app | |
) | |
$Identifiers = @( | |
'AcerIncorporated', # Acer Identifier | |
'AD2F1837', # HP Identifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Removes Microsoft Silverlight (x32 & x64) | |
$Paths = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall' | |
$App = Get-ChildItem -Path $Paths | Get-ItemProperty | Where-Object { $_.DisplayName -like 'Microsoft Silverlight' } | Select-Object | |
foreach ($Ver in $App) { | |
if ($Ver.UninstallString) { | |
$DisplayName = $Ver.DisplayName | |
$Uninst = $Ver.PSChildName | |
Write-Output "Uninstalling $DisplayName..." | |
cmd /c msiexec.exe /qn /uninstall $Uninst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check for required PowerShell version (7+) | |
if (!($PSVersionTable.PSVersion.Major -ge 7)) { | |
try { | |
# Install PowerShell 7 if missing | |
if (!(Test-Path "$env:SystemDrive\Program Files\PowerShell\7")) { | |
Write-Output 'Installing PowerShell version 7...' | |
Invoke-Expression "& { $(Invoke-RestMethod https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[string[]]$Admins = @() | |
) | |
$Admins += @( | |
# Enter your admin users here as follows: | |
# "$env:computername\AdminUser1", | |
# 'DOMAIN\AdminUser2', | |
# 'AzureAD\AdminUser3' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Manage Windows Defender Exclusions | |
param ( | |
[switch]$Audit, # Audit exclusions | |
[string[]]$ASR, # Exclude files/paths from ASR rules | |
[string[]]$Ext, # Exclude file extensions (Example: exe, txt, pdf) | |
[string[]]$IP, # Exclude IP addresses | |
[string[]]$Path, # Exclude paths | |
[string[]]$Process, # Exclude processes | |
[switch]$Remove # Remove exclusions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Runs a Windows Defender Scan | |
param( | |
[ValidateSet('Full', 'Quick', 'Offline', IgnoreCase)] | |
[string]$Type = 'Quick', # Scan type (defaults to quick scan) | |
[System.IO.FileInfo]$Path # Optional local path to scan | |
) | |
# Format type parameter | |
$Type = (Get-Culture).TextInfo.ToTitleCase($Type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Manage Windows Defender & Windows Firewall via Local Group Policy | |
$ComputerPolicyFile = ($env:SystemRoot + '\System32\GroupPolicy\Machine\registry.pol') | |
$DefenderKey = 'Software\Policies\Microsoft\Windows Defender' | |
$FirewallKey = 'Software\Policies\Microsoft\WindowsFirewall' | |
$ExploitGuardKey = 'Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard' | |
Write-Output "`nChecking for necessary PowerShell modules..." | |
try { | |
# Set PowerShell to TLS 1.2 (https://devblogs.microsoft.com/powershell/powershell-gallery-tls-support/) | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
NewerOlder