Skip to content

Instantly share code, notes, and snippets.

@keithga
keithga / find-StringInWULog.ps1
Last active April 4, 2018 16:53
BLOG: example of how to work arround Get-WindowsUpdateLog console issues in a SCCM Configuration Item
<#
.SYNOPSIS
Search WindowsUpdate Logs
.DESCRIPTION
Searches the Windows Update Log for a string
.NOTES
Ready to be used within a
Copyright Keith Garner, All rights reserved.
@keithga
keithga / Trace-NetworkwithNetSh.ps1
Created February 23, 2019 02:16
network trace program
#Requires -RunAsAdministrator
<#
.Synopsis
Launch network trace
.DESCRIPTION
Launches network trace and displays a
.EXAMPLE
Example of how to use this cmdlet
.NOTES
@keithga
keithga / Update-Windows7Images.ps1
Created March 14, 2019 02:49
Windows 7 Image Factory
#Requires -RunAsAdministrator
<#
.Synopsis
Auto create a VM from your MDT Deployment Media
.DESCRIPTION
Given an MDT Litetouch Deployment Share, this script will enumerate
through all "Offline Media" shares, allow you to select one or more,
and then auto-update and auto-create the Virtual Machine.
# This script will remove the VM *AND* Vhd
$VMs = get-vm | Out-GridView -OutputMode Multiple
$Disks = $VMs | Get-VMHardDiskDrive | % path
$VMs | stop-vm -Force -TurnOff -Confirm:$False -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
$VMs | Remove-VM -Force -Confirm:$False
@keithga
keithga / New-VMWithAssetTag.ps1
Created August 30, 2023 03:58
Create VM with Custom AssetTag
function new-MyVM {
[cmdletbinding()]
param(
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0)]
$name,
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=1)]
$AssetTag,
$Switch = ( Get-VMSwitch -SwitchType External | Select-object -first 1 -ExpandProperty Name ),
$DVDPath = 'C:\iso\ipxe\IPXE.NET.23.03.07.iso'
@keithga
keithga / WeMo.psm1
Created November 4, 2025 03:16
PowerShell module for Belkin WeMo switches
<#
.Synopsis
Belkin WeMo Library
.DESCRIPTION
Powershell library for WeMo Switches (Model F7C063)
.NOTES
Now that We-Mo switches are NO LONGER being supported by belkin (boo),
I will need a way to Reset, Join, and control my We-Mo switches Model F7C063.
.EXAMPLE