Set-DeliveryOptimizationStatus
Sets the expiration time or pinning status of Delivery Optimization cached files.
Syntax
Default (Default)
Set-DeliveryOptimizationStatus
[[-FileId] <String>]
[[-Pin] <Boolean>]
[[-ExpireOn] <DateTime>]
[<CommonParameters>]
Description
The Set-DeliveryOptimizationStatus cmdlet changes the expiration time or pinning status of
files in the Delivery Optimization cache.
Use ExpireOn to extend the expiration of a specific file, or omit FileId to apply the expiration to all files. For downloads in progress, the expiration takes effect after the download completes.
Use Pin with FileId to pin or unpin a specific file. Delivery Optimization retains pinned files until their expiration and excludes them from cache quota calculations. Unpinned files are subject to normal cache management.
Specify at least one of Pin or ExpireOn. Pinning or unpinning requires FileId. When you specify both Pin and ExpireOn, the cmdlet changes the pinning status first. If expiration validation or the expiration update then fails, the pinning change isn't rolled back.
Examples
Example 1: Extend expiration for cached files
Set-DeliveryOptimizationStatus -ExpireOn (Get-Date).AddDays(7)
This command sets the cache expiration to seven days from now for all files.
Example 2: Pin a specific file and set its expiration
$fileId = '0123456789abcdef0123456789abcdef'
Set-DeliveryOptimizationStatus -FileId $fileId -Pin $true -ExpireOn (Get-Date).AddDays(7)
This command pins the specified file and sets its expiration to seven days from now.
Pinning happens first. If the expiration update fails, the file remains pinned.
Replace the example ID with a FileId returned by Get-DeliveryOptimizationStatus.
Example 3: Unpin a cached file
Set-DeliveryOptimizationStatus -FileId '0123456789abcdef0123456789abcdef' -Pin $false
This command unpins the specified file, making it subject to normal cache management.
Parameters
-ExpireOn
Specifies the cache expiration date and time. Specify an expiration less than 365 days from the current date and time. If you omit FileId, the expiration applies to all files. For files still downloading, the expiration takes effect when the download completes.
Parameter properties
| Type: | DateTime |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 3 |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-FileId
Specifies the ID of the file to update. Use Get-DeliveryOptimizationStatus to find file IDs.
This parameter is required when you specify Pin. If you specify only ExpireOn and omit
this parameter, the expiration applies to all 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 |
-Pin
Specifies whether to pin the file. Set this parameter to $true to pin or $false to unpin.
You must also specify FileId. Pinning fails if the file isn't eligible for peering.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 2 |
| 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 update status messages in the console.
Notes
Run this cmdlet from an elevated PowerShell session. Use Get-DeliveryOptimizationStatus to
check the resulting ExpireOn and IsPinned properties.