Edit

Delete-DeliveryOptimizationCache

Deletes files from the Delivery Optimization cache.

Syntax

Default (Default)

Delete-DeliveryOptimizationCache
    [[-FileId] <String>]
    [-IncludePinnedFiles]
    [-Force]
    [<CommonParameters>]

Description

The Delete-DeliveryOptimizationCache cmdlet deletes cached Delivery Optimization files and their associated persisted data. By default, the cmdlet doesn't delete pinned files.

Use the FileId parameter to delete a specific file. If you omit FileId, the cmdlet deletes all eligible files in the cache. Use IncludePinnedFiles to also delete pinned files.

The cmdlet prompts before deleting files unless you specify Force. Deletion can't be undone.

Examples

Example 1: Clear the cache without deleting pinned files

Delete-DeliveryOptimizationCache

This command prompts for confirmation, then deletes unpinned files from the cache.

Example 2: Delete a specific cached file

Delete-DeliveryOptimizationCache -FileId '0123456789abcdef0123456789abcdef'

This command prompts before deleting the specified file. Replace the example ID with a FileId that Get-DeliveryOptimizationStatus returns.

Example 3: Delete all cached files, including pinned files

Delete-DeliveryOptimizationCache -IncludePinnedFiles -Force

This command deletes both pinned and unpinned files without prompting.

Parameters

-FileId

Specifies the ID of the cached file to delete. Use Get-DeliveryOptimizationStatus to find file IDs. If you omit this parameter, the cmdlet deletes all eligible cached files.

Parameter properties

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

Parameter sets

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

-Force

Deletes files without prompting for confirmation. This parameter doesn't allow deletion of pinned files unless you also specify IncludePinnedFiles.

Parameter properties

Type:SwitchParameter
Default value:False
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

-IncludePinnedFiles

Includes pinned files in the deletion. By default, the cmdlet preserves pinned files.

Parameter properties

Type:SwitchParameter
Default value:False
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

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

You can't pipe objects to this cmdlet.

Outputs

None

This cmdlet doesn't return objects. It shows deletion status messages in the console.

Notes

Run this cmdlet from an elevated PowerShell session.