Invoke-CPCCreateSnapshot
SYNOPSIS
Creates an on-demand snapshot for a Cloud PC
SYNTAX
Invoke-CPCCreateSnapshot [-Name] <String> [[-StorageAccountId] <String>] [[-AccessTier] <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
The function triggers an on-demand snapshot (restore point) for a specific Cloud PC via the Microsoft Graph Windows 365 createSnapshot API (beta). This is useful for creating a checkpoint before risky changes such as software installs, OS upgrades, or configuration changes.
Optionally, the snapshot can be exported to an Azure Blob Storage account by providing a StorageAccountId. When exporting, you can also specify the storage access tier (hot, cool, cold, archive).
EXAMPLES
EXAMPLE 1
Invoke-CPCCreateSnapshot -Name "CloudPC01"
EXAMPLE 2
Invoke-CPCCreateSnapshot -Name "CloudPC01" -StorageAccountId "/subscriptions/xxx/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/myaccount"
EXAMPLE 3
Invoke-CPCCreateSnapshot -Name "CloudPC01" -StorageAccountId "/subscriptions/xxx/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/myaccount" -AccessTier "cool"
PARAMETERS
-Name
Enter the display name or managed device name of the Cloud PC
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-StorageAccountId
Optional. The resource ID of the Azure Storage Account to which the snapshot should be exported. If omitted, the snapshot is kept in the Windows 365 service.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AccessTier
Optional. The blob access tier when exporting to a storage account. Valid values: hot, cool, cold, archive. Default: hot. Only used when StorageAccountId is provided.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: Hot
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
Requires CloudPC.ReadWrite.All permission (delegated or application). API reference: https://learn.microsoft.com/en-us/graph/api/cloudpc-createsnapshot?view=graph-rest-beta Note: This API is currently available in the /beta endpoint only.