Skip to content

Instantly share code, notes, and snippets.

@JJK96
JJK96 / Get-ProcessPipes.ps1
Last active March 4, 2024 09:13 — forked from Wra7h/Get-ProcessPipes.ps1
Use PowerShell to get the PIDs associated with Named Pipes
function Get-ProcessPipes{
param(
[Parameter(Mandatory=$false)]
[string]$CSV,
[Parameter(Mandatory=$false)]
[switch]$All
)
Add-Type -TypeDefinition @"
using System;
//Based on https://gist.github.com/materi/f5b95f798b9012e135e3462d52d33d4c
Java.perform(function() {
var res2 = Java.use('okhttp3.Response$Builder');
var Buffer = Java.use('okio.Buffer');
var peek_size = 1000
var String = Java.use('java.lang.String');
res2.build.implementation = function() {
var response = this.build();