Skip to content

Instantly share code, notes, and snippets.

@hikoma
Last active August 29, 2015 14:00
Show Gist options
  • Save hikoma/030c6ae13f627ae643f7 to your computer and use it in GitHub Desktop.
Save hikoma/030c6ae13f627ae643f7 to your computer and use it in GitHub Desktop.
Function ConvertFrom-Base64String {
[CmdletBinding()]
Param (
[Parameter(Mandatory=$True, ValueFromPipeline=$True)]
[ValidateNotNullOrEmpty()]
[string] $Base64String
)
Process {
$bytes = [System.Convert]::FromBase64String($Base64string)
[System.Text.Encoding]::UTF8.GetString($bytes)
}
}
Function Get-WcfPipe {
[CmdletBinding()]
Param (
[string] $HandleExePath = "C:\opt\SysinternalsSuite\handle.exe"
)
Process {
& $HandleExePath net.pipe:Ebm | Select-String net.pipe:Ebm | Foreach-Object {
$pipe = ConvertFrom-Base64String ($_ -split 'net.pipe:E')[1]
[PSCustomObject] @{ Pipe = $pipe; Handle = $_ }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment