# $cs.Job_WriteLog

> 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").

Source: https://docs.capaone.com/capainstaller/powerpacks/cs-job-writelog/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### 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

$cs.Job\_WriteLog(string functionname = "", string text = "")

### Parameters

#### 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)

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

None

### Example

**PowerShell**

A few realistic one-line log messages at different stages of an install:

```powershell
$cs.Log_SectionHeader('Install', 'o')
$cs.Job_WriteLog("Starting installation of $global:AppName $global:AppRelease")
```

```powershell
$cs.Job_WriteLog("Installation of $global:AppName $global:AppRelease completed successfully")
```

```powershell
$cs.Job_WriteLog("Installation failed: setup.exe returned exit code $exitCode")
```

> **Note:** If `functionname` is literally `"$"`, `Job_WriteLog` uses the currently active log section header instead of that literal text. This is an internal mechanism used by `Log_SectionHeader` and is not something a script author needs to invoke directly.

### Related functions

[$cs.Log_SectionHeader](/capainstaller/powerpacks/cs-log-sectionheader/) [Exit-PSScript](/capainstaller/powerpacks/exit-psscript/)
