Skip to content

Instantly share code, notes, and snippets.

View michaeltlombardi's full-sized avatar

Mikey Lombardi (He/Him) michaeltlombardi

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<!-- look for drivers on floppy -->
<component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DriverPaths>
<PathAndCredentials wcm:keyValue="1" wcm:action="add">
<Path>A:\</Path>
</PathAndCredentials>
</DriverPaths>
@michaeltlombardi
michaeltlombardi / README.md
Created August 23, 2016 15:49
Packer Issue 2715 Repro

REPRO

Environment INfo

Client

Packer Version: 0.10.1 (Windows) OS Version: 6.1.7601 (Windows 7)

ESXi

@michaeltlombardi
michaeltlombardi / Test-ModuleImportSpeed.ps1
Created July 1, 2016 12:50
Tests the average module load time of a single-file module versus a module with one file per function
$MultiFileResults = @()
$SingleFileResults = @()
$MultiFileModulePath = '.\SomeModule.psd1'
$SingleFileModulePath = '.\Build\SomeModule\SomeModule.psd1'
for ($i=0;$i -lt 100; $i++){
rmo SomeModule
$MultiFileResults += Measure-Command -Expression {ipmo $MultiFileModulePath} | Select -expand TotalMilliseconds
rmo SomeModule
@michaeltlombardi
michaeltlombardi / uploadblobsite.sh
Created April 26, 2016 20:41
Upload the required info for a mkdocs site to an Azure Storage Blob
#!/bin/sh
export AZURE_STORAGE_ACCOUNT='Your_Account_here'
export AZURE_STORAGE_ACCESS_KEY='Your_Key_Here'
export container_name='Your_Container_Here'
export source_folder=~/local/path/to/your/site/folder/*
export version='vX.Y.Z' # Replace this with the appropriate version for your docs.
export doclang='en-US' # Replace this if the language isn't American English.
root_folder=${source_folder:0:(-1)}
@michaeltlombardi
michaeltlombardi / potential-stlpsug-directory-structure.txt
Last active March 18, 2016 18:26
A proposed directory structure for the STLPSUG main repository.
.
| -- communication.md
| -- contributions.md
| -- current-events.md
| -- documents
| | -- sponsorship.md
| | -- steering.md
| | -- ?
| -- events
| | -- meetups
@michaeltlombardi
michaeltlombardi / Get-VSCodeSnippet.ps1
Created February 22, 2016 19:53
Get Visual Studio Code Snippets via PowerShell
function Get-VSCodeSnippet {
<#
.SYNOPSIS
Return the list of Snippets from a VSCode JSON file.
.DESCRIPTION
Given the path to one or more Visual Studio Code JSON files, the function returns all of the associated snippets, their prefix, description, and body, as well as their source file. Useful for discovering snippets after updating an extension or when using it for the first time.
.PARAMETER Path
The full path to one or more Visual Studio Code Snippet JSON files. By default this command will return all of the snippets found in the current user's loaded extensions and in the extensions which shipped directly with Visual Studio Code.
.EXAMPLE
C:\PS> Get-VSCodeSnippet -Path C:\Users\John.Doe\.vscode\extensions\ms-vscode.PowerShell-0.4.1\snippets\PowerShell.json
$TargetComputers = Import-Csv c:\ADcomputers.csv | Select-Object -ExpandProperty Name
ForEach($Target in $TargetComputers){
If (Test-Connection -ComputerName $Target -Count 1){
Get-Hotfix -ComputerName $Target |
Sort-Object -Property InstalledOn -Descending |
Select-Object -First 1 -Property InstalledOn,PSComputerName |
Export-Csv -Path C:\patchstatus.csv -Append
} Else {
Write-Error "Unable to connect to $Target"
}
@michaeltlombardi
michaeltlombardi / PSAPI-Matrix-ByVendorAndSoftware.md
Last active December 8, 2015 20:23
Vendor and Software API/Powershell Support Matrix

Vendor and Software API/Powershell Support Matrix

Note: I've made a more robust project for this here.

##Synopsis This document is intended to represent the level of excellence a given vendor's specific software has achieved with regard to both API and Powershell modules. If specific reviews of the API and/or module are available, link to them or add in subsections below.

##Matrix Instructions

  1. Ensure that the order is alphabetical by vendor first and software second.
  2. Rate the availability and quality of the API, Powershell Module, and DSC Resources on a scale from 0 to 10, where 0 is nonexistant and 10 is best-in-class.
@michaeltlombardi
michaeltlombardi / Get-AppLockerEvent.ps1
Created December 2, 2015 14:51
Get-AppLockerEvent
Function Get-AppLockerEvent {
<#
.Synopsis
Retrieve AppLocker events from one or more computers.
.Description
Retrieve AppLocker events from one or more computers. AppLocker events can be queried by either EventType (a plain-english explanation of the general type of event) or EventID.
.Parameter ComputerName
The name of the computer whose eventlogs will be queried for AppLocker events. If no ComputerName is specified, the function will default to the localhost.
Function New-NanoElasticsearchVM {
param (
[PSCredential]$Credential = (Get-Credential -UserName Administrator -Message "Enter your password; DO NOT CHANGE THE USERNAME!"),
[string]$ComputerName = "nes01",
[string]$ISOPath = "$env:HOMEDRIVE$Env:HomePath\downloads\10514.0.150808-1529.TH2_RELEASE_SERVER_OEMRET_X64FRE_EN-US.ISO",
[string]$MediaPath = "C:\W2016Media",
[string]$NanoPath = "C:\nano",
[int64]$MemoryStartupBytes = (2*1024*1024*1024),
[string]$VMSwitchName = "vExternal"
)