Skip to content

Instantly share code, notes, and snippets.

View Jawabiscuit's full-sized avatar
👾

Jonas Avrin Jawabiscuit

👾
  • Greater NYC Metropolitan
View GitHub Profile
<#
.Description
Remove all non-whitelisted apps that come installed in Windows 10 by default.
Warning: Test first, and only run on a fresh install otherwise some changes may be irreversible.
Meant for developers that want a lean system to work with or test on.
.Example
1) Download this gist
2) Open Powershell as Administrator
3) `Set-ExecutionPolicy AllSigned -Force` to enable executing scripts
4) Set `$Path = <path-to-downloaded-script>` in powershell
@Jawabiscuit
Jawabiscuit / win10-iss.preset
Last active December 30, 2020 16:40
My preset for Disassembler0's Win10-Initial-Setup-Script
##########
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Default preset
# Author: Disassembler <[email protected]>
# Version: v3.10, 2020-07-15
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
##########
### Require administrator privileges ###
RequireAdmin
@Jawabiscuit
Jawabiscuit / win10-iss.ps1
Last active December 30, 2020 17:06
Download the archive and run Disassembler0's Win10 Initial Setup Script with preset.
<#
Win10 Initial Startup Script
.Description
Download git archive and preset file and run script to setup a new Windows 10 install.
See https://github.com/Disassembler0/Win10-Initial-Setup-Script
.Example
1) Open powershell as administrator
2) `Set-ExecutionPolicy AllSigned -Force` to allow execution of scripts
3) Find the raw URL to this gist
@Jawabiscuit
Jawabiscuit / extract-win10-wim-from-esd-with-dism.txt
Last active November 10, 2021 02:12
Extract Window 10 Pro 20H2 image from the Media Creation Tool using dism.exe
PS C:\WINDOWS\system32> dism.exe /Get-WimInfo /WimFile:F:\sources\install.esd
Deployment Image Servicing and Management tool
Version: 10.0.19035.1
Details for image : F:\sources\install.esd
Index : 1
Name : Windows 10 Home
Description : Windows 10 Home
@Jawabiscuit
Jawabiscuit / code_question_answers.py
Created March 19, 2021 16:53
Code question answers
"""
This is my really awesome module!
Examples
--------
>>> flatten_list([[1, 2, [3, 4], 5]])
... [1, 2, 3, 4, 5]
>>> tt = TempTracker()
@Jawabiscuit
Jawabiscuit / setup-powershell-console-dracula.ps1
Last active December 28, 2021 03:55
Setup Powershell console with dracula theme.
###################################################################################################
### PowerShell console with dracula theme ###
### - Run this script ###
### - Double-check "Windows PowerShell.lnk" and "Windows PowerShell (x86).lnk" get overwritten ###
### Prerequisites ###
### 1. PSReadLine 2.0 or later, Windows comes with 1.0 installed as of 2021/12 ###
### 2. posh-git for git integration ###
### More Details ###
### - https://github.com/dracula/powershell/blob/master/theme/dracula-prompt-configuration.ps1 ###
### - https://github.com/dracula/powershell#user-content-profile-explanation ###
@Jawabiscuit
Jawabiscuit / change-windows-drive-letters.ps1
Last active December 28, 2021 16:37
Change drive letters on Windows
# Change drive letters and labels on Windows using powershell
# On a new install, Windows maps drives somewhat randomly
# Details: https://devblogs.microsoft.com/powershell-community/changing-drive-letters-and-labels-via-powershell/
$Drive = Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'D:'"
$Drive | Set-CimInstance -Property @{DriveLetter='M:'; Label='Media'}
$Drive = Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'E:'"
$Drive | Set-CimInstance -Property @{DriveLetter='S:'; Label='Storage'}
@Jawabiscuit
Jawabiscuit / KnownFolderPath.ps1
Last active March 23, 2022 02:21 — forked from YoraiLevi/KnownFolderPathPS5.ps1
Change windows user folders with powershell
<#
.SYNOPSIS
Sets a known folders path using SHSetKnownFolderPath.
.PARAMETER Folder
The known folder whose path to set.
.PARAMETER Path
The path.
#>
function Set-KnownFolderPath {
Param (
@Jawabiscuit
Jawabiscuit / DumpCMakeVars.cmake
Created February 8, 2022 14:01
Prints all cmake variables or variables that match a regex.
# https://stackoverflow.com/a/9328525
function(dump_cmake_variables)
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
if (ARGV0)
unset(MATCHED)
string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
if (NOT MATCHED)
continue()
@Jawabiscuit
Jawabiscuit / Install-Winget.ps1
Last active March 21, 2022 01:40
Install winget package manager and dependencies
# Install Winget package manager
# Dependencies
# https://docs.microsoft.com/en-us/troubleshoot/developer/visualstudio/cpp/libraries/c-runtime-packages-desktop-bridge#how-to-install-and-update-desktop-framework-packages
$PackageName = "Microsoft.VCLibs.x64.14.00.Desktop.appx"
$DependencyUrl = "https://aka.ms/${PackageName}"
Invoke-WebRequest -Uri $DependencyUrl -OutFile (Join-Path $env:TEMP $PackageName)
Add-AppxPackage -Path (Join-Path $env:TEMP $PackageName)
# Download/Install winget