Skip to content

Commit 7a2b0be

Browse files
authored
Merge pull request MicrosoftDocs#842 from tseward/patch-476
Update Get-SPSite.md
2 parents 46b743b + 18b2904 commit 7a2b0be

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

sharepoint/sharepoint-ps/sharepoint-server/Get-SPSite.md

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -72,27 +72,27 @@ For permissions and the most current information about Windows PowerShell for Sh
7272

7373
### ------------------EXAMPLE 1---------------------
7474
```
75-
C:\PS>Get-SPSite 'http://<site name>' | Get-SPWeb -Limit All | Select Title
75+
PS C:\>Get-SPSite 'http://<site name>' | Get-SPWeb -Limit All | Select Title
7676
```
7777

7878
This example gets the collection of subweb titles in site collection at http://\<site name\>.
7979

8080
### ------------------EXAMPLE 2---------------------
8181
```
82-
C:\PS>Get-SPSite -ContentDatabase "b399a366-d899-4cff-8a9b-8c0594ee755f" | Format-Table -Property Url, Owner, SecondaryOwner
82+
PS C:\>Get-SPSite -ContentDatabase "b399a366-d899-4cff-8a9b-8c0594ee755f" | Format-Table -Property Url, Owner, SecondaryOwner
8383
```
8484

8585
This example gets a subset of data from all sites in the content database b399a366-d899-4cff-8a9b-8c0594ee755f.
8686

8787
### ------------------EXAMPLE 3---------------------
8888
```
89-
C:\PS>Start-SPAssignment -Global
89+
PS C:\>Start-SPAssignment -Global
9090
91-
C:\PS>$s = Get-SPSite -Identity http://<MyApp>/Sites/Site1
91+
PS C:\>$s = Get-SPSite -Identity http://<MyApp>/Sites/Site1
9292
93-
C:\PS>$s.Url
93+
PS C:\>$s.Url
9494
95-
C:\PS>Stop-SPAssignment -Global
95+
PS C:\>Stop-SPAssignment -Global
9696
```
9797

9898
This example gets the sites specified by the Identity parameter and inserts the results in the variable s
@@ -103,11 +103,9 @@ Be careful not to run a Get-SPSite command that returns many results while globa
103103

104104
### ------------------EXAMPLE 4---------------------
105105
```
106-
C:\PS>$GC = Start-SPAssignment
107-
108-
C:\PS>$Sites = $GC | Get-SPSite -Filter {$_.Owner -eq "DOMAIN\JDow"} -Limit 50
109-
110-
C:\PS>Stop-SPAssignment $GC
106+
PS C:\>$GC = Start-SPAssignment
107+
PS C:\>$Sites = $GC | Get-SPSite -Filter {$_.Owner -eq "DOMAIN\JDow"} -Limit 50
108+
PS C:\>Stop-SPAssignment $GC
111109
```
112110

113111
This example gets the first 50 sites owned by user DOMAIN\JDow by using a server-side query, and assigns them to a local variable.
@@ -116,14 +114,14 @@ This example uses advanced assignment collection methods.
116114

117115
### ------------------EXAMPLE 5---------------------
118116
```
119-
C:\PS>Get-SPWebApplication http://<site name> | Get-SPSite -Limit All |ForEach-Object {$sum=0}{ $sum+=$_.Usage.Storage }{$sum}
117+
PS C:\>Get-SPWebApplication http://<site name> | Get-SPSite -Limit All |ForEach-Object {$sum=0}{ $sum+=$_.Usage.Storage }{$sum}
120118
```
121119

122120
This example shows a command that returns the sum of the disk space usage for all sites in a given web application.
123121

124122
### ------------------EXAMPLE 6---------------------
125123
```
126-
C:\PS>Get-SPSite -Identity "http://localserver/(my|personal)/sites" -Regex
124+
PS C:\>Get-SPSite -Identity "http://localserver/(my|personal)/sites" -Regex
127125
```
128126

129127
This example returns all sites that match the given regular expression.
@@ -132,21 +130,21 @@ The Quotes on the Identity parameter are required when the Regex parameter is us
132130

133131
### ------------------EXAMPLE 7---------------------
134132
```
135-
C:\PS>Get-SPSite http://<site name>/sites/teams/* -Limit 100
133+
PS C:\>Get-SPSite http://<site name>/sites/teams/* -Limit 100
136134
```
137135

138136
This example gets up to 100 of the sites under the URL http://sitename/sites/teams.
139137

140138
### ------------------EXAMPLE 8---------------------
141139
```
142-
C:\PS>Get-SPSite | select url, @{Expression={$_.Usage.Storage}}
140+
PS C:\>Get-SPSite | select url, @{Expression={$_.Usage.Storage}}
143141
```
144142

145143
This example gets the amount of storage used by a site collection, by using the storage field of the .UsageInfo property.
146144

147145
### ------------------EXAMPLE 9---------------------
148146
```
149-
C:\PS>Get-SPSite -Limit all -CompatibilityLevel 14
147+
PS C:\>Get-SPSite -Limit all -CompatibilityLevel 14
150148
```
151149

152150
This example returns all SharePoint Server mode site collections.
@@ -208,13 +206,9 @@ Accept wildcard characters: False
208206
```
209207
210208
### -AssignmentCollection
211-
Manages objects for the purpose of proper disposal.
212-
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.
213-
Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory.
214-
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.
209+
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.
215210
216-
When the Global parameter is used, all objects are contained in the global store.
217-
If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.
211+
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.
218212
219213
```yaml
220214
Type: SPAssignmentCollection
@@ -357,7 +351,9 @@ Accept wildcard characters: False
357351
```
358352

359353
### -NeedsB2BUpgrade
360-
{{Fill NeedsB2BUpgrade Description}}
354+
Specifies whether the site needs to be upgraded.
355+
356+
The valid values are True and False.
361357

362358
```yaml
363359
Type: SwitchParameter

0 commit comments

Comments
 (0)