Remove-SPOFileArchivePolicy

Removes (soft-deletes) a file archive policy.

Syntax

Default (Default)

Remove-SPOFileArchivePolicy
    -PolicyId <Guid>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet soft-deletes a file archive policy by setting its state to Deleted. The policy will no longer run after being removed. By default, the cmdlet prompts for confirmation before proceeding. Use the -Force parameter to bypass the confirmation prompt.

Note

This cmdlet is part of the file archive policies feature which is currently in preview.

Examples

Example 1

Remove-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Removes the specified file archive policy after prompting for confirmation.

Example 2

Remove-SPOFileArchivePolicy -PolicyId "a1b2c3d4-e5f6-7890-abcd-ef1234567890" -Force

Removes the specified file archive policy without prompting for confirmation.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Bypasses the confirmation prompt and removes the policy immediately.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PolicyId

Specifies the unique identifier (GUID) of the policy to remove.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

System.Object