Skip to content

Instantly share code, notes, and snippets.

View michaeltlombardi's full-sized avatar

Mikey Lombardi (He/Him) michaeltlombardi

View GitHub Profile
@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 / 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

<?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>
Verifying that "michaeltlombardi.id" is my Blockstack ID. https://onename.com/michaeltlombardi
---
driver:
name: vagrant
provisioner:
name: chef_zero
always_update_cookbooks: true
verifier:
name: inspec
---
driver:
name: vagrant
provisioner:
name: chef_zero
always_update_cookbooks: true
verifier:
name: inspec

$ConvertedFilter

(enabled -eq $True -and PasswordNeverExpires -eq $False -and WhenCreated -lt $WhenCreated -and samAccountType -eq "805306368")

$ConvertedFilter -replace '\(enabled', '($_.enabled'

((enabled -eq $True -and PasswordNeverExpires -eq $False -and WhenCreated -lt $WhenCreated -and samAccountType -eq "805306368").enabled -eq $True -and PasswordNeverExpires -eq $False -and WhenCreated -lt $WhenCreated -and samAccountType -eq "805306368")
@michaeltlombardi
michaeltlombardi / Gemfile
Last active October 1, 2019 18:40
Example demo for ruby-pwsh gem
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'irbtools'
gem 'ruby-pwsh'
gem 'fuubar'
if RUBY_VERSION == "1.8.7"
@michaeltlombardi
michaeltlombardi / basic.pp
Last active April 14, 2020 19:26
Example Puppet Manifest using the PowerShellGet DSC Resources
dsc_psrepository {'Add team module repo':
dsc_name => 'foo',
dsc_ensure => present,
# This location is nonsense, can be any valid folder on your
# machine or in a share, any location the SourceLocation param
# for the DSC resource will accept.
dsc_sourcelocation => 'C:\Program Files',
dsc_installationpolicy => untrusted,
}
@michaeltlombardi
michaeltlombardi / bigmikey.psm1
Created October 16, 2020 14:04
oh-my-posh bigmikey
#requires -Version 2 -Modules posh-git
function Write-Theme
{
param(
[bool]
$lastCommandFailed,
[string]
$with
)