Skip to content

Commit c6136cf

Browse files
authored
Merge pull request MicrosoftDocs#648 from tseward/patch-335
Update Set-SPRoutingRule.md
2 parents a4d4dfd + b91f76c commit c6136cf

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

sharepoint/sharepoint-ps/sharepoint-server/Set-SPRoutingRule.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,15 @@ For permissions and the most current information about Windows PowerShell for Sh
2929

3030
### --------------------EXAMPLE---------------------
3131
```
32-
C:\PS>$rm=Get-SPRequestManagementSettings -Identity $web
33-
34-
C:\PS>Get-SPRoutingRule -RequestManagementSettings $rm
35-
36-
C:\PS>$machines=Get-SPRoutingMachineInfo -RequestManagementSettings $rm
37-
38-
C:\PS>$pool=Add-SPRoutingMachinePool -RequestManagementSettings $rm -Name <Name of Pool> -MachineTargets $machines
39-
40-
C:\PS>$criteria=New-SPRequestManagementRuleCriteria -Value http -Property url -MatchType startswith -CaseSensitive $false
41-
42-
C:\PS>$rule=Add-SPRoutingRule -RequestManagementSettings $rm -Name <Rule Name> -Criteria $c -MachinePool $pool
43-
44-
C:\PS>$criteriaNew = New-SPRequestManagementRuleCriteria -Property UserAgent -MatchType Equals -Value "Mozilla/4.0 (compatible; MSIE 4.01; Windows NT; MS Search 6.0 Robot)"
45-
46-
C:\PS>Set-SPRoutingRule -Identity $rule -Criteria $criteriaNew
32+
PS C:\>$wa = Get-SPWebApplication http://webAppUrl
33+
PS C:\>$rm = Get-SPRequestManagementSettings -Identity $wa
34+
PS C:\>Get-SPRoutingRule -RequestManagementSettings $rm
35+
PS C:\>$machines = Get-SPRoutingMachineInfo -RequestManagementSettings $rm
36+
PS C:\>$pool = Add-SPRoutingMachinePool -RequestManagementSettings $rm -Name <Name of Pool> -MachineTargets $machines
37+
PS C:\>$criteria = New-SPRequestManagementRuleCriteria -Value http -Property url -MatchType startswith -CaseSensitive $false
38+
PS C:\>$rule = Add-SPRoutingRule -RequestManagementSettings $rm -Name <Rule Name> -Criteria $c -MachinePool $pool
39+
PS C:\>$criteriaNew = New-SPRequestManagementRuleCriteria -Property UserAgent -MatchType Equals -Value "Mozilla/4.0 (compatible; MSIE 4.01; Windows NT; MS Search 6.0 Robot)"
40+
PS C:\>Set-SPRoutingRule -Identity $rule -Criteria $criteriaNew
4741
```
4842

4943
This example sets a routing rule for the specified identity by using the $rule variable.
@@ -68,13 +62,9 @@ Accept wildcard characters: False
6862
```
6963
7064
### -AssignmentCollection
71-
Manages objects for the purpose of proper disposal.
72-
Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management.
73-
Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory.
74-
When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.
65+
Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.
7566
76-
When the Global parameter is used, all objects are contained in the global store.
77-
If objects are not immediately used, or disposed of by using the `Stop-SPAssignment` command, an out-of-memory scenario can occur.
67+
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.
7868
7969
```yaml
8070
Type: SPAssignmentCollection

0 commit comments

Comments
 (0)