First, create a new Jekyll site and corresponding GitHub Pages repository, then test it locally at http://localhost:4000:
$ gem install jekyll bundler
$ jekyll new <REPO>/
Running bundle install in /Users/<USER>/Development/GitHub/<REPO>...
## Example of how to use the opensource InteractveDataDisplay module from Microsoft to create a WPF chart in PowerShell | |
Add-Type -AssemblyName PresentationFramework | |
Add-Type -AssemblyName System.IO.Compression.FileSystem | |
# Location to download the required libraries and reference them from | |
$Source = "C:\Users\tjones\OneDrive\PowerShell\POSH Projects\Interactive Data Display" | |
#region DownloadDependencies | |
$URLs = @( |
using namespace System.Collections.Generic; using namespace System.Linq | |
function Get-FileEncoding { | |
<# | |
.SYNOPSIS | |
Attempt to determine a file type based on a BOM or file header. | |
.DESCRIPTION | |
This script attempts to determine file types based on a byte sequence at the beginning of the file. | |
If an identifiable byte sequence is not present the file type cannot be determined using this method. |
function Start-Demo { | |
[CmdletBinding()] | |
param( | |
# A history file with a command on each line (or using ` as a line-continuation character) | |
[Parameter(Mandatory)] | |
[Alias("PSPath")] | |
[string]$Path | |
) | |
[Microsoft.PowerShell.PSConsoleReadLine]::ClearHistory() |
<# | |
.SYNOPSIS | |
Uses XML transformation on a specified XML file | |
.DESCRIPTION | |
Performs XML configuration changes to a given XML file via XML-Document-Transform (XDT) commands specified within a seperate XML file. | |
.EXAMPLE | |
PS C:\> Use-XMLTransform -XML 'D:\myApp\app.config' -XDT 'D:\myApp\app.release.config' | |
Transforms configuration within app.config using the XDT commands found in app.release.config | |
.INPUTS | |
String literal paths to XML/XDT docs and optionally XmlTransform.dll |
# Useful references: | |
# | |
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line | |
# https://ss64.com/vb/sendkeys.html | |
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell | |
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/ | |
# | |
# Future enhancements - use events rather than an infinite loop | |
$wsh = New-Object -ComObject WScript.Shell | |
while (1) { |
First, create a new Jekyll site and corresponding GitHub Pages repository, then test it locally at http://localhost:4000:
$ gem install jekyll bundler
$ jekyll new <REPO>/
Running bundle install in /Users/<USER>/Development/GitHub/<REPO>...
filter Get-DependencyTree { | |
<# | |
.NOTES | |
From https://gist.github.com/Jaykul/304e7874d629ef4848c9acd0cfd550d0 | |
#> | |
param( | |
[Parameter(Mandatory, ValueFromPipeline)] | |
[System.Management.Automation.PSModuleInfo[]]$Module, | |
$Depth = 0, |
Function New-WPFClock { | |
## Generates a clock displaying the current system time | |
## Requires the Arction WPF Gauges, a free download from https://www.arction.com/free-gauges/ | |
## Set the location of the Arction Gauges dll on line 26 | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$false,Position=0)] |
<# | |
Dumps capture group locations and names/numbers | |
Example: | |
> regexinfo 'Jenny: 555-867-5309' '(?<name>\w+):\s+(?<phone>(?:(?<area>\d{3})-)?(\d{3}-\d{4}))' | |
[Jenny]: [[555]-[867-5309]] | |
| || | | |
| || 1 | |
| |area | |
| phone |
function Get-Spreadsheet { | |
param( | |
[Parameter(Mandatory = $true)] | |
[ValidateScript({ Test-Path $_ -PathType Leaf })] | |
[string]$Path | |
) | |
try { | |
[DocumentFormat.OpenXml.Packaging.SpreadsheetDocument] | Out-Null | |
} | |
catch { |