Skip to content

Instantly share code, notes, and snippets.

@JustinGrote
JustinGrote / IncorrectUseOfFormatCmdletsInMiddleOfPipeline.psm1
Last active September 6, 2022 11:33
Warn if Format command (Format-Table, etc.) are used in the middle of a pipeline.
using namespace System.Management.Automation.Language
using namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
function IncorrectUseOfFormatCmdletsInMiddleOfPipeline {
<#
.SYNOPSIS
Do not place format-table in the middle of a pipeline
.DESCRIPTION
Detects when Format commands are commonly misused in the middle of a pipeline, causing unexpected results with display objects that dont have the same properties as the original piped object.
@ninmonkey
ninmonkey / Templates For Tables and Mermaid Diagrams.db.md
Last active October 17, 2022 00:58
Snippets/Templates For Tables and Mermaid Diagrams
@ninmonkey
ninmonkey / reddit-nixish-commands.ipynb
Last active June 30, 2022 00:55
quick examples showing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ninmonkey
ninmonkey / Minimizing-Noise-In-VS-Code.settings.md
Last active November 9, 2022 21:43
Minimizing visual noise In VS-Code
using namespace System
using namespace System.Linq
using namespace System.Collections
using namespace System.Collections.Generic
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
using namespace System.Reflection
# Hey person reading this! Don't do this, alright? You'll have a bad time. ty
@dfinke
dfinke / Invoke-OpenAI
Last active November 28, 2022 13:17
Convert natural language commands into executable PowerShell using OpenAI
<#
Aims to grow the understanding of using OpenAI in PoweShell by providing an example of an implementation and references
#>
function Invoke-OpenAI {
<#
.SYNOPSIS
Convert natural language commands into commands in PowerShell
.EXAMPLE
@ninmonkey
ninmonkey / IComparer And IComparable summary.md
Created May 28, 2022 01:14
IComparer<T>, IComparer, IComparable<T> etc summary.md
@ninmonkey
ninmonkey / More-Piping.ps1
Last active May 29, 2022 18:05
Piping-Output-Powershell.ps1.md
function Embrace {
$Input | Join-String -op '[' -os ']'
}
Set-Alias 'Write-Color' Ninmonkey.Console\Write-ConsoleColorZd
Set-Alias 'Csv' -Value Csv2
& {
foreach ($x in 'a'..'f') {
"parent_id_$x.md"
@(
@JustinGrote
JustinGrote / Trace-AICommand.ps1
Last active July 28, 2025 08:17
Trace-AICommand: Report the results and performance of any scriptblock to Azure Application Insights
#requires -version 7
#You can load this script with $(iwr https://tinyurl.com/TraceAICommand | iex)
using namespace Microsoft.ApplicationInsights
using namespace Microsoft.ApplicationInsights.Extensibility
using namespace Microsoft.ApplicationInsights.DataContracts
using namespace System.Management.Automation
using namespace System.Collections.Generic
using namespace System.Net
#Reference: https://docs.microsoft.com/en-us/azure/azure-monitor/app/console