Skip to content

Instantly share code, notes, and snippets.

View dfinke's full-sized avatar

Doug Finke dfinke

View GitHub Profile
@dfinke
dfinke / New-JiraTicket.ps1
Last active September 28, 2025 22:03
One-Shot JIRA Ticket Generator with PowerShell and PSAISuite
#Requires -Module PSAISuite
$feature = 'Implement a GO program to chat with OpenAI models'
$prompt = @'
Based on this engineering spec for `{0}`, write a JIRA ticket that includes:
- problem statement
- context
- goals
@dfinke
dfinke / Find-Date.ps1
Last active August 9, 2025 17:13
A PowerShell function that uses GPT to parse questions like 'a week ago' or 'in July' into precise YYYY-MM-DD formats.
#Requires -Module PSAISuite
function Find-Date {
param(
[string]$question,
[string]$model = 'github:openai/gpt-4.1'
)
$instructions = @"
Current Date: $(Get-Date -Format "yyyy-MM-dd")
@dfinke
dfinke / cli.md
Last active August 1, 2025 17:20
AI CLI Tool Provider Open Source Key Features Cost/Access Unique Aspects Link
Gemini CLI Google Yes (Apache 2.0) Code generation, debugging, file system interaction, real-time web search, task automation, supports large codebases with 1M token context window. Free tier: 60 requests/min, 1,000/day with Google a
@dfinke
dfinke / Todo.ps1
Last active July 27, 2025 17:23
AI-Powered To-Do List in PowerShell
# using psaisuite
# Ensure PSAISuite is available
#Requires -Module PSAISuite
<#
.SYNOPSIS
Outputs text using the 'glow' markdown renderer if available, otherwise falls back to Write-Host.
.DESCRIPTION
This function checks if the 'glow' command is available. If so, it pipes the input to 'glow' for rich markdown rendering. Otherwise, it outputs the text using Write-Host.
# 📦 Install-Module: PSAISuite
# 🔗https://github.com/dfinke/psaisuite
# Get-ChatProviders
# PSAISuite supports 13 providers, and their models.
# $model = "github:openai/gpt-4.1"
$model = "anthropic:claude-opus-4-20250514"
param(
[int]$Year = (Get-Date).Year,
[int]$Month = (Get-Date).Month
)
# Set up day names
$days = @("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
# Print header
Write-Host ""
$Inst = @"
You are powershell expert and an Excel expert and a ImportExcel expert.
I want to create an Excel template. I'll provide you with all the options to
include in the template, and when I have finished,
you'll format it as an .xlsx file to be saved in the current directory.
just the code, no explanation, no comments, no markdown, no fence blocks
"@
#Requires -Module PSAISuite
# Step 1: Generate PowerShell function from a prompt (Model A - GPT-4)
$genPrompt = @"
You're a PowerShell expert.
Write a function that takes a CSV file and creates an Excel file using ImportExcel module.
Return only the code.
"@
@dfinke
dfinke / MorseCodeConverter.ps1
Created March 15, 2025 17:46
A PowerShell script to convert text to Morse code and vice versa
function Convert-TextToMorse {
param (
[Parameter(Mandatory = $true)]
[string]$Text
)
$morseDict = @{
'A' = '.-'; 'B' = '-...'; 'C' = '-.-.'; 'D' = '-..'; 'E' = '.'; 'F' = '..-.'
'G' = '--.'; 'H' = '....'; 'I' = '..'; 'J' = '.---'; 'K' = '-.-'; 'L' = '.-..'
'M' = '--'; 'N' = '-.'; 'O' = '---'; 'P' = '.--.'; 'Q' = '--.-'; 'R' = '.-.'
@dfinke
dfinke / Show-GridView.ps1
Last active March 20, 2025 18:59
A PowerShell 7 function mimicking Out-GridView basics on Windows.
function Show-GridView {
param (
[Parameter(Mandatory, ValueFromPipeline)] $InputObject
)
begin {
Add-Type -AssemblyName System.Windows.Forms
$data = New-Object 'System.Collections.Generic.List[Object]'
}
process {
$data.Add([PSCustomObject]$InputObject)