Skip to content

Commit 55f335c

Browse files
authored
Merge pull request #86439 from wmgries/remove-new-context
Remove New-AzStorageContext from example
2 parents f798e3a + 4e26696 commit 55f335c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

articles/storage/files/storage-how-to-create-file-share.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,26 @@ To create an Azure file share, you can use a Storage Account that already exists
3939

4040

4141
## Create file share through PowerShell
42-
43-
[!INCLUDE [updated-for-az](../../../includes/updated-for-az.md)]
44-
45-
To prepare to use PowerShell, download and install the Azure PowerShell cmdlets. See [How to install and configure Azure PowerShell](https://azure.microsoft.com/documentation/articles/powershell-install-configure/) for the install point and installation instructions.
42+
To prepare to use PowerShell, download and install the Azure PowerShell cmdlets. See [How to install and configure Azure PowerShell](https://docs.microsoft.com/powershell/azure/overview) for the install point and installation instructions.
4643

4744
> [!Note]
4845
> It's recommended that you download and install or upgrade to the latest Azure PowerShell module.
4946
50-
1. **Create a context for your storage account and key**
51-
The context encapsulates the storage account name and account key. For instructions on copying your account key from the [Azure portal](https://portal.azure.com/), see [Storage account access keys](../common/storage-account-manage.md#access-keys).
47+
1. **Create a new storage account:**
48+
A storage account is a shared pool of storage in which you can deploy Azure file shares as well as other storage resources, such as blobs or queues.
5249

53-
```powershell
54-
$storageContext = New-AzStorageContext <storage-account-name> <storage-account-key>
50+
```PowerShell
51+
$resourceGroup = "myresourcegroup"
52+
$storAcctName = "myuniquestorageaccount"
53+
$region = "westus2"
54+
$storAcct = New-AzStorageAccount -ResourceGroupName $resourceGroup -Name $storAcctName -SkuName Standard_LRS -Location $region -Kind StorageV2
5555
```
56-
56+
5757
2. **Create a new file share**:
5858
5959
```powershell
60-
$share = New-AzStorageShare logs -Context $storageContext
60+
$shareName = "myshare"
61+
$share = New-AzStorageShare -Context $storAcct.Context -Name $shareName
6162
```
6263
6364
> [!Note]

0 commit comments

Comments
 (0)