Skip to content

Instantly share code, notes, and snippets.

View jdhitsolutions's full-sized avatar

Jeff Hicks jdhitsolutions

View GitHub Profile
@jdhitsolutions
jdhitsolutions / PSChristmasPrompt.ps1
Last active December 6, 2018 15:04
PowerShell Christmas Prompt
<#
display a colorful Christmas countdown prompt
[♫♪Christmas in 18.15:22:08֍♦] PS C:\>
This should work in the console with a True Type font and
the Powershell ISE
this prompt requires a TrueType font
@jdhitsolutions
jdhitsolutions / PSHanukkahPrompt.ps1
Last active December 5, 2017 16:47
PowerShell Prompt to Countdown Hanukkah
#this prompt counts down to the first day of Hanukkah 2017
<#
It appears that some of the special characters I was using aren't supported in Windows 10 unless you are using Raster fonts.
[CHAR]14 is supposed to be a musical note and [CHAR]15 is like a snowflake.
You can select any other character you want, or none at all.
#>
Function Prompt {
#get current year
$year = (Get-Date).year
#requires -version 3.0
<#
This command will attempt to execute a very simple scriptblock remotely using Invoke-Command. If the command fails
then PowerShell remoting is not properly enabled or configured.
#>
Function Test-PSRemoting {
[cmdletbinding()]
Param(
@jdhitsolutions
jdhitsolutions / Out-More.ps1
Last active December 14, 2017 19:17
A function to pipe objects to the pipeline and console in groups or pages.
#requires -version 4.0
Function Out-More {
<#
.Synopsis
Send "pages" of objects to the pipeline.
.Description
This function is designed to display groups or "pages" of objects to the PowerShell pipeline. It is modeled after the legacy More.com command line utility.
By default the command will write out objects out to the pipeline in groups of 50. You will be prompted after each grouping. Pressing M or Enter will get the next group. Pressing A will stop paging and display all of the remaining objects. Pressing N will display the next object. Press Q to stop writing anything else to the pipeline.
@jdhitsolutions
jdhitsolutions / ChristmasWishes.ps1
Created December 24, 2015 15:49
Display a colorful and randomly selected Christmas message.
<#
Display a randomly selected holiday quote in a festive color scheme
you can find more Christmas quotes at
http://www.brainyquote.com/quotes/topics/topic_christmas.html
Learn more about PowerShell:
http://jdhitsolutions.com/blog/essential-powershell-resources/
#>
@jdhitsolutions
jdhitsolutions / Get-Confetti.ps1
Created December 30, 2015 14:46
A New Year's Countdown script
#this must be run in the PowerShell console NOT the ISE
if ($host.name -ne 'ConsoleHost') {
Write-Warning "Sorry. This must be run in the PowerShell console."
#bail out
Return
}
#get window dimensions
$X = $host.ui.RawUI.WindowSize.width
@jdhitsolutions
jdhitsolutions / Update-OLWLinkGlossary
Last active March 29, 2016 12:26
A PowerShell function to update and add automatic links to Open Live Writer.
Function Update-OLWLinkGlossary {
<#
.Synopsis
Update Open Live Writer Automatic Links
.Description
This command is designed to make it easier to update and add automatic links to Open Live Writer. It has primarily been written to make it easier to create automatic links for PowerShell commands but you should be able to use it for other items as well.
The command will try to find a matching entry by the Text and if found, will update with the specified values. Be aware that the text you use is case sensitive. Otherwise, the command will create a new entry.
@jdhitsolutions
jdhitsolutions / New-StarWarsName.ps1
Last active December 1, 2017 15:58
Generate a fictious name that might exist in the Star Wars universe.
#generate a fictious name that might exist in the Star Wars universe.
[cmdletbinding()]
Param(
[Parameter(Mandatory,HelpMessage="Enter your first name. It must be at least 2 characters")]
[ValidateNotNullOrEmpty()]
[ValidateScript({$_.length -ge 2})]
[String]$Name,
[Parameter(Mandatory,HelpMessage="Enter your Mother's first name. It must be at least 2 characters")]
[ValidateNotNullOrEmpty()]
@jdhitsolutions
jdhitsolutions / Dev-PSSonos.ps1
Last active March 1, 2022 13:09
this is a variation of a script posted at https://gallery.technet.microsoft.com/SONOS-PowerShell-500c9878 that uses Invoke-Webrequest.
<#
this is a variation of a script posted at
https://gallery.technet.microsoft.com/SONOS-PowerShell-500c9878
that uses Invoke-Webrequest.
This is very much a work in progress
other resources
Verifying that "jeffhicks.id" is my Blockstack ID. https://explorer.blockstack.org/name/jeffhicks.id