forked from bcafferky/shared
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
- Loading branch information
Showing
5 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
48 changes: 48 additions & 0 deletions
48
PowerShellQuickTips/PowerShellQuickTips1/ufn_demo_Blob.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
function New-udfAzureBlob { | ||
# | ||
# Warning: This code is for demostration only and should not be used | ||
# for production. No warrantees are implied and this code | ||
# is provided as is. | ||
# | ||
param ( | ||
[Parameter(Mandatory=$true)] | ||
[string]$ResourceGroupName, | ||
[Parameter(Mandatory=$true)] | ||
[string]$StorageAccountName, | ||
[Parameter(Mandatory=$true)] | ||
[string]$Location, | ||
[Parameter(Mandatory=$true)] | ||
[string]$SubscriptionName, | ||
[Parameter(Mandatory=$true)] | ||
[string]$ContainerName, | ||
[Parameter(Mandatory=$true)] | ||
[ValidateSet("Standard_LRS","Standard_ZRS","Standard_GRS", "Standard_RAGRS", "Premium_LRS")] | ||
[string]$SkuName | ||
) | ||
|
||
<# Sku Name Values: | ||
Standard_LRS. Locally-redundant storage. | ||
Standard_ZRS. Zone-redundant storage. | ||
Standard_GRS. Geo-redundant storage. | ||
Standard_RAGRS. Read access geo-redundant storage. | ||
Premium_LRS. Premium locally-redundant storage. | ||
#> | ||
|
||
Write-Verbose "Creating storage acccount: $StorageAccountName." | ||
# Create a new storage account. | ||
New-AzureRMStorageAccount -ResourceGroupName $ResourceGroupName –StorageAccountName $StorageAccountName -Location $Location -SkuName $SkuName -Kind Storage | ||
|
||
Start-Sleep -s 30 | ||
|
||
# Set a default storage account. | ||
Write-Verbose "Setting the default storage account: $StorageAccountName." | ||
Set-AzureRmCurrentStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName | ||
|
||
# Create a new container. | ||
Write-Verbose "Creating new container: $ContainerName." | ||
New-AzureStorageContainer -Name $ContainerName -Permission Off | ||
|
||
} | ||
|
||
|