Edit

Share via


Clear-AzRedisCache

Flush all data from an Azure Cache for Redis instance.

Syntax

NormalParameterSet

Clear-AzRedisCache
    -Name <String>
    [-ResourceGroupName <String>]
    [-Force]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ResourceIdParameterSet

Clear-AzRedisCache
    -ResourceId <String>
    [-Force]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

RedisCacheAccessPolicyObject

Clear-AzRedisCache
    -InputObject <RedisCacheAttributes>
    [-Force]
    [-PassThru]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Clear-AzRedisCache cmdlet flushes all data of an Azure Redis Cache instance.

Examples

Example: Flush all data from a redis cache

Clear-AzRedisCache -ResourceGroupName "ResourceGroup13" -Name "RedisCache06"

This command flushes all data from the redis cache named RedisCache06 in the resource group named ResourceGroup13.

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

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

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

-Force

Do not ask for confirmation.

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

-InputObject

Object of type RedisCacheAttributes

Parameter properties

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

Parameter sets

RedisCacheAccessPolicyObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Name of redis cache.

Parameter properties

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

Parameter sets

NormalParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PassThru

Indicates that this cmdlet returns a Boolean that indicates whether the operation succeeds. By default, this cmdlet does not generate any output.

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

-ResourceGroupName

Name of resource group under which cache exists.

Parameter properties

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

Parameter sets

NormalParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceId

ARM Id of Redis Cache

Parameter properties

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

Parameter sets

ResourceIdParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
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

String

Outputs

Boolean