Skip to content

Instantly share code, notes, and snippets.

View jdhitsolutions's full-sized avatar

Jeff Hicks jdhitsolutions

View GitHub Profile
@jdhitsolutions
jdhitsolutions / license.txt
Last active December 1, 2025 22:32
Save and jump to recently used locations in PowerShell.
MIT License
Copyright (c) 2025 JDH Information Technology Solutions, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@jdhitsolutions
jdhitsolutions / Out-SelectFile.ps1
Last active December 1, 2025 22:04
Select files from a list generated by the pwshSpectreConsole module.
#requires -version 7.5
#requires -module pwshSpectreConsole
Function Out-SelectFile {
<#
.SYNOPSIS
Select files from a SpectreConsole list
.DESCRIPTION
Select files using Read-SpectreMultiSelection from the pwshSpectreConsole module. Selected objects will be written to the pipeline.
@jdhitsolutions
jdhitsolutions / Import-LocalModule.ps1
Last active December 1, 2025 21:54
Import a local module from a list. Requires PowerShell 7 and the pwshSpectreConsole module.
#requires -version 7.5
#requires -module pwshSpectreConsole
Function Import-LocalModule {
[cmdletbinding()]
[alias('ilm')]
Param(
[Parameter(Position = 0, HelpMessage = "The path to the module data JSON file")]
[ValidateScript({Test-Path $_})]
[string]$DataPath = "c:\scripts\LocalModuleData.json",
[switch]$Passthru
@jdhitsolutions
jdhitsolutions / Select-ToDelete.ps1
Last active December 1, 2025 21:55
Select files to delete in PowerShell. This requires the pwshSpectreConsole PowerShell module and PowerShell 7.
Empty File#requires -version 7.5
#requires -module pwshSpectreConsole
Function Select-ToDelete {
<#
.SYNOPSIS
Select files to delete.
.DESCRIPTION
Pipe files to this command which will use SpectreConsole to present a choice menu. The command has an automatic timeout of 15 seconds.
.PARAMETER InputObject
@jdhitsolutions
jdhitsolutions / Compare-File.ps1
Last active November 21, 2025 18:05
A PowerShell script alternative to Compare-Object for comparing text files. This should be considered a proof-of-concept.
#requires -version 7.2
<#
this is a variation of what you could do comparing text files
using Compare-Object. The only difference really is how this
script formats the output.
This should be considered a PROOF-OF-CONCEPT
#>
@jdhitsolutions
jdhitsolutions / History.format.ps1xml
Last active November 19, 2024 17:19
A custom PowerShell view for history items. This requires PowerShell 7.
<!--
history.format.ps1xml
Format type data generated 11/19/2024 11:19:23 by PROSPERO\Jeff
This file was created using the New-PSFormatXML command that is part
of the PSScriptTools module.
https://github.com/jdhitsolutions/PSScriptTools
To use, import this file into your PowerSHell 7 session:
@jdhitsolutions
jdhitsolutions / Crescendo-Demo.ps1
Created May 8, 2024 20:13
A demonstration PowerShell script using the Crescendo commands to create a PowerShell module.
#requires -version 7.4
#requires -Module Microsoft.PowerShell.Crescendo
#this demo assumes you have copied the du.exe utility from Sysinternals to a folder in your path
#the name of the module to create
$ModuleName = "FolderUsage"
#the parent folder for the module
$ModulePath = "C:\temp"
@jdhitsolutions
jdhitsolutions / demo.ps1
Last active December 10, 2024 15:41
Material from my RTPSUG presentation on writing better PowerShell code
return "This is a demo script file."
# Find Me: https://jdhitsolutions.github.io
# Any one can learn syntax and mechanics.
# Let's focus on the squishy bits - what you should write
# and what not to write
#region Essential rules
@jdhitsolutions
jdhitsolutions / Get-GHIssueStats.ps1
Created March 7, 2024 17:59
My solution for the PowerShell Podcast scripting challenge to write PowerShell code to get GitHub issue statistics.
#requires -version 7.4
<#
This function requires the gh.exe command line tool.
You many encounter API rate restrictions under heavy use.
#>
#load the custom formatting file
Update-FormatData $PSScriptRoot\ghLabelStatus.format.ps1xml
@jdhitsolutions
jdhitsolutions / my-conference-future.md
Last active November 19, 2024 17:20
My public speaking status and requirements

Public Presentation Policy

I have been an IT professional for over 30 years. I have been speaking publicly and presenting at conferences, user groups and technology events for probably 25 years. I have presented to all types of groups, from small user groups to large conferences, literally around the world. As I enter the last part of my IT career, I am re-assessing what role conferences and public presentations will play, and where I want to devote my energy and financial resources. The truth is, that as much as I enjoy presenting and meeting people, there is always a trade-off between the time and money spent on conferences and the value I get from them.

Beginning in 2024, I have made some hard decisions. If you are involved in a conference or event where I have presented in the past, this may be of interest to you. The bottom line is that I am now very selective about what events and conferences I will present at. Let's dive into some details, and of course there will be exceptions, which I'll cover in