Skip to content

Instantly share code, notes, and snippets.

View Woznet's full-sized avatar

Woz Woznet

  • VA
  • 02:04 (UTC -05:00)
View GitHub Profile
@Woznet
Woznet / Trigger-MDMAutoEnroll.ps1
Created October 28, 2025 01:37
Trigger MDM AutoEnrollment, requires system priviledges
<#
.SYNOPSIS
Trigger MDM AutoEnrollment, requires system priviledges
.EXAMPLE
psexec -accepteula -nobanner -i -s powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\Trigger-MDMAutoEnroll.ps1"
.NOTES
Source: https://whackasstech.com/microsoft/msintune/how-to-enroll-existing-entra-joined-devices-to-microsoft-intune
@Woznet
Woznet / User-Default.ini
Created October 27, 2025 13:53
WinSetView - User Default
[Options]
ThemeIndex=1
Language=en-US
Font1=Segoe UI
Font2=Consolas
Size1=11
Size2=10
Scroll=1
Interface=2
Reset=0
@Woznet
Woznet / Add Duration property to HistoryInfo type.ps1
Created July 3, 2025 19:49
Add Duration property to Get-History output in Windows PowerShell 5.1
if ($PSVersionTable.PSEdition -ne 'Core') {
try {
Update-TypeData -TypeName Microsoft.PowerShell.Commands.HistoryInfo -MemberType ScriptProperty -MemberName Duration -Value {
[OutputType([timespan])]
param()
if ($this.EndExecutionTime -and $this.StartExecutionTime) {
return ($this.EndExecutionTime - $this.StartExecutionTime)
}
else {
return $null
@Woznet
Woznet / AzTableStorage.psm1
Created June 3, 2025 11:19
AzStorageTable functions
# Source: https://www.powershellgallery.com/packages/AzStorageTable
function Connect-AzTableStorage {
[CmdletBinding()]
param(
[Parameter()]
[string]$Token,
[Parameter()]
[string]$TokenExpiration,
[Parameter()]
[string]$TenantId,
<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<link href='https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color: #ffffff; --text-color: #333333; --select-text-bg-color: #B5D6FC; --select-text-font-color: auto; --monospace: "Lucida Console",Consolas,"Courier",monospace; --title-bar-height: 20px; }
.mac-os-11 { --title-bar-height: 28px; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { white-space: pre-wrap; }
body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; }
try {
$ErrorActionPreference = 'Stop'
$ODMounts = Get-Item 'HKCU:\SOFTWARE\Microsoft\OneDrive\Accounts\Business1\Tenants\*\'
$ODMountPath = $ODMounts.GetValueNames() | Where-Object {$_ -match 'Ace Data'}
if ($ODMountPath) {
$ADPath = Get-Item $ODMountPath
$ADUserPath = [System.IO.Path]::Combine($ADPath.FullName, 'Users', $env:USERNAME)
if (Test-Path $ADUserPath) {
$UserProfileDir = [System.IO.Path]::Combine($ADUserPath, 'User Profile')
if (-not (Test-Path $UserProfileDir)) {$null = New-Item -Path $UserProfileDir -ItemType Directory -Force}
@Woznet
Woznet / runtime-colors.txt
Last active August 26, 2025 01:28
rgb values for coloring command execution time in prompt compressed
127;212;233,126;212;233,126;211;233,126;210;233,125;209;233,125;208;233,125;208;233,124;207;233,124;206;233,124;205;233,123;205;233,123;204;232,123;203;232,122;202;232,122;201;232,122;201;232,122;200;232,121;199;232,121;198;232,121;197;232,120;197;232,120;196;232,120;195;232,119;194;232,119;193;232,119;193;232,118;192;232,118;191;232,118;190;232,117;189;232,117;189;232,117;188;232,116;187;232,116;186;231,116;185;231,115;185;231,115;184;231,115;183;231,114;182;231,114;181;231,114;181;231,113;180;231,113;179;231,113;178;231,112;177;231,112;177;231,112;176;231,111;175;231,111;174;231,111;174;231,110;173;231,110;172;231,110;171;231,109;170;231,109;170;231,109;169;230,108;168;230,108;167;230,108;166;230,107;166;230,107;165;230,107;164;230,106;163;230,106;162;230,106;162;230,105;161;230,105;159;230,104;159;230,104;158;230,103;157;230,103;156;230,102;155;230,102;154;230,101;154;229,101;153;229,101;152;229,100;151;229,100;150;229,99;150;229,99;149;229,98;148;229,98;147;229,97;146;229,97;145;229,96;145;229,96;144;229,
@Woznet
Woznet / WozDev2024-x64.xml
Created October 22, 2024 06:30
Office365 Deployment Configs
<Configuration ID="fdd23708-37aa-4edd-8be3-f9ad1d6f5292">
<Info Description="WozDev x64" />
<Add OfficeClientEdition="64" Channel="Current" MigrateArch="TRUE">
<Product ID="O365ProPlusRetail">
<Language ID="en-us" />
<Language ID="MatchPreviousMSI" />
<ExcludeApp ID="Groove" />
<ExcludeApp ID="Lync" />
</Product>
<Product ID="AccessRuntimeRetail">
function Write-MyProgress {
<#
.SYNOPSIS
Displays a progress bar within a Windows PowerShell command window.
.DESCRIPTION
The Write-MyProgress cmdlet displays a progress bar in a Windows PowerShell command window that depicts the status of a running command or script.
.PARAMETER Object
The collection of objects being processed in the loop.
@Woznet
Woznet / Copy PnP List with Data.ps1
Created March 17, 2024 15:57
Copy list between SharePoint Sites or Tenants
<#
.SYNOPSIS
Copy list between SharePoint Sites or Tenants
# Copy PnP List with Data Migration
.NOTES
Used PnP.PowerShell version 2.4.0
Source: