Merge-Script

SYNOPSIS

Packages, bundles and\or obfuscates scripts.

SYNTAX

1
Merge-Script -Script <String> [-OutputPath <String>] [-Bundle] [-Package] [-Obfuscate]
2
3
Merge-Script -Config <Hashtable>
4
5
Merge-Script -ConfigFile <String>
Copied!

DESCRIPTION

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

EXAMPLES

Example 1

1
PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\ -Package
Copied!
Packages MyScript.ps1 into MyScript.exe and then outputs it to .\

Example 2

1
PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\Bundle -Bundle
Copied!
Bundles MyScript.ps1 and any scripts it dot sources into a single file and outputs it to .\Bundle.

Example 3

1
PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\Bundle -Bundle -Package
Copied!
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

1
PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\Bundle -Bundle -Package -Obfuscate
Copied!
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.
1
Type: SwitchParameter
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: False
6
Position: Named
7
Default value: None
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-Config

Config hashtable. More information found on about_MergeScriptConfig.
1
Type: Hashtable
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: True
6
Position: Named
7
Default value: None
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-ConfigFile

Config file. More information found on about_MergeScriptConfig.
1
Type: String
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: True
6
Position: Named
7
Default value: None
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-Obfuscate

Obfuscate the .NET executable and PowerShell script.
1
Type: SwitchParameter
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: False
6
Position: Named
7
Default value: None
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-OutputPath

The output path for the resulting script or executable. This should be a directory.
1
Type: String
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: False
6
Position: Named
7
Default value: None
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-Package

Package the script as a .NET executable.
1
Type: SwitchParameter
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: False
6
Position: Named
7
Default value: None
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

-Script

The script to package in an executable and optionally bundle with other scripts.
1
Type: String
2
Parameter Sets: (All)
3
Aliases:
4
5
Required: True
6
Position: Named
7
Default value: None
8
Accept pipeline input: False
9
Accept wildcard characters: False
Copied!

INPUTS

None

OUTPUTS

System.Object

NOTES

RELATED LINKS

Last modified 2yr ago