# $cs.Job_EnableLog

> Re-enables logging that was previously turned off with $cs.Job_DisableLog.

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

### Description

Re-enables logging that was previously turned off with [$cs.Job_DisableLog](/capainstaller/powerpacks/cs-job-disablelog/).

### Syntax

$cs.Job\_EnableLog(string text = null)

### Parameters

#### text (String)

Optional text to write to the log once, after logging is switched back on. If omitted, nothing is logged.

### Return value

None

### Example

**PowerShell**

Re-enable logging after a single suppressed check:

```powershell
$cs.Job_DisableLog("Temporarily disabling logging while checking for optional component")
$installed = $cs.MSI_IsMSIGuidInstalled('{AC76BA86-1033-FF00-7760-BC15014EA700}')
$cs.Job_EnableLog("Re-enabling logging")
```

Re-enable logging after wrapping a single noisy native command, and log a short summary of the result once logging is back on:

```powershell
$cs.Job_DisableLog("Silencing log while running vendor CLI health check")
$result = & "$global:Packageroot\tools\healthcheck.exe" --quiet
$exitCode = $LASTEXITCODE
$cs.Job_EnableLog("Health check finished with exit code $exitCode")
```

Wrap the suppressed section in `try`/`finally` so logging is guaranteed to be re-enabled even if the check throws an unexpected error:

```powershell
try {
  $cs.Job_DisableLog("Silencing log while checking for a flaky optional dependency")
  $installed = $cs.MSI_IsMSIGuidInstalled('{AC76BA86-1033-FF00-7760-BC15014EA700}')
} finally {
  $cs.Job_EnableLog("Re-enabling logging")
}
```

### Related functions

[$cs.Job_DisableLog](/capainstaller/powerpacks/cs-job-disablelog/)
