Skip to content

Commit 08b6b2a

Browse files
committed
Adding 'Try-It' to PowerShell examples
1 parent 244b791 commit 08b6b2a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

articles/azure-resource-manager/resource-group-lock-resources.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.workload: multiple
1313
ms.tgt_pltfrm: na
1414
ms.devlang: na
1515
ms.topic: conceptual
16-
ms.date: 02/21/2018
16+
ms.date: 11/08/2018
1717
ms.author: tomfitz
1818
---
1919

@@ -100,7 +100,7 @@ The following example shows a template that creates an app service plan, a web s
100100

101101
To deploy this example template with PowerShell, use:
102102

103-
```powershell
103+
```azurepowershell-interactive
104104
New-AzureRmResourceGroup -Name sitegroup -Location southcentralus
105105
New-AzureRmResourceGroupDeployment -ResourceGroupName sitegroup -TemplateUri https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/lock.json -hostingPlanName plan0103
106106
```
@@ -117,37 +117,37 @@ You lock deployed resources with Azure PowerShell by using the [New-AzureRmResou
117117

118118
To lock a resource, provide the name of the resource, its resource type, and its resource group name.
119119

120-
```powershell
120+
```azurepowershell-interactive
121121
New-AzureRmResourceLock -LockLevel CanNotDelete -LockName LockSite -ResourceName examplesite -ResourceType Microsoft.Web/sites -ResourceGroupName exampleresourcegroup
122122
```
123123

124124
To lock a resource group, provide the name of the resource group.
125125

126-
```powershell
126+
```azurepowershell-interactive
127127
New-AzureRmResourceLock -LockName LockGroup -LockLevel CanNotDelete -ResourceGroupName exampleresourcegroup
128128
```
129129

130130
To get information about a lock, use [Get-​Azure​Rm​Resource​Lock](/powershell/module/azurerm.resources/get-azurermresourcelock). To get all the locks in your subscription, use:
131131

132-
```powershell
132+
```azurepowershell-interactive
133133
Get-AzureRmResourceLock
134134
```
135135

136136
To get all locks for a resource, use:
137137

138-
```powershell
138+
```azurepowershell-interactive
139139
Get-AzureRmResourceLock -ResourceName examplesite -ResourceType Microsoft.Web/sites -ResourceGroupName exampleresourcegroup
140140
```
141141

142142
To get all locks for a resource group, use:
143143

144-
```powershell
144+
```azurepowershell-interactive
145145
Get-AzureRmResourceLock -ResourceGroupName exampleresourcegroup
146146
```
147147

148148
To delete a lock, use:
149149

150-
```powershell
150+
```azurepowershell-interactive
151151
$lockId = (Get-AzureRmResourceLock -ResourceGroupName exampleresourcegroup -ResourceName examplesite -ResourceType Microsoft.Web/sites).LockId
152152
Remove-AzureRmResourceLock -LockId $lockId
153153
```

0 commit comments

Comments
 (0)