Edit

Share via


Invoke-AzStorageActionTaskPreviewAction

Runs the input conditions against input object metadata properties and designates matched objects in response.

Syntax

PreviewExpanded (Default)

Invoke-AzStorageActionTaskPreviewAction
    -Location <String>
    -Blob <IStorageTaskPreviewBlobProperties[]>
    [-SubscriptionId <String>]
    [-ActionElseBlockExist]
    [-ContainerMetadata <IStorageTaskPreviewKeyValueProperties[]>]
    [-ContainerName <String>]
    [-IfCondition <String>]
    [-DefaultProfile <PSObject>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

PreviewViaJsonString

Invoke-AzStorageActionTaskPreviewAction
    -Location <String>
    -JsonString <String>
    [-SubscriptionId <String>]
    [-DefaultProfile <PSObject>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

PreviewViaJsonFilePath

Invoke-AzStorageActionTaskPreviewAction
    -Location <String>
    -JsonFilePath <String>
    [-SubscriptionId <String>]
    [-DefaultProfile <PSObject>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

PreviewViaIdentityExpanded

Invoke-AzStorageActionTaskPreviewAction
    -InputObject <IStorageActionIdentity>
    -Blob <IStorageTaskPreviewBlobProperties[]>
    [-ActionElseBlockExist]
    [-ContainerMetadata <IStorageTaskPreviewKeyValueProperties[]>]
    [-ContainerName <String>]
    [-IfCondition <String>]
    [-DefaultProfile <PSObject>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Runs the input conditions against input object metadata properties and designates matched objects in response.

Examples

Example 1: Run the input conditions against input object metadata properties and designates matched objects

#create first blob
$creationTime = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Creation-Time" -Value "Wed, 07 Jun 2023 05:23:29 GMT"
$lastModified = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Last-Modified" -Value "Wed, 07 Jun 2023 05:23:29 GMT"
$etag = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Etag" -Value "0x8DB67175454D36D"
$contentLength = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Content-Length" -Value "38619"
$contentType = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Content-Type" -Value "text/xml"
$contentEncoding = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Content-Encoding" -Value ""
$contentLanguage = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Content-Language" -Value ""
$contentCRC64 = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Content-CRC64" -Value ""
$contentMD5 = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Content-MD5" -Value "njr6iDrmU9+FC89WMK22EA=="
$cacheControl = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Cache-Control" -Value ""
$contentDisposition = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Content-Disposition" -Value ""
$blobType = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "BlobType" -Value "BlockBlob"
$accessTier = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "AccessTier" -Value "Hot"
$accessTierInferred = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "AccessTierInferred" -Value "true"
$leaseStatus = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "LeaseStatus" -Value "unlocked"
$leaseState = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "LeaseState" -Value "available"
$serverEncrypted = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "ServerEncrypted" -Value "true"
$tagCount = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "TagCount" -Value "1"
$metadata = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "mKey1" -Value "mValue1"
$tags = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "tKey1" -Value "tValue1"
$blob1 = New-AzStorageActionTaskPreviewBlobPropertiesObject -Name 'folder1/file1.txt' -Metadata $metadata -Property $creationTime -Tag $tags
#create second blob
$creationTime2 = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "Creation-Time" -Value "Wed, 06 Jun 2023 05:23:29 GMT"
$metadata2 = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "mKey2" -Value "mValue2"
$tags2 = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "tKey2" -Value "tValue2"
$blob2 = New-AzStorageActionTaskPreviewBlobPropertiesObject -Name 'folder2/file1.txt' -Metadata $metadata2 -Property $creationTime2 -Tag $tags2

$conmetadata = New-AzStorageActionTaskPreviewKeyValuePropertiesObject -Key "mContainerKey1" -Value "mContainerValue1"
Invoke-AzStorageActionTaskPreviewAction -Location eastus2euap -ActionElseBlockExist -Blob $blob1,$blob2 -ContainerMetadata $conmetadata -ContainerName firstContainer -IfCondition "[[equals(AccessTier, 'Hot')]]"
ActionElseBlockExist : True
Blob                 : {{
                         "name": "folder1/file1.txt",
                         "properties": [
                           {
                             "key": "Creation-Time",
                             "value": "Wed, 07 Jun 2023 05:23:29 GMT"
                           },
                           {
                             "key": "Last-Modified",
                             "value": "Wed, 07 Jun 2023 05:23:29 GMT"
                           },
                           {
                             "key": "Etag",
                             "value": "0x8DB67175454D36D"
                           },
                           {
                             "key": "Content-Length",
                             "value": "38619"
                           },
                           {
                             "key": "Content-Type",
                             "value": "text/xml"
                           },
                           {
                             "key": "Content-Encoding",
                             "value": ""
                           },
                           {
                             "key": "Content-Language",
                             "value": ""
                           },
                           {
                             "key": "Content-CRC64",
                             "value": ""
                           },
                           {
                             "key": "Content-MD5",
                             "value": "njr6iDrmU9+FC89WMK22EA=="
                           },
                           {
                             "key": "Cache-Control",
                             "value": ""
                           },
                           {
                             "key": "Content-Disposition",
                             "value": ""
                           },
                           {
                             "key": "BlobType",
                             "value": "BlockBlob"
                           },
                           {
                             "key": "AccessTier",
                             "value": "Hot"
                           },
                           {
                             "key": "AccessTierInferred",
                             "value": "true"
                           },
                           {
                             "key": "LeaseStatus",
                             "value": "unlocked"
                           },
                           {
                             "key": "LeaseState",
                             "value": "available"
                           },
                           {
                             "key": "ServerEncrypted",
                             "value": "true"
                           },
                           {
                             "key": "TagCount",
                             "value": "1"
                           }
                         ],
                         "metadata": [
                           {
                             "key": "mKey1",
                             "value": "mValue1"
                           }
                         ],
                         "tags": [
                           {
                             "key": "tKey1",
                             "value": "tValue1"
                           }
                         ],
                         "matchedBlock": "If"
                       }, {
                         "name": "folder2/file1.txt",
                         "properties": [
                           {
                             "key": "Creation-Time",
                             "value": "Wed, 06 Jun 2023 05:23:29 GMT"
                           },
                           {
                             "key": "Last-Modified",
                             "value": "Wed, 06 Jun 2023 05:23:29 GMT"
                           },
                           {
                             "key": "Etag",
                             "value": "0x6FB67175454D36D"
                           }
                         ],
                         "metadata": [
                           {
                             "key": "mKey2",
                             "value": "mValue2"
                           }
                         ],
                         "tags": [
                           {
                             "key": "tKey2",
                             "value": "tValue2"
                           }
                         ],
                         "matchedBlock": "Else"
                       }}
ContainerMetadata    : {{
                         "key": "mContainerKey1",
                         "value": "mContainerValue1"
                       }}
ContainerName        : firstContainer
IfCondition          : [[equals(AccessTier, 'Hot')]]

This command runs the input conditions against input object metadata properties and designates matched objects.

Parameters

-ActionElseBlockExist

Specify whether the else block is present in the condition.

Parameter properties

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

Parameter sets

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

-Blob

Properties of some sample blobs in the container to test for matches with the preview action.

Parameter properties

Type:

IStorageTaskPreviewBlobProperties[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

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

-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

-ContainerMetadata

metadata key value pairs to be tested for a match against the provided condition.

Parameter properties

Type:

IStorageTaskPreviewKeyValueProperties[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PreviewExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PreviewViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ContainerName

Name of test container

Parameter properties

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

Parameter sets

PreviewExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PreviewViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases: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

-IfCondition

Storage task condition to bes tested for a match.

Parameter properties

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

Parameter sets

PreviewExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PreviewViaIdentityExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Identity Parameter

Parameter properties

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

Parameter sets

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

-JsonFilePath

Path of Json file supplied to the Preview operation

Parameter properties

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

Parameter sets

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

-JsonString

Json string supplied to the Preview operation

Parameter properties

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

Parameter sets

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

-Location

The location to perform preview of the actions.

Parameter properties

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

Parameter sets

PreviewExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PreviewViaJsonString
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PreviewViaJsonFilePath
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SubscriptionId

The ID of the target subscription. The value must be an UUID.

Parameter properties

Type:String
Default value:(Get-AzContext).Subscription.Id
Supports wildcards:False
DontShow:False

Parameter sets

PreviewExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PreviewViaJsonString
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PreviewViaJsonFilePath
Position:Named
Mandatory:False
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

IStorageActionIdentity

Outputs

IStorageTaskPreviewAction