@@ -15,11 +15,14 @@ The name of the Storage Account
1515. PARAMETER ContainerName
1616The names of one or more Containers to create in the Storage Account
1717
18+ . PARAMETER ContainerPermission
19+ The permission on the Container(s). The acceptable values are 'Container', 'Blob' or 'Off'
20+
1821. EXAMPLE
19- .\New-StorageAccountContainer.ps1 -Location "West Europe" -Name stracc -ContainerName public
22+ .\New-StorageAccountContainer.ps1 -Location "West Europe" -Name stracc -ContainerName public -ContainerPermission "Blob"
2023
2124. EXAMPLE
22- .\New-StorageAccountContainer.ps1 -Location "West Europe" -Name stracc -ContainerName public,private,images
25+ .\New-StorageAccountContainer.ps1 -Location "West Europe" -Name stracc -ContainerName public,private,images -ContainerPermission "Blob"
2326
2427#>
2528
@@ -30,7 +33,11 @@ Param(
3033 [Parameter (Mandatory = $true )]
3134 [String ]$Name ,
3235 [Parameter (Mandatory = $true )]
33- [String []]$ContainerName
36+ [String []]$ContainerName ,
37+ [Parameter (Mandatory = $false )]
38+ [ValidateSet (" Container" , " Blob" , " Off" )]
39+ [String ]$ContainerPermission = " Off"
40+
3441)
3542
3643try {
6269 if (! $ContainerExists ) {
6370 try {
6471 Write-Log - LogLevel Information - Message " Creating container $Container "
65- $null = New-AzureStorageContainer - Context $StorageAccountContext - Name $Container - Permission Off
72+ $null = New-AzureStorageContainer - Context $StorageAccountContext - Name $Container - Permission $ContainerPermission
6673 }
6774 catch {
6875 throw " Could not create container $Container : $_ "
0 commit comments