Skip to content

Instantly share code, notes, and snippets.

View go2tom42's full-sized avatar

tom42 go2tom42

  • Earth
View GitHub Profile
@go2tom42
go2tom42 / StartMeUp.ps1
Last active February 16, 2024 01:15
StartMeUp
param(
[string]$a
)
Set-Location $env:userprofile
Set-executionpolicy -Force -executionpolicy unrestricted;[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Install-PackageProvider -Name NuGet -Force;
New-PSDrive -Name "Z" -PSProvider "FileSystem" -Root "\\192.168.1.75\share" -Persist
Install-Module -Name tom42tools -Force -AllowClobber;
Import-Module -Name tom42tools -Force;
@go2tom42
go2tom42 / ps1
Last active February 3, 2024 04:03
sandbox start
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
$passThruArgs = "-NoProfile -ExecutionPolicy Bypass -NoExit -Command `"cd \`"$pwd\`"; & \`"$PSCommandPath\`""
if ([Environment]::CommandLine -match [regex]::Escape($passThruArgs)) {
throw "You entered non-admin credentials. Please try again with admin credentials."
}
Start-Process -Verb RunAs PowerShell $passThruArgs
exit
}
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Did you know you can install fonts without elevation?

The catch is that they're only available for the duration of your session. They are, however, available in all apps across the system.

Someone asked about how to do it on Facebook this week, and at first, I just pointed them at the install script for PowerLineFonts which loops through all the fonts in a folder and install them.

I've used this more than a few times to install some fonts, including the PowerLine ones, which are great:

$sa = New-Object -ComObject Shell.Application
@go2tom42
go2tom42 / FONToMASS.ps1
Created January 26, 2023 21:56
FONToMASS downloader
#CHANGE⌄
$pages = 869
#CHANGE^
# DON'T CHANGE⌄
Function Get-RedirectedUrl {
Param (
[Parameter(Mandatory = $true)]
[String]$URL