Skip to content

Instantly share code, notes, and snippets.

View TechDufus's full-sized avatar
💻
Breaking Stuff

TechDufus TechDufus

💻
Breaking Stuff
View GitHub Profile
@TechDufus
TechDufus / Progress-Indicator-Example.ps1
Last active April 26, 2022 20:54
Display a spinner in the console to simulate scrip activity.
#Region PREP
#Region Formatting
$script:YELLOW = "$($PSStyle.Foreground.Yellow)"
$script:RED = "$($PSStyle.Foreground.Red)"
$script:GREEN = "$($PSStyle.Foreground.Green)"
$script:CYAN = "$($PSStyle.Foreground.Cyan)"
$script:RESET = "$($PSStyle.Reset)"
$script:ARROW = "${CYAN}$([char]9654)${RESET}"
@TechDufus
TechDufus / Get-LVTCompoundInterest.ps1
Last active December 21, 2021 20:31
Basic LVT Profit Compound Calculator
<#
.SYNOPSIS
Quickly calculate your compounding profits for LVT.
.DESCRIPTION
This function will show you an esitmate profit amount based on the values you provide.
This function currently does not get a live reading of the current LVT price, you will need to manually provide the current price yourself.
.PARAMETER LVT
Provide the amount of LVT in your portfolio that is generating interest.
.PARAMETER Days
Provide the number of days you are investing in LVT.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am matthewjdegarmo on github.
  • I am matthewjdegarmo (https://keybase.io/matthewjdegarmo) on keybase.
  • I have a public key ASBTbx9XQCyLoRAf7g2Jw2k2J0HihGOj-SfpmmEBU3PDiAo

To claim this, I am signing this object:

@TechDufus
TechDufus / Get-WhereObject.ps1
Last active April 7, 2021 16:53
Dynamically Generate Where-Object from [PSCustomObject] Values
Function Get-Example {
[CmdletBinding()]
param(
[parameter()]
[System.String] $FirstName,
[parameter()]
[System.String]$LastName
)
@TechDufus
TechDufus / Test-PowerShellProfilePerformance.ps1
Last active September 5, 2022 21:27
Test PowerShell Profile Performance
<#
.SYNOPSIS
Perform a benchtest of your PowerShell profile.
.DESCRIPTION
Load Powershell (or Preview) X number of times with NO profile, and with profile, and compare the average loading times.
.PARAMETER Count
Specify the number of consoles to load for testing.
.PARAMETER Preview
Specify whether to test again pwsh-preview or not.
With this present, the tests will use pwsh-preview.
@TechDufus
TechDufus / New-ModuleBase.ps1
Last active August 3, 2020 19:02
Create the base module structure for a new module. This is my slight adaptation to Jeff Hick's [original code](https://gist.github.com/jdhitsolutions/6d26c983a13efae93363e0f9a9e2996b) presented at the Chicago PowerShell Conference 2020.
#requires -version 5.1
#requires -module PowerShellGet
<#
The function assumes you have git installed and use it for source control
This code contains hard-coded references for my environment. This file
is offered as educational and reference material. It will not run for you
without revision.