# CMS_RemovePackageFromUnit

> Removes package from the unit.

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

### Description

Removes package from the unit

### Syntax

**VBScript**

```vb
CMS_RemovePackageFromUnit(sPackage, sVersion) As Boolean
```

**PowerShell**

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

### Parameters

#### sPackage (String)

Package name

#### sVersion (String)

Package version

### Return value

**VBScript**

Boolean, TRUE if function completed successfully.

**PowerShell**

Boolean, TRUE if function completed successfully.

### Example

**VBScript**

```vb
If bStatus Then bStatus = CMS_IsPackageLinked("CapaInstaller", "v1.0")
If bStatus And gbValue Then
  If bStatus Then bStatus = CMS_RemovePackageFromUnit("CapaInstaller", "v1.0")
End If
```

**PowerShell**

```powershell
if (CMS_RemovePackageFromUnit -package 'Lo Splendido Pacchetto IT' -version 'v1.0') {
  $cs.Job_WriteLog("Removed", "Lo Splendido Pacchetto IT is now unlinked")
}
```

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

### Related functions

[CMS_AddPackageToUnit](/capainstaller/vb-scripting-library/cms-functions/cms-addpackagetounit/) [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/)
