Merge-Script

SYNOPSIS

Packages, bundles and\or obfuscates scripts.

SYNTAX

Merge-Script -Script <String> [-OutputPath <String>] [-Bundle] [-Package] [-Obfuscate]

Merge-Script -Config <Hashtable>

Merge-Script -ConfigFile <String>

DESCRIPTION

Packages, bundles and\or obfuscates scripts. Packaging and bundling are not mutually exclusive. Obfuscation requires packaging.

EXAMPLES

Example 1

Packages MyScript.ps1 into MyScript.exe and then outputs it to .\

Example 2

Bundles MyScript.ps1 and any scripts it dot sources into a single file and outputs it to .\Bundle.

Example 3

Bundles MyScript.ps1 and any scripts it dot sources into a single file and then packages it into MyScript.exe and outputs it to .\Bundle.

Example 4

Bundles MyScript.ps1 and any scripts it dot sources into a single file and then packages it into MyScript.exe and outputs it to .\Bundle. The resulting executable will be obfuscated.

PARAMETERS

-Bundle

Bundles the script with dot sourced scripts found in the script.

-Config

Config hashtable. More information found on about_MergeScriptConfig.

-ConfigFile

Config file. More information found on about_MergeScriptConfig.

-Obfuscate

Obfuscate the .NET executable and PowerShell script.

-OutputPath

The output path for the resulting script or executable. This should be a directory.

-Package

Package the script as a .NET executable.

-Script

The script to package in an executable and optionally bundle with other scripts.

INPUTS

None

OUTPUTS

System.Object

NOTES

Last updated