This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 { | |
| <# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
NewerOlder