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 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 {
param(
[Parameter(Mandatory)]
$DllName,
[Parameter(Mandatory)]
$content
)
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-5.1.0.0\\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
param($Request)
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 {
$scanner.Scan("\w+")
}
function Get-GitHubActionTypeName {
$scanner.Skip($WHITESPACE)
$null = $scanner.Scan($QUOTE)
$scanner.ScanUntil("(?=$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
View octocat.yml
swagger: "2.0"
info:
description: Octocat
title: Octocat
version: "1.0.0"
host: api.github.com
schemes:
- http
basePath: /
produces:
@dfinke
dfinke / azxps.ps1
Created Mar 28, 2019
Wrapper for azx
View azxps.ps1
function Get-AZX {
param($name = "*")
$r = (Invoke-RestMethod "https://azx.ms/api/list") -split "`n"
$list = $r[5..$($r.count - 5)]
$list |
ConvertFrom-Csv -Delimiter "|" -Header 'Name', 'Description' |
Where-Object {$_.Name -like $Name}
You can’t perform that action at this time.