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
# Retrieves the size of a file on disk | |
# | |
# Adapted from Kim Doan's original script here: | |
# https://kimconnect.com/powershell-get-size-on-disk-of-files-in-windows/ | |
# | |
# Note: This assumes that the filesystem type is NTFS | |
# and that the cluster size is 4KB | |
[cmdletbinding()] | |
param( |
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
# Not mine, found on the interwebs. Please don't ask me to make it pretty. | |
function DisableService([System.ServiceProcess.ServiceController]$svc) | |
{ Set-Service -Name $svc.Name -StartupType Disabled } | |
function EnableServiceAuto([System.ServiceProcess.ServiceController]$svc) | |
{ Set-Service -Name $svc.Name -StartupType Automatic } | |
function StopService([System.ServiceProcess.ServiceController]$svc) | |
{ |
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
function Write-Log($msg) { Write-Host $msg -ForegroundColor Yellow } | |
Write-Log "Checking for metered network connections..." | |
[int]$MeteredAdapterCount = 0 | |
$UserCostEnum = @{ | |
0 = "Metering Disabled" | |
2 = "Metering Enabled" | |
} | |
#region Data Usage Service |
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
# Note: This is incomplete / WIP | |
# Last updated: 10/11/2022 | |
# Disable ModemManager because a) it's buggy and b) modems in a laptop are crap and I'd rather hotspot from a phone | |
sudo systemctl disable ModemManager.service | |
sudo systemctl stop ModemManager.service | |
# ***TODO: Disable NetworkManager and replace with iwd |