Skip to content

Instantly share code, notes, and snippets.

@jborean93
jborean93 / Get-AppExecAlias.ps1
Created August 28, 2026 02:15
Gets the App Exec Alias reparse data buffer into a structured value
# Copyright: (c) 2026, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
function Get-AppExecAlias {
<#
.SYNOPSIS
Gets the reparse data buffer details of an app exec alias.
.PARAMETER Name
Either the path to the app exec alias or the name of the alias to check.
@jborean93
jborean93 / Test-IsOutputCaptured.ps1
Last active August 17, 2026 04:25
Check to see if the output is being captured.
# Copyright: (c) 2026, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
function Test-IsOutputCaptured {
<#
.SYNOPSIS
Tests if output is being captured by PowerShell or not.
.DESCRIPTION
This is used to see if the output is being captured or piped in any way
@jborean93
jborean93 / Get-StatX.ps1
Created July 27, 2026 03:22
Calls statx on Linux Platforms from PowerShell.
# Copyright: (c) 2026, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
function Get-StatX {
<#
.SYNOPSIS
Get the statx values for the provided path.
.DESCRIPTION
Gets the statx values for the provided path into a structured object.
@jborean93
jborean93 / AsyncPSCmdlet-Examples.cs
Created July 1, 2026 05:41
A POC to illustrate how a binary cmdlet could change how cmdlets are defined and written in C#
using System;
using System.Management.Automation;
using System.Threading;
using System.Threading.Tasks;
using Jborean.PwshAsync.Generators;
namespace SampleCmdlet.Examples;
[AsyncPSCmdlet(VerbsDiagnostic.Test, "SimpleNoOutput")]
public partial class SimpleCmdletNoOutput
@jborean93
jborean93 / SMBIOS.ps1
Created May 18, 2026 03:36
Get and parse SMBIOS data using PowerShell
# Copyright: (c) 2026, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
function Get-RawSmbiosData {
[OutputType([byte[]])]
[CmdletBinding()]
param ()
Add-Type -TypeDefinition @'
using System;
@jborean93
jborean93 / credssp_server.py
Created March 18, 2026 10:32
CredSSP Test Server
#!/usr/bin/env -S uv run --script
# Copyright: (c) 2026, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
# /// script
# dependencies = [
# "gssapi",
# "krb5",
# "cryptography",
@jborean93
jborean93 / Get-LogonSessionData.ps1
Last active October 16, 2025 21:21
Gets the LSA logon session data
# Copyright: (c) 2025, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
# Added GetLastErrorRecord
#Requires -Module @{ ModuleName = 'Ctypes'; ModuleVersion = '0.3.0' }
using namespace System.ComponentModel
using namespace System.Management.Automation
using namespace System.Runtime.InteropServices
using namespace System.Security.Principal
@jborean93
jborean93 / Add-DebuggableType.ps1
Last active August 20, 2025 12:08
Compiles C# code that can be debugged through a .NET Debugger
# Copyright: (c) 2025, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
using namespace Microsoft.CodeAnalysis
using namespace Microsoft.CodeAnalysis.CSharp
using namespace Microsoft.CodeAnalysis.Emit
using namespace Microsoft.CodeAnalysis.Text
using namespace Microsoft.PowerShell.Commands
using namespace System.Collections.Generic
using namespace System.IO
@jborean93
jborean93 / Disable-CertTrustCallback.ps1
Created July 1, 2025 21:40
Various ways of ignoring self signed certificates in Windows PowerShell 5.1
# Copyright: (c) 2025, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
using namespace System.Net
using namespace System.Net.Security
Function Disable-CertificateTrust {
[CmdletBinding()]
param ()
@jborean93
jborean93 / Import-PemEncodedRsaKey.ps1
Created June 30, 2025 20:21
Imports a PEM encoded RSA private key in PowerShell, supports PowerShell 5.1
# Copyright: (c) 2025, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
using namespace System.IO
using namespace System.Management.Automation
using namespace System.Net
using namespace System.Security.Cryptography
Function Import-PemEncodedRsaKey {
<#