Skip to content

Commit c49fdef

Browse files
bobbytreedSean Wheeler
authored andcommitted
Batch automation: Formatting fixes (#2384)
* Fixing issue with faulty links from issue (2322) * Trying smaller pull requests to test Script Automation * Testing script automation with a smaller batch of files (#2359) * Fixing issue with faulty links from issue (2322) * Trying smaller pull requests to test Script Automation * Git Batch testing 15 files (#2371) * Git Batch testing 15 files * re run automation to fix bad link replacement * Batch automation: Formatting fixes (#2372) * Batch automation: Formatting fixes * re-running automation to fix bad link replacement * Batch automation: Formatting fixes (#2377) * Batch automation: Formatting fixes * Fixing two broken links that were broken by my code * Batch automation: Formatting fixes
1 parent 1b0b1c4 commit c49fdef

25 files changed

+186
-197
lines changed

reference/3.0/Microsoft.PowerShell.Core/About/about_Methods.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
---
1+
---
22
ms.date: 06/09/2017
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
66
title: about_Methods
77
---
8-
98
# About methods
109

1110
## SHORT DESCRIPTION
@@ -30,7 +29,7 @@ To get the methods of any object, use the `Get-Member` cmdlet. Use its
3029
the methods of process objects.
3130

3231
```powershell
33-
PS C:\> Get-Process | Get-Member -MemberType Method
32+
PS> Get-Process | Get-Member -MemberType Method
3433
```
3534

3635
```output
@@ -68,8 +67,8 @@ takes a delimiter character argument that tells the method where to split the
6867
string.
6968

7069
```powershell
71-
PS C:\> $a = "Try-Catch-Finally"
72-
PS C:\> $a.Split("-")
70+
PS> $a = "Try-Catch-Finally"
71+
PS> $a.Split("-")
7372
Try
7473
Catch
7574
Finally
@@ -155,15 +154,15 @@ command uses the `Get-Process` command to get all three instance of the Notepad
155154
process and save them in the \$p variable.
156155

157156
```powershell
158-
PS C:\> Notepad; Notepad; Notepad
159-
PS C:\> $p = Get-Process Notepad
157+
PS> Notepad; Notepad; Notepad
158+
PS> $p = Get-Process Notepad
160159
```
161160

162161
The third command uses the Count property of all collections to verify that
163162
there are three processes in the \$p variable.
164163

165164
```powershell
166-
PS C:\> $p.Count
165+
PS> $p.Count
167166
3
168167
```
169168

@@ -174,18 +173,18 @@ This command works even though a collection of processes does not have a `Kill`
174173
method.
175174

176175
```
177-
PS C:\> $p.Kill()
176+
PS> $p.Kill()
178177
```
179178

180179
The fifth command uses the Get-Process command to confirm that the `Kill`
181180
command worked.
182181

183182
```powershell
184-
PS C:\> Get-Process Notepad
183+
PS> Get-Process Notepad
185184
Get-Process : Cannot find a process with the name "notepad". Verify the proc
186185
ess name and call the cmdlet again.
187186
At line:1 char:12
188-
+ get-process <<<< notepad
187+
+ Get-Process <<<< notepad
189188
+ CategoryInfo : ObjectNotFound: (notepad:String) [Get-Process]
190189
, ProcessCommandException
191190
+ FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShel
@@ -196,7 +195,7 @@ To perform the same task on PowerShell 2.0, use the `Foreach-Object` cmdlet to
196195
run the method on each object in the collection.
197196

198197
```powershell
199-
PS C:\> $p | Foreach-Object {$_.Kill()}
198+
PS> $p | ForEach-Object {$_.Kill()}
200199
```
201200

202201
## SEE ALSO

reference/3.0/Microsoft.PowerShell.Core/About/about_Modules.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
---
1+
---
22
ms.date: 11/29/2017
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
66
title: about_Modules
77
---
8-
98
# About Modules
109

1110
## Short Description
@@ -43,6 +42,7 @@ gets all commands in all installed modules, even if they are not yet in the
4342
session, so you can find a command and use it without importing.
4443

4544
Any of the following commands will import a module into your session.
45+
4646
### Run the Command
4747

4848
```powershell
@@ -486,17 +486,17 @@ NOTE: Remote sessions, including sessions that are started by using the
486486
commands are packaged in snap-ins.
487487

488488
The following modules (or snap-ins) are installed with PowerShell.
489-
* Microsoft.PowerShell.Core
490-
* Microsoft.PowerShell.Diagnostics
491-
* Microsoft.PowerShell.Host
492-
* Microsoft.PowerShell.Management
493-
* Microsoft.PowerShell.Security
494-
* Microsoft.PowerShell.Utility
495-
* Microsoft.WSMan.Management
496-
* PSScheduledJob
497-
* PSWorkflow
498-
* PSWorkflowUtility
499-
* ISE
489+
- Microsoft.PowerShell.Core
490+
- Microsoft.PowerShell.Diagnostics
491+
- Microsoft.PowerShell.Host
492+
- Microsoft.PowerShell.Management
493+
- Microsoft.PowerShell.Security
494+
- Microsoft.PowerShell.Utility
495+
- Microsoft.WSMan.Management
496+
- PSScheduledJob
497+
- PSWorkflow
498+
- PSWorkflowUtility
499+
- ISE
500500

501501
## Logging Module Events
502502

reference/3.0/Microsoft.PowerShell.Core/About/about_Object_Creation.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
---
1+
---
22
ms.date: 11/30/2017
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
66
title: about_Object_Creation
77
---
8-
98
# About Object Creation
109

1110
## SHORT DESCRIPTION
@@ -43,8 +42,8 @@ ProgID of a COM object.
4342
For example, the following command creates a Version object.
4443

4544
```powershell
46-
PS C:\> $v = New-Object -TypeName System.Version -ArgumentList 2.0.0.1
47-
PS C:\> $v
45+
PS> $v = New-Object -TypeName System.Version -ArgumentList 2.0.0.1
46+
PS> $v
4847
```
4948

5049
```Output
@@ -54,7 +53,7 @@ Major Minor Build Revision
5453
```
5554

5655
```powershell
57-
PS C:\> $v | Get-Member
56+
PS> $v | Get-Member
5857
5958
TypeName: System.Version
6059
```
@@ -118,7 +117,7 @@ The output of this function is a collection of custom objects formatted as a
118117
table by default.
119118

120119
```powershell
121-
PS C:\> Test-Object
120+
PS> Test-Object
122121
123122
ModuleName UICulture Version
124123
--------- --------- -------
@@ -130,7 +129,7 @@ Users can manage the properties of the custom objects just as they do with
130129
standard objects.
131130

132131
```powershell
133-
PS C:\> (Test-Object).ModuleName
132+
PS> (Test-Object).ModuleName
134133
PSScheduledJob
135134
PSWorkflow
136135
```
@@ -202,8 +201,8 @@ AssetID, Name, OS, Department
202201
```
203202

204203
```powershell
205-
PS C:\> $a = Import-Csv Servers.csv
206-
PS C:\> $a
204+
PS> $a = Import-Csv Servers.csv
205+
PS> $a
207206
208207
AssetID Name OS Department
209208
------- ---- -- ----------
@@ -215,7 +214,7 @@ AssetID Name OS Department
215214
Use the Get-Member cmdlet to confirm the object type.
216215

217216
```powershell
218-
PS C:\> $a | Get-Member
217+
PS> $a | Get-Member
219218
```
220219

221220
```Output
@@ -236,7 +235,7 @@ OS NoteProperty System.String OS=Windows Server 2012
236235
You can use the custom objects just as you would standard objects.
237236

238237
```powershell
239-
PS C:\> $a | where {$_.OS -eq "Windows 8"}
238+
PS> $a | Where-Object {$_.OS -eq "Windows 8"}
240239
```
241240

242241
```output

reference/3.0/Microsoft.PowerShell.Core/About/about_Objects.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
---
1+
---
22
ms.date: 11/30/2017
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
66
title: about_Objects
77
---
8-
98
# About Objects
109

1110
## Short Description
@@ -49,7 +48,7 @@ The following example demonstrates how objects are passed from one
4948
command to the next:
5049

5150
```powershell
52-
Get-ChildItem C: | where { $_.PsIsContainer -eq $false } | Format-List
51+
Get-ChildItem C: | Where-Object { $_.PsIsContainer -eq $false } | Format-List
5352
```
5453

5554
The first command `Get-ChildItem C:` returns a file or directory object

reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
---
1+
---
22
ms.date: 11/30/2017
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
66
title: about_Operator_Precedence
77
---
8-
98
# About Operator Precedence
109

1110
## SHORT DESCRIPTION
@@ -91,23 +90,24 @@ using parentheses to force PowerShell to evaluate the enclosed part of
9190
the expression first.
9291

9392
```powershell
94-
C:\PS> 2 + 3 * 4
93+
PS> 2 + 3 * 4
9594
14
9695
97-
C:\PS> (2 + 3) * 4
96+
PS> (2 + 3) * 4
9897
20
9998
```
10099

101100
The following example gets the read-only text files from the local directory
102101
and saves them in the `$read_only` variable.
103102

104103
```powershell
105-
$read_only = get-childitem *.txt | where-object {$_.isReadOnly}
104+
$read_only = Get-ChildItem *.txt | Where-Object {$_.isReadOnly}
106105
```
106+
107107
It is equivalent to the following example.
108108

109109
```powershell
110-
$read_only = ( get-childitem *.txt | where-object {$_.isReadOnly} )
110+
$read_only = ( Get-ChildItem *.txt | Where-Object {$_.isReadOnly} )
111111
```
112112

113113
Because the pipeline operator (|) has a higher precedence than the assignment
@@ -124,7 +124,7 @@ which is the first string. Finally, it casts the selected object as a string.
124124
In this case, the cast has no effect.
125125

126126
```powershell
127-
C:\PS> [string]@('Windows','PowerShell','2.0')[0]
127+
PS> [string]@('Windows','PowerShell','2.0')[0]
128128
Windows
129129
```
130130

@@ -134,7 +134,7 @@ before the index selection. As a result, the entire array is cast as a
134134
array, which is the first character.
135135

136136
```powershell
137-
C:\PS> ([string]@('Windows','PowerShell','2.0'))[0]
137+
PS> ([string]@('Windows','PowerShell','2.0'))[0]
138138
W
139139
```
140140

@@ -143,21 +143,21 @@ precedence than the -and (logical AND) operator, the result of the expression
143143
is FALSE.
144144

145145
```powershell
146-
C:\PS> 2 -gt 4 -and 1
146+
PS> 2 -gt 4 -and 1
147147
False
148148
```
149149

150150
It is equivalent to the following expression.
151151

152152
```powershell
153-
C:\PS> (2 -gt 4) -and 1
153+
PS> (2 -gt 4) -and 1
154154
False
155155
```
156156

157157
If the -and operator had higher precedence, the answer would be TRUE.
158158

159159
```powershell
160-
C:\PS> 2 -gt (4 -and 1)
160+
PS> 2 -gt (4 -and 1)
161161
True
162162
```
163163

reference/3.0/Microsoft.PowerShell.Core/About/about_Operators.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
---
1+
---
22
ms.date: 06/09/2017
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
66
title: about_Operators
77
---
8-
98
# About Operators
109

1110
## SHORT DESCRIPTION
@@ -113,7 +112,7 @@ Returns the result of one or more statements as an array. If there is only
113112
one item, the array has only one member.
114113

115114
```powershell
116-
@(Get-WMIObject win32_logicalDisk)
115+
@(Get-WmiObject win32_logicalDisk)
117116
```
118117

119118
`&` Call operator
@@ -209,7 +208,7 @@ $a[-1]
209208
```
210209

211210
```powershell
212-
(get-hotfix | sort installedOn)[-1]
211+
(Get-HotFix | Sort-Object installedOn)[-1]
213212
```
214213

215214
```powershell
@@ -235,8 +234,8 @@ that follows it. When the output includes more than one object (a
235234
"collection"), the pipeline operator sends the objects one at a time.
236235

237236
```powershell
238-
get-process | get-member
239-
get-pssnapin | where {$_.vendor -ne "Microsoft"}
237+
Get-Process | Get-Member
238+
Get-PSSnapin | Where-Object {$_.vendor -ne "Microsoft"}
240239
```
241240

242241
`.` Property dereference operator
@@ -245,7 +244,7 @@ Accesses the properties and methods of an object.
245244

246245
```powershell
247246
$myProcess.peakWorkingSet
248-
(get-process PowerShell).kill()
247+
(Get-Process PowerShell).kill()
249248
```
250249

251250
`..` Range operator
@@ -256,7 +255,7 @@ lower boundary.
256255
```powershell
257256
1..10
258257
10..1
259-
foreach ($a in 1..$max) {write-host $a}
258+
foreach ($a in 1..$max) {Write-Host $a}
260259
```
261260

262261
`::` Static member operator
@@ -276,7 +275,7 @@ a scalar. For multiple results, returns an array.
276275

277276
```powershell
278277
$($x * 23)
279-
$(Get-WMIObject win32_Directory)
278+
$(Get-WmiObject win32_Directory)
280279
```
281280

282281
## SEE ALSO

0 commit comments

Comments
 (0)