Last active
December 6, 2019 17:16
-
-
Save DiHo78/3f405dfbac22aca556e096d5189d97de to your computer and use it in GitHub Desktop.
AzureBlockBlobStorageAccessTierChange.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Login-AzureRmAccount | |
$StgAcc = "HierkommtMeinStorageAccountNameRein" | |
$StgKey = "HierMeinGeheimerAccessKey" | |
$ctx = New-AzureStorageContext -StorageAccountName $StgAcc -StorageAccountKey $StgKey | |
#welche Cotnainer habe ich denn? | |
Get-AzureStorageContainer -Context $ctx | |
#wir picken uns mal einen heraus | |
$Container = "raw2016" | |
#Get all the blobs in container | |
$blob = Get-AzureStorageBlob -Container $Container -Context $ctx | Where-Object {($_.Name -like "*PASSCAMP*") -and ($_.name -notlike "*THUMB*") -and ($_.name -notlike "*.db*" )} | |
#$blob | ogv | |
#nur zum test bzgl. der laufzeit | |
get-date | |
#Set tier of all the blobs to Archive | |
$blob.icloudblob.setstandardblobtier("Archive") | |
#nur zum test bzgl. der laufzeit | |
get-date | |
#nochmal gucken | |
$blob = Get-AzureStorageBlob -Container $Container -Context $ctx | Where-Object {$_.Name -like "*PASSCAMP*"} | |
$blob | Out-GridView |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment