Package.psd1
About
Config File Schema
@{
Root = 'c:\Users\Adam\Desktop\service.ps1' # Root script to package. This is the main entry point for the package.
OutputPath = 'c:\Users\Adam\Desktop\out' # The output directory for the packaging process.
Package = @{
Enabled = $true # Whether to package as an executable.
Obfuscate = $false # Whether to obfuscate the resulting executable.
HideConsoleWindow = $false # Whether to hide the console window. Only valid for console applications.
# The target .NET Framework version. You will need the .NET Developer Pack for this version installed on your machine.
# If target PowerShell 7, you can also use netcoreapp31 here
DotNetVersion = 'v4.6.2'
FileVersion = '1.0.0' # The output file version
FileDescription = '' # The output file description
ProductName = '' # The output file product name
ProductVersion = '' # The output file product version.
Copyright = '' # The output file copyright
RequireElevation = $false # Whether to require elevation when running the executable. Only valid for console applications.
ApplicationIconPath = '' # The path to the application icon to use for the executable.
PackageType = 'Console' # The type of executable to generate. Valid values are Service or Console.
ServiceName = "" # The name of the service if the package type is Service.
ServiceDisplayName = "" # The display name of the service if the package type is Service.
HighDPISupport = $true # Whether to enable high DPI support for WinForm applications
PowerShellArguments = '' # Sets the arguments for the PowerShell process that is hosted within the executable. You can use arguments like -NoExit, -ExecutionPolicy and -NoProfile.
Platform = 'x64' # Sets the architecture of the executable. Can be either 'x86' or 'x64'
PowerShellVersion = 'Windows PowerShell' # You can specify Windows PowerShell or PowerShell 7 or later versions version (e.g. 7.0.0)
RuntimeIdentifier = 'win-x64' # You can specify other runtimes like linux-x64 (See .NET Core runtime identifiers)
DisableQuickEdit = $false # Disables the quick edit mode on windows console apps
Resources = [string[]]@() # Resources to embed in the output executable
Host = 'Default' # The PowerShell Host to use.
Lightweight = $false # Removes WPF and WinForm support in PowerShell 7 executables.
}
Bundle = @{
Enabled = $true # Whether to bundle multiple PS1s into a single PS1. Always enabled when Package is enabled.
Modules = $true # Whether to bundle modules into the package
}
}
Using a config file
Options
Root
OutputPath
Package
Enabled
Obfuscate
HideConsoleWindow
DotNetVersion
PowerShell Version
Valid .NET Versions
FileVersion
FileDescription
ProductName
ProductVersion
Copyright
RequireElevation
ApplicationIconPath
PackageType
ServiceName
ServiceDisplayName
HighDPISupport
PowerShellArguments
Platform
PowerShellVersion
RuntimeIdentifier
DisableQuickEdit
Resources
DotNetSdk
Certificate
OutputName
Host
Bundle
Enabled
Modules
NestedModules
IgnoredModules
EXAMPLES
Create console application
Ironman Software Host
Create a service
Package PowerShell 7.0
Package PowerShell 7.1
Package PowerShell 7.2
Package PowerShell 7.3
Package PowerShell 7.4
Bundle resources in a WPF application
Access Resources in Your Script
Adding an Icon to a WPF Window


Last updated