$cs.Job_WriteLog
Description
Section titled “Description”Writes a line of text to the PowerPack log. In PowerPack scripts this must always be called with a single positional argument: $cs.Job_WriteLog("message").
Syntax
Section titled “Syntax”$cs.Job_WriteLog(string functionname = “”, string text = “”)
Parameters
Section titled “Parameters”functionname (String)
Section titled “functionname (String)”The message to write to the log. Despite the parameter name, PowerPack scripts should pass their log message here as the only argument.
text (String)
Section titled “text (String)”Not used by PowerPack scripts. The function technically accepts a second positional argument and would log it appended to functionname, but this two-argument/tag form (e.g. $cs.Job_WriteLog("Install:", "message")) must not be used in PowerPack scripts — always call Job_WriteLog with exactly one argument.
Return value
Section titled “Return value”None
Example
Section titled “Example”A few realistic one-line log messages at different stages of an install:
$cs.Log_SectionHeader('Install', 'o')$cs.Job_WriteLog("Starting installation of $global:AppName $global:AppRelease")$cs.Job_WriteLog("Installation of $global:AppName $global:AppRelease completed successfully")$cs.Job_WriteLog("Installation failed: setup.exe returned exit code $exitCode")Note: If
functionnameis literally"$",Job_WriteLoguses the currently active log section header instead of that literal text. This is an internal mechanism used byLog_SectionHeaderand is not something a script author needs to invoke directly.