Skip to content

Instantly share code, notes, and snippets.

@Nevember
Nevember / Light_Mode_Enable.xml
Last active October 24, 2022 09:35
Enable "Light Mode" at 6:30am daily using this Windows Task Scheduler XML file
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2022-10-23T19:30:00.0000000</Date>
<Author>SCI\SpiralChaotic</Author>
<URI>\SCI\LightModeEnable</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2022-10-23T06:30:00</StartBoundary>
@Nevember
Nevember / Dark_Mode_Enable.xml
Last active October 24, 2022 09:35
Enable "Dark Mode" at 6:30pm daily using this Windows Task Scheduler XML file
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2022-10-23T19:30:00.0000000</Date>
<Author>SCI\SpiralChaotic</Author>
<URI>\SCI\DarkModeEnable</URI>
</RegistrationInfo>
<Triggers>
<CalendarTrigger>
<StartBoundary>2022-10-23T18:30:00</StartBoundary>
@Nevember
Nevember / Touch-File.ps1
Created May 15, 2022 22:50 — forked from mklement0/Touch-File.ps1
PowerShell function that provides functionality similar to the Unix touch utility for updating last-modified file timestamps and creating files on demand.
<#
Prerequisites: PowerShell v5.1 and above (verified; may also work in earlier versions)
License: MIT
Author: Michael Klement <mklement0@gmail.com>
DOWNLOAD and INSTANT DEFINITION OF THE FUNCTION:
irm https://gist.github.com/mklement0/82ed8e73bb1d17c5ff7b57d958db2872/raw/Touch-File.ps1 | iex
#Install WinGet
#Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
"Installing winget Dependencies"
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
$releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
@Nevember
Nevember / dotNet.ps1
Created December 26, 2021 03:56
Function to retrieve .NET version(s) (.NET, Core, and Framework) via Windows Registry
Function Get-dotNetVersion {
<#
.Synopsis
Retrieve .NET version(s) (.NET, Core, and Framework) via Windows Registry
.Description
Retrieve .NET version(s) (.NET, Core, and Framework) via Windows Registry
.Example
Get-dotNetVersion
Version Key
@Nevember
Nevember / toast.ps1
Created September 12, 2021 23:56 — forked from dend/toast.ps1
Toast Notification in PowerShell
function Show-Notification {
[cmdletbinding()]
Param (
[string]
$ToastTitle,
[string]
[parameter(ValueFromPipeline)]
$ToastText
)
@Nevember
Nevember / powershell.json
Created June 28, 2021 04:46 — forked from rkeithhill/powershell.json
PowerShell snippets file for Visual Studio Code - place in your ~\AppData\Roaming\Code\User\Snippets directory
{
"Condition statement": {
"prefix": "cond",
"body": [
"${_} { ${0}; break }"
],
"description": "Switch condition statement"
},
"Condition single quoted string statement": {
@Nevember
Nevember / Lookup CLSID in PowerShell
Last active June 6, 2021 05:35 — forked from brad-anton/Lookup CLSID in PowerShell
Look up information for multiple CLSIDs; pipeline input is a work-in-progress
Function Get-Clsid {
[CmdletBinding()]
param (
[Parameter (Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[Array]$CLSID
)
$CLSID_KEY = "HKLM:\SOFTWARE\Classes\CLSID"
$ErrorActionPreference = 'SilentlyContinue'