Skip to content

Instantly share code, notes, and snippets.

@jborean93
jborean93 / msix-jobs.ps1
Created November 18, 2026 10:59
POC for testing MSIX activation with jobs
[CmdletBinding()]
param(
[string]$Alias = "$env:LOCALAPPDATA\Microsoft\WindowsApps\pwsh.exe"
)
$ErrorActionPreference = 'Stop'
Add-Type -TypeDefinition @'
using System;
using System.ComponentModel;
@jborean93
jborean93 / Install-PowerShell7.ps1
Created November 12, 2026 01:44
A script that can install the PowerShell 7 version specified with a symlink for selecting the version
# Copyright: (c) 2026, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
using namespace System.IO
using namespace System.Runtime.InteropServices
using namespace Microsoft.Win32
#Requires -RunAsAdministrator
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
@jborean93
jborean93 / New-PSSessionEditCallback.ps1
Last active October 14, 2026 02:10
Opens a PSSession with support for local callback operations.
# Copyright: (c) 2026, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
using namespace System.Management.Automation
# Requires New-PSSessionWithCallback.ps1 to be loaded first for New-PSSessionCallback
# and Enter-PSSessionWithCallback.
function New-PSSessionEditCallback {
<#
@jborean93
jborean93 / Edit-Profile.ps1
Created September 30, 2026 10:17
Proof of concept for resetting a profile after editing. Profile changes only apply to the caller so cannot be within another function
New-Module -Name ProfileUtil -ScriptBlock {
# This must live in a module. A module function runs in the module's
# session state, leaving the caller's session state (and its current
# scope) untouched, so the profile can be dot-sourced back into it.
# As a plain function it would share the caller's session state and
# the profile would load into the function's own scope instead.
function Edit-Profile {
[CmdletBinding()]
param()
@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",