Requires PowerShell Pro Tools​
Packages, bundles and\or obfuscates scripts.
Merge-Script -Script <String> [-OutputPath <String>] [-Bundle] [-Package] [-Obfuscate]​Merge-Script -Config <Hashtable>​Merge-Script -ConfigFile <String>
Packages, bundles and\or obfuscates scripts. Packaging and bundling are not mutually exclusive. Obfuscation requires packaging.
PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\ -Package
Packages MyScript.ps1 into MyScript.exe and then outputs it to .\
PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\Bundle -Bundle
Bundles MyScript.ps1 and any scripts it dot sources into a single file and outputs it to .\Bundle.
PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\Bundle -Bundle -Package
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.
PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\Bundle -Bundle -Package -Obfuscate
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.
Bundles the script with dot sourced scripts found in the script.
Type: SwitchParameterParameter Sets: (All)Aliases:​Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
Config hashtable. More information found on about_MergeScriptConfig.
Type: HashtableParameter Sets: (All)Aliases:​Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
Config file. More information found on about_MergeScriptConfig.
Type: StringParameter Sets: (All)Aliases:​Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
Obfuscate the .NET executable and PowerShell script.
Type: SwitchParameterParameter Sets: (All)Aliases:​Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
The output path for the resulting script or executable. This should be a directory.
Type: StringParameter Sets: (All)Aliases:​Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
Package the script as a .NET executable.
Type: SwitchParameterParameter Sets: (All)Aliases:​Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
The script to package in an executable and optionally bundle with other scripts.
Type: StringParameter Sets: (All)Aliases:​Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False