This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #requires -version 5.0 | |
| #requires -module PSReadline | |
| Function Optimize-PSReadLineHistory { | |
| <# | |
| .SYNOPSIS | |
| Optimize the PSReadline history file | |
| .DESCRIPTION | |
| The PSReadline module can maintain a persistent command-line history. However, there are no provisions for managing the file. When the file gets very large, performance starting PowerShell can be affected. This command will trim the history file to a specified length as well as removing any duplicate entries. | |
| .PARAMETER MaximumLineCount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 | |
| #> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #requires -version 5.1 | |
| <# | |
| .SYNOPSIS | |
| Create an HTML Hyper-V health report. | |
| .DESCRIPTION | |
| This command will create an HTML-based Hyper-V health report. It is designed to report on Hyper-V 3.0 or later servers or even Client Hyper-V on Windows 10. This script will retrieve data using PowerShell remoting from the Hyper-V Host. It is assumed you will run this from your desktop and specify a remote Hyper-V host. You do not need any Hyper-V tools installed locally to run this script. | |
| The report only shows virtual machine information for any virtual machine that is not powered off. If you include performance counters, you will only get data on counters with a value other than 0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #requires -version 5.1 | |
| #requires -module ActiveDirectory,DNSClient | |
| # https://jdhitsolutions.com/blog/powershell/8087/an-active-directory-change-report-from-powershell/ | |
| #Reporting on deleted items requires the Active Directory Recycle Bin feature | |
| [cmdletbinding()] | |
| Param( | |
| [Parameter(Position = 0,HelpMessage = "Enter a last modified datetime for AD objects. The default is the last 4 hours.")] | |
| [ValidateNotNullOrEmpty()] |
NewerOlder