PowerShell Pro Tools
Ironman SoftwareGitHub
  • About
  • System Requirements
  • PowerShell Tools Documentation
    • Visual Studio
      • Analysis
      • Debugging
        • Local Debugging
        • Remote Debugging
      • Format Document
      • Go to Definition
      • Packaging in Visual Studio
      • PowerShell 7 Support
      • PowerShell Interactive Window
      • Project System
        • Advanced
        • Debug
        • Build Events
      • Settings
        • General
        • .editorconfig
        • Analysis
        • Diagnostics
      • Tool Windows
      • Refactoring
      • Unit Test Adapter
      • User Interface Design
        • Windows Forms
  • PowerShell Pro Tools Documentation
    • Visual Studio Code
      • Automating Visual Studio Code
      • Code Conversion
      • Debugging
        • Run in New Terminal
        • One-Click Attach
      • Decompiler
      • Diagnostics
      • Enhanced Hover
      • Generating a UI from a function
      • Generate a Tool from a Function
      • Packaging in Visual Studio Code
      • Pin Session
      • PowerShell Explorer
      • Profiler
      • Sign On Save
      • RapidSense
      • Refactoring
      • Rename Symbols
      • Quick Scripts
      • Windows Forms Designer
    • Installers
    • Packaging
      • Package.psd1
      • PowerShell Packager
      • Package Hosts
      • Package as Service
      • Packaging on Linux
      • Packaging on Mac OS X
      • Continuous Integration
      • Anti-Virus
    • PowerShell Module
      • Global Hotkeys
      • Show-PSEditor
      • Show-PSScriptPad
      • Show-TUIDesigner
      • ConvertTo-CSharp
      • ConvertTo-PowerShell
      • Merge-Script
      • Install-PoshProToolsLicense
      • about_MergeScriptConfig
      • Show-WinFormDesigner
    • PowerShell Protect
      • Getting Started
      • Installation
      • Actions
      • Rules
      • Configuration
    • PSCommander
    • PSScriptPad
    • Installation and Licensing
      • Visual Studio Offline Installation
  • Changelog
    • PowerShell Tools for Visual Studio
    • PowerShell Pro Tools for Visual Studio Code
    • PowerShell Packager
    • PSScriptPad
    • PowerShell Pro Tools Module
Powered by GitBook
On this page
  • SYNOPSIS
  • SYNTAX
  • DESCRIPTION
  • EXAMPLES
  • Example 1
  • Example 2
  • Example 3
  • Example 4
  • PARAMETERS
  • -Bundle
  • -Config
  • -ConfigFile
  • -Obfuscate
  • -OutputPath
  • -Package
  • -Script
  • INPUTS
  • None
  • OUTPUTS
  • System.Object
  • NOTES
  • RELATED LINKS
  1. PowerShell Pro Tools Documentation
  2. PowerShell Module

Merge-Script

PreviousConvertTo-PowerShellNextInstall-PoshProToolsLicense

Last updated 6 years ago

Requires

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

PS C:\> Merge-Script -Script .\MyScript.ps1 -Output .\ -Package

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

Example 2

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.

Example 3

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.

Example 4

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.

PARAMETERS

-Bundle

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

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Config

Config hashtable. More information found on about_MergeScriptConfig.

Type: Hashtable
Parameter Sets: (All)
Aliases: 

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ConfigFile

Config file. More information found on about_MergeScriptConfig.

Type: String
Parameter Sets: (All)
Aliases: 

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Obfuscate

Obfuscate the .NET executable and PowerShell script.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OutputPath

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

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Package

Package the script as a .NET executable.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Script

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

Type: String
Parameter Sets: (All)
Aliases: 

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

INPUTS

None

OUTPUTS

System.Object

NOTES

RELATED LINKS

PowerShell Pro Tools