Skip to content

Instantly share code, notes, and snippets.

Doug Finke dfinke

Block or report user

Report or block dfinke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View splitpathExcel.ps1
$parts = @()
foreach($file in (dir c:\temp -r)) {
$parts += ,$file.FullName.split("\")
$count = $parts[-1].Count
if($count -gt $max) {$max=$count}
$data = foreach ($part in $parts) {
View selectf.ps1
Import-Module PSStringScanner
function selectf {
$ss = New-PSStringScanner ($args -join ' ')
$select = $ss.scanUntil("(?=from )")
$null=$ss.scan("from ")
if($ss.check(" where ")) {
$targetPath = $ss.scanuntil("(?=where )")
View ExcelReportWithChart.ps1
$xlfile = "$env:TEMP\PSreports.xlsx"
Remove-Item $xlfile -ErrorAction SilentlyContinue
# Get-Process
$ecd = New-ExcelChartDefinition -XRange "A3:A7" -YRange "C3:C7" -Row 30 -Column 1 -Title "Report Process`nTotal Handles" -NoLegend
Get-Process | Select -First 5 |
Export-Excel $xlfile -AutoSize -StartRow 2 -TableName ReportProcess -ExcelChartDefinition $ecd
# Get-Service
Get-Service | Select -First 5 |
View ConvertFromRustToPInvoke.ps1
Import-Module PSStringScanner
function ConvertFrom-RustToPInvoke {
View fun.ps1
0..6 | ForEach {
$v = "1" + "0" * $_ + "3"
"{0,9}^2 = {1,15}" -f $v, [math]::Pow($v, 2)
View octave.json
"acrylicOpacity": 0.5,
"closeOnExit": true,
"colorScheme": "Campbell",
"commandline": "C:\\Octave\\Octave-\\mingw64\\bin\\octave-cli.exe",
"cursorColor": "#FFFFFF",
"cursorShape": "bar",
"fontFace": "Consolas",
"fontSize": 14,
"guid": "{e0e0fd16-fe15-4c28-a1f2-6cd8cf551d00}",
View invokeHyperLink.ps1
View run.ps1
function Get-Joke {
$jokes = $(
"Did you hear about the restaurant on the moon? Great food, no atmosphere."
"What do you call a fake noodle? An Impasta."
"How many apples grow on a tree? All of them."
"Want to hear a joke about paper? Nevermind it's tearable."
"I just watched a program about beavers. It was the best dam program I've ever seen."
"Why did the coffee file a police report? It got mugged."
View ImportGitHubAction.ps1
function Get-GitHubActionType {
function Get-GitHubActionTypeName {
$null = $scanner.Scan($QUOTE)
View log.txt
Windows PowerShell transcript start
Start time: 20190331095548
Username: MAINBOX\Douglas
RunAs User: MAINBOX\Douglas
Configuration Name:
Machine: MAINBOX (Microsoft Windows NT 10.0.17134.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Process ID: 12336
PSVersion: 5.1.17134.590
You can’t perform that action at this time.