Skip to content

Instantly share code, notes, and snippets.

View jdhitsolutions's full-sized avatar

Jeff Hicks jdhitsolutions

View GitHub Profile
@jdhitsolutions
jdhitsolutions / Get-GitTip.ps1
Last active April 9, 2018 15:27
Use this command to search the tips file that is part of the Git-Tips project on GitHub. The default behavior is to get all tips but you can search for text in a tip title or select a random tip.
#requires -version 4.0
Function Get-GitTip {
<#
.Synopsis
Get Git Tips
.Description
Use this command to search the tips file that is part of the Git-Tips project on GitHub. The default behavior is to get all tips but you can search for text in a tip title or select a random tip.
.Parameter Random
@jdhitsolutions
jdhitsolutions / Find-GitTip.ps1
Last active April 9, 2018 15:27
This function will search the Tips.json file from the Git-Tips project on GitHub. You will need to clone or download the git-tips project locally from https://github.com/git-tips/tips.
#requires -version 4.0
Function Find-GitTip {
<#
.Synopsis
Search Git tips
.Description
This function will search the Tips.json file from the Git-Tips project on GitHub. You will need to clone or download the git-tips project locally from https://github.com/git-tips/tips.
.Parameter Text
Verifying that "jeffhicks.id" is my Blockstack ID. https://explorer.blockstack.org/name/jeffhicks.id
@jdhitsolutions
jdhitsolutions / Start-PSCountdown.ps1
Created December 6, 2017 19:16
A PowerShell Countdown timer.
#requires -version 4.0
<#
Inspired from code originally published at:
https://github.com/Windos/powershell-depot/blob/master/livecoding.tv/StreamCountdown/StreamCountdown.psm1
This should work in Windows PowerShell and PowerShell Core, although not in VS Code.
The ProgressStyle parameter is dynamic and only appears if you are running the command in a Windows console.
Even though are is no comment-based help or examples, if you run: help Start-PSCountdown -full you'll get the
@jdhitsolutions
jdhitsolutions / Get-GlobalITR.ps1
Created June 27, 2018 15:29
Get global status from the Internet Traffic Report
#get global index data for the Internet Traffic Report
$data = 'http://www.internettrafficreport.com/rawdata/itr-data.csv'
Invoke-WebRequest -Uri $data -OutFile $env:temp\itr.csv -DisableKeepAlive
Import-csv -Path $env:temp\itr.csv | Select-Object -First 1
Remove-Item $env:temp\itr.csv
@jdhitsolutions
jdhitsolutions / Resolve-ShortLink.ps1
Created July 9, 2018 14:27
A PowerShell WPF form to resolve shortlinks
@jdhitsolutions
jdhitsolutions / sample2.css
Created August 31, 2018 12:59
A sample CSS file I use in some of my PowerShell scripting demos
@charset "UTF-8";
body {
font-family: "monospace";
background-color: #ebebeb;
}
table {
border-collapse: collapse;
width: 80%
}
@jdhitsolutions
jdhitsolutions / Get-CimFolderSize.ps1
Created October 5, 2018 17:53
A proof of concept using CIM to get a total folder size.
$Path = "C:\work"
#get directory names. You could do this via remoting
$dirs = get-childitem -path $Path -Directory -Recurse
$paths = $dirs.fullname
$paths+= $Path
$data = @()
foreach ($item in $paths) {
@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 / Reset-LCM.ps1
Created January 23, 2017 17:52
A DSC configuration to reset the local configuration manager
Param(
[string[]]$Computername = "chi-test02"
)
[DscLocalConfigurationManager()]
Configuration ResetLCM {
Param([string[]]$Computername)