# CMS_RerunPackage

> Sets status for the specified package to 'Waiting' causing it to rerun the next time the Agent is being executed.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/cms-functions/cms-rerunpackage/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Sets status for the specified package to 'Waiting' causing it to rerun the next time the Agent is being executed.

### Syntax

**VBScript**

```vb
CMS_RerunPackage(sPackage, sVersion) as Boolean
```

**PowerShell**

```powershell
[bool]CMS_RerunPackage -package <string> -version <string>
```

### Parameters

#### sPackage (String)

Name of package

#### sVersion (String)

Version of package

### Return value

**VBScript**

Boolean, TRUE if function completed successfully.

**PowerShell**

Boolean, TRUE if function completed successfully.

### Example

**VBScript**

```vb
If bStatus Then bStatus = CMS_RerunPackage("CapaInstaller", "v1.0")
```

**PowerShell**

```powershell
if (CMS_RerunPackage -package 'Microsoft Office 366' -version 'v2.0') {
  $cs.Job_WriteLog("Waiting", "Office Leap year will be reinstalled on next agent run")
}
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/) [Business Unit support](/capainstaller/vb-scripting-library/addendum/business-unit-support/)
