Public/PostToX.ps1

function PostToX {
    param(
        [Parameter(ValueFromPipeline)]
        $UserInput,
        [Switch]$Chat
    )

    Process { $lines += @($UserInput) } 

    End {
        $instructions = @"
# IDENTITY and PURPOSE
 
Pls be brief. Post to X (aka twitter). X (aka twitter) has a 280 char limit that you must respect
"@

        if($Chat) {
            'Time to chat'
        } 
        else {
            $lines | Invoke-OAIChat $instructions
        }
    }
}