# Add-OfficeProjectAssignment

Assigns a project resource to a task by stable UID.

Cmdlet 

Aliases: ProjectAssignment

**Module**

`PSWriteOffice`

**Aliases**

`ProjectAssignment`

**Inputs**

`OfficeIMO.Project.ProjectDocument`

**Outputs**

`OfficeIMO.Project.ProjectAssignment`

**Source**

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

Assigns a project resource to a task by stable UID.

## Syntax

```
Add-OfficeProjectAssignment
[-Document <ProjectDocument>]
[-PassThru]
[-Resource] <OfficeProjectResourceSelector>
[-Task] <OfficeProjectTaskSelector>
[-UnitsPercent <Decimal>]
[<CommonParameters>]
```

[#](#method-add-officeprojectassignment-projectdocument-switchparameter-officeprojectresourceselector-officeprojecttaskselector-decimal)

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

### Assigns a project resource to a task by stable UID.

```powershell
$project | Add-OfficeProjectAssignment -Task 1 -Resource 1 -UnitsPercent 50
```

## Parameters

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

Project to inspect or change.

**-PassThru SwitchParameter optional**

Return the created or changed object.

**-Resource OfficeProjectResourceSelector requiredposition: 1**

Stable resource UID.

**-Task OfficeProjectTaskSelector requiredposition: 0**

Stable task UID.

**-UnitsPercent Decimal optional**

Assignment units as a percentage.

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