Skip to content

Instantly share code, notes, and snippets.

View jdhitsolutions's full-sized avatar

Jeff Hicks jdhitsolutions

View GitHub Profile
@jdhitsolutions
jdhitsolutions / MagicOracle.ps1
Last active September 18, 2026 22:34
A PowerShell WPF script to generate a magic oracle. All in good fun.
#requires -version 5.1
# Usage: .\Magic8Ball.ps1
Try {
#try to load the WPF assemblies
Add-Type -AssemblyName PresentationFramework -ErrorAction Stop
Add-Type -AssemblyName PresentationCore -ErrorAction Stop
Add-Type -AssemblyName WindowsBase -ErrorAction Stop
}
@jdhitsolutions
jdhitsolutions / Get-CimNamespace.ps1
Created May 5, 2017 12:28
A PowerShell function to enumerate WMI namespaces using the CIM cmdlets
#requires -version 4.0
Function Get-CimNamespace {
[cmdletbinding(DefaultParameterSetName = 'computer')]
Param(
[Parameter(Position=0)]
[ValidateNotNullorEmpty()]
[string]$Namespace = "Root",
[Parameter(ParameterSetName = 'computer')]
[ValidateNotNullorEmpty()]
@jdhitsolutions
jdhitsolutions / PSStyleFileInfoTools.ps1
Created January 21, 2022 18:47
A set of functions for exporting and importing FileInfo settings from $PSStyle in PowerShell 7.2.
#requires -version 7.2
<#
These commands can be used to export FileInfo settings from $PSStyle and
then import them in another session. You might use the import command in
your PowerShell profile script. The file must be a json file.
#>
Function Export-PSStyleFileInfo {
[cmdletbinding(SupportsShouldProcess)]
Param(
@jdhitsolutions
jdhitsolutions / ProcessManager.ps1
Created June 24, 2022 17:18
This is a revised version of an AnyBox example.
#requires -version 5.1
#requires -RunasAdministrator
#requires -module AnyBox
# https://www.fresh2.dev/doc/anybox/
# this is a revised version of the example at https://github.com/fresh2dev/AnyBox/blob/main/Examples/Process-Mgr.ps1
Param([string]$Computername = $env:Computername)
$anybox = New-Object AnyBox.AnyBox
@jdhitsolutions
jdhitsolutions / Show-Domain.ps1
Created February 15, 2021 15:06
A PowerShell script to display an Active Directory domain in colorized and tree form.
# requires -versoin 5.1
# requires -module ActiveDirectory
Function Show-DomainTree {
[cmdletbinding()]
[OutputType("String")]
[alias("dt")]
Param(
[Parameter(Position = 0, HelpMessage = "Specify the domain name. The default is the user domain.")]
[ValidateNotNullOrEmpty()]
[string]$Name = $env:USERDOMAIN,
@jdhitsolutions
jdhitsolutions / Add-Border.ps1
Last active July 27, 2026 10:00
Insert a text-based border around a string in PowerShell
#add a border around a string of text
Function Add-Border {
<#
.Synopsis
Create a text border around a string.
.Description
This command will create a character or text based border around a line of text. You might use this to create a formatted text report or to improve the display of information to the screen.
@jdhitsolutions
jdhitsolutions / PSRefresh.ps1
Last active July 10, 2026 09:30
Refresh a new Windows PowerShell Installation.
#requires -version 5.1
#requires -RunAsAdministrator
#PSRefresh.ps1
<#
Update key PowerShell components on a new Windows 10/11 installation.
This script is not intended for server operating systems. The script
should be run in an interactive console session and not in a remoting session.
@jdhitsolutions
jdhitsolutions / Get-GPLink.ps1
Created January 18, 2021 16:47
A PowerShell function to list Group Policy links
@jdhitsolutions
jdhitsolutions / PowerShell Water Tools.md
Last active April 18, 2026 17:52
PowerShell Water Tools

WaterTools

This is a set of PowerShell functions I wrote to help me manage and keep track of my water consumption. You will need to install the pwshSpectreConsole module for the graphing function to work.

I demonstrated this during the Lightning Demos during the 2026 PowerShell Summit.

@jdhitsolutions
jdhitsolutions / .Show-SpectreSystemStatus.md
Last active March 27, 2026 23:10
A PowerShell script that uses the pwshSpectreConsole module to display formatted system information.

Show-SpectreSystemStatus

The PowerShell function in this gist is designed to display the system status of a Windows machine. It provides information about the operating system, hardware, and other relevant details. The function can be used to quickly gather and display important system information in a user-friendly format. This function requires PowerShell 7 and a Windows platform.

Usage

Save all files to the same directory. Dot source the ps1 file.

. .\Show-SystemStatus.ps1