# Add-OfficeProjectDependency

Adds a finish-to-start relationship between two tasks.

Cmdlet 

Aliases: ProjectDependency

**Module**

`PSWriteOffice`

**Aliases**

`ProjectDependency`

**Inputs**

`OfficeIMO.Project.ProjectDocument`

**Outputs**

`OfficeIMO.Project.ProjectDependency`

**Source**

[AddOfficeProjectDependencyCommand.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Project/AddOfficeProjectDependencyCommand.cs#L18) 

Adds a finish-to-start relationship between two tasks.

## Syntax

```
Add-OfficeProjectDependency
[-Document <ProjectDocument>]
[-LagDays <Decimal>]
[-PassThru]
[-Predecessor] <OfficeProjectTaskSelector>
[-Successor] <OfficeProjectTaskSelector>
[-Type <FinishToFinish|FinishToStart|StartToFinish|StartToStart>]
[<CommonParameters>]
```

[#](#method-add-officeprojectdependency-projectdocument-decimal-switchparameter-officeprojecttaskselector-officeprojecttaskselector-projectdependencytype)

Parameter set: `Document`

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Project, Access, and EPUB Files](/docs/pswriteoffice/project-access-epub/) Guide
  
  Create and read Microsoft Project schedules, Access databases and EPUB books from PowerShell, without Project or Access installed.

## Examples

### Adds a finish-to-start relationship between two tasks.

```powershell
$project | Add-OfficeProjectDependency -Predecessor 1 -Successor 2
```

## Parameters

**-Document ProjectDocument optionalpipeline: True (ByValue)**

Project to inspect or change.

**-LagDays Decimal optional**

Working-day delay; negative values represent lead time.

**-PassThru SwitchParameter optional**

Return the created or changed object.

**-Predecessor OfficeProjectTaskSelector requiredposition: 0**

Predecessor task UID.

**-Successor OfficeProjectTaskSelector requiredposition: 1**

Successor task UID.

**-Type ProjectDependencyType optional**

Dependency relationship.

Possible values: `FinishToFinish`, `FinishToStart`, `StartToFinish`, `StartToStart`

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:712DB40E83D9866FD0A09CB13D7F67F1A73D053DF3652BDF57A7A2CDF9720D47 -->
