# New-OfficeAccess

Creates a native Access database without a provider, seed file or execution.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Access.AccessDocument` `System.IO.FileInfo`

**Source**

[NewOfficeAccessCommand.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Access/NewOfficeAccessCommand.cs#L15) 

Creates a native Access database without a provider, seed file or execution.

## Syntax

```
New-OfficeAccess
[-Force]
[[-Path] <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-new-officeaccess-switchparameter-string-string-switchparameter-switchparameter)

Parameter set: `Live`

```
New-OfficeAccess
[-AllowLoss]
[-Content] <ScriptBlock>
[-Force]
[-PassThru]
[-Path] <String>
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-new-officeaccess-switchparameter-scriptblock-switchparameter-switchparameter-string-string-switchparameter-switchparameter)

Parameter set: `Content`

## Description

A path associates a live model without writing it; a content block atomically saves and closes it. The .mdb or .accdb extension selects the native file family.

## 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.
- [Reliable Automation Patterns](/docs/pswriteoffice/automation-patterns/) Guide
  
  Structure document jobs for repeatability, diagnostics, safe mutation, and CI artifacts. Includes examples and cmdlet links.

## Examples

### Create a contacts table.

```powershell
New-OfficeAccess -Path ./Contacts.accdb {
    AccessTable Contacts { AccessColumn ContactId -Type AutoNumber; AccessColumn DisplayName -MaxLength 100 }
}
```

## Parameters

**-Force SwitchParameter optional**

Permit replacement of the associated destination.

**-Path String required in Contentposition: 0**

Optional live association; required for a completed content block.

**-Title String optional**

Database title.

**-WhatIf SwitchParameter optional**

Shows what would happen if the command runs.

**-Confirm SwitchParameter optional**

Prompts for confirmation before running the command.

**-AllowLoss SwitchParameter optionalsets: Content**

Accept reductions reported by native save.

**-Content ScriptBlock requiredposition: 1sets: Content**

Authoring block completed before atomic publication.

**-PassThru SwitchParameter optionalsets: Content**

Return the saved FileInfo after the block completes.

## 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:95ACD2D0F2B53D8C9C614D8CE1FBD9BEC90BFC9A2B32C715C0B6657EC16C7A01 -->
