Skip to content

ConvertTo-PostBase64Command #24

@GraphiteWingedBird

Description

@GraphiteWingedBird

I was just about to create some functions to convert commands and .ps1 files to base64 and, if needed, compress them - and then I happened upon your repository.

While I'll probably still fork some of this and use my own functions, I wanted to let you know that at this point I think your Length check on $encodedCommand is possibly too restrictive. Based on my own testing and a great answer on StackOverflow the length in the 8100 character range would be specific to typing directly into cmd.exe or using something that calls cmd /c.

At least for my purposes, I'm going to be creating .bat files and it looks like most of your commands that use $encodedCommand would hit the much higher length issue of ~32,000 characters. Obviously if what you have works, no reason to change it, but just wanted you to know!

        # If to long tell the user
        if ($encodedCommand.Length -gt 8100)
        {
            Write-Warning "Encoded command may be to long to run vian -EncodedCommand of Powershell.exe"
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions