New-FilesRestore

Create Restore.

Syntax

New-FilesRestore -EarliestDate <System.DateTimeOffset> [-Prefix <System.String>] [-RestorationType <System.String>] [-RestoreDeletedPermissions <System.Boolean>] [-RestoreInPlace <System.Boolean>] [-UpdateTimestamps <System.Boolean>] [-WorkspaceId <System.Int64>] [-Connection <FilesCom.PowerShell.FilesConnection>] [-WorkspaceScope <System.Int64>] [-NoWorkspaceScope] [-WhatIf] [-Confirm] [<CommonParameters>]

Description

Create Restore.

The command supports -WhatIf, which describes the change without sending it to Files.com, and -Confirm, which asks before sending it.

Examples

Example 1: Create Restore

New-FilesRestore -EarliestDate (Get-Date).AddDays(30) -Prefix 'foo/bar/baz.txt' -RestorationType 'files'

Writes the restore returned.

Example 2: Preview the change

New-FilesRestore -EarliestDate (Get-Date).AddDays(30) -Prefix 'foo/bar/baz.txt' -RestorationType 'files' -WhatIf

Describes the change without sending anything to Files.com.

Parameters

-EarliestDate

Restore files or users deleted on or after this date/time. Don't set this earlier than you need. Can not be greater than 365 days prior to the restore request. Give a DateTime from Get-Date, a DateTimeOffset, or ISO 8601 text with an offset such as 2026-01-31T14:00:00Z.

  • Type: System.DateTimeOffset
  • Parameter sets: (All) (required)

-Prefix

Prefix of the files/folders to restore, or a case-insensitive username prefix for a user restore. A trailing slash selects that folder and its contents only; without it, the prefix matches any path beginning with that text. Do not use a leading slash. To restore all deleted items of the selected restoration type within the selected site or workspace scope, specify an empty string ('') or omit the field.

  • Type: System.String
  • Parameter sets: (All)

-RestorationType

Type of restoration to perform. files restores deleted filesystem items. users restores deleted users and associated authentication records, plus permissions when restore_deleted_permissions=true. A 5-minute grace period allows for batch deletion processes: associated records deleted within the 5 minutes before the user are included, even if removed independently. Records deleted earlier, or before earliest_date, remain deleted.

  • Type: System.String
  • Parameter sets: (All)

-RestoreDeletedPermissions

If true, a user restore restores permissions deleted along with the selected users, including permissions removed independently within the 5 minutes before user deletion. Permissions deleted earlier, or before earliest_date, remain deleted. An in-place file restore restores user and group permissions on returned folders and their subfolders that were deleted from the time of the folder's deletion through 24 hours afterward, including permissions removed independently within that window. File restores into a new folder do not restore permissions.

  • Type: System.Boolean
  • Parameter sets: (All)

-RestoreInPlace

If true, we will restore the files in place (into their original paths). If false, we will create a new restoration folder in the root and restore files there.

  • Type: System.Boolean
  • Parameter sets: (All)

-UpdateTimestamps

If true, we will update the last modified timestamp of restored files to today's date. If false, we might trigger File Expiration to delete the file again.

  • Type: System.Boolean
  • Parameter sets: (All)

-WorkspaceId

Workspace ID for a workspace-scoped restore. 0 means the default site-wide scope.

  • Type: System.Int64
  • Parameter sets: (All)

-Connection

The connection to use, from Connect-FilesAccount. Defaults to the connection of the -InputObject or -Continuation given, and otherwise to the current runspace's default connection.

  • Type: FilesCom.PowerShell.FilesConnection
  • Parameter sets: (All)

-WorkspaceScope

Runs this command's requests in this workspace, including workspace 0, instead of the connection's or, for an -InputObject, instead of the workspace the object was read in. The connection and the object are unchanged.

  • Type: System.Int64
  • Parameter sets: (All)

-NoWorkspaceScope

Runs this command's requests in no workspace, even if the connection has one. The connection itself is unchanged.

  • Type: System.Management.Automation.SwitchParameter
  • Parameter sets: (All)

-Confirm

Prompts you for confirmation before running the cmdlet.

  • Type: System.Management.Automation.SwitchParameter
  • Confirm impact: Medium. At the default $ConfirmPreference of High, the command runs without asking; -Confirm makes it ask before each change.

-WhatIf

Shows what the cmdlet would change without sending anything to Files.com.

  • Type: System.Management.Automation.SwitchParameter

Common Parameters

This cmdlet supports the PowerShell common parameters, such as -Verbose and -ErrorAction.

Inputs

None. The command takes no pipeline input.

Outputs

  • FilesCom.PowerShell.Models.Restore: the restore as Files.com returned it.

Notes

Failures are written as error records with IDs such as Files.NotFound or Files.Authentication. Run Get-Help about_FilesCom for connections, paging, errors and previewing changes.