Skip to content

Commit 6634df7

Browse files
authored
✨ Update AboutCmdletVerbs (#318)
* 📝 Update comments Clean up wording, consolidate comments into blocks where sensible. Fixed some misleading examples, and removed some unnecessary repetition. * 🎨 tweak working of -Because * 🎨 formatting pass
1 parent 694b6e2 commit 6634df7

File tree

1 file changed

+31
-35
lines changed

1 file changed

+31
-35
lines changed

PSKoans/Koans/Introduction/AboutCmdletVerbs.Koans.ps1

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ param()
1212
1313
With the verb being an action, and the noun representing the target of the command.
1414
15-
In this Koan, we'll cover the 5 basic verbs which'll see you through the majority of your
15+
In this topic, we'll cover the 5 basic verbs which'll see you through the majority of your
1616
PowerShell needs. But PowerShell has more than just 5 predefined verbs! You can see them
1717
all by running the following cmdlet:
1818
@@ -29,22 +29,22 @@ Describe "Basic Verbs" {
2929
your current machine.
3030
#>
3131

32-
It 'is for commands that retrieve data' {
32+
It 'is for commands that retrieve data' {
3333
<#
3434
Using the Get-Command cmdlet, which retrieves all available commands,
35-
find 5 new Get-* commands you haven't previously used.
36-
#>
35+
find 5 commands with the Get verb.
3736
38-
# Replace each ____ with the name of a Get cmdlet
39-
$Answers = "____","____","____","____","____"
37+
Replace each ____ with the name of a Get-* command.
38+
#>
39+
$Answers = "____", "____", "____", "____", "____"
4040
$Answers | Should -BeIn (Get-Command -Verb Get).Name
4141

42-
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets should be supplied"
42+
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets are required"
4343
}
4444
}
4545

4646
Context "New" {
47-
<#
47+
<#
4848
Cmdlets with the New verb are used to create data.
4949
5050
So for example 'New-GUID' will create a new GUID, or 'New-LocalUser' will create a local
@@ -53,22 +53,21 @@ Describe "Basic Verbs" {
5353
Before continuing with this exercise, try using the following code to create a file:
5454
5555
$Path = "YOUR PATH.txt"
56-
New-Item -Path $ItemPath -ItemType file
56+
New-Item -Path $Path -ItemType file
5757
5858
This will create a new text file, in the location you specify.
5959
#>
6060

6161
It 'is for commands that create data' {
6262
<#
63-
Using the Get-Command cmdlet, which all available commands,
64-
find 5 New-* new commands you haven't previously used.
65-
#>
63+
Using Get-Command, find 5 commands with the New verb.
6664
67-
# Replace each ____ with the name of a New cmdlet
68-
$Answers = "____","____","____","____","____"
65+
Replace each ____ with the name of a New-* command.
66+
#>
67+
$Answers = "____", "____", "____", "____", "____"
6968
$Answers | Should -BeIn (Get-Command -Verb New).Name
7069

71-
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets should be supplied"
70+
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets are required"
7271
}
7372
}
7473

@@ -97,15 +96,14 @@ Describe "Basic Verbs" {
9796

9897
It 'is for commands that append data' {
9998
<#
100-
Using the Get-Command cmdlet, which retrieves all the cmdlets currently available,
101-
find 5 new add commands you haven't previously used.
102-
#>
99+
Using Get-Command, find 5 commands with the Add verb.
103100
104-
# Replace each ____ with the name of a Add cmdlet
105-
$Answers = "____","____","____","____","____"
101+
Replace each ____ with the name of an Add-* command.
102+
#>
103+
$Answers = "____", "____", "____", "____", "____"
106104
$Answers | Should -BeIn (Get-Command -Verb Add).Name
107105

108-
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets should be supplied"
106+
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets are required"
109107
}
110108
}
111109

@@ -117,7 +115,7 @@ Describe "Basic Verbs" {
117115
something to your text file:
118116
119117
$Path = "YOUR PATH.txt"
120-
Set-Content -Path $ItemPath -Value "Sir Kill-A-Lot is the best house robot because of reasons."
118+
Set-Content -Path $Path -Value "Sir Kill-A-Lot is the best house robot because of reasons."
121119
122120
Before continuing, run this command several times. See what happens, is it the
123121
result you expected?
@@ -138,20 +136,19 @@ Describe "Basic Verbs" {
138136

139137
It 'is for commands that overwrite data' {
140138
<#
141-
Using the Get-Command cmdlet, which retrieves all the cmdlets currently available,
142-
find 5 new set commands you haven't previously used.
143-
#>
139+
Using Get-Command, find 5 commands with the Set verb.
144140
145-
# Replace each ____ with the name of a Set cmdlet
146-
$Answers = "____","____","____","____","____"
141+
Replace each ____ with the name of a Set-* command.
142+
#>
143+
$Answers = "____", "____", "____", "____", "____"
147144
$Answers | Should -BeIn (Get-Command -Verb Set).Name
148145

149-
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets should be supplied"
146+
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets are required"
150147
}
151148
}
152149

153150
Context "Remove" {
154-
<#
151+
<#
155152
Cmdlets with the Remove verb will delete data from an object or data source.
156153
157154
If you followed the example in the 'New','Add' and 'Set' tests, you can use Remove-Item to
@@ -173,15 +170,14 @@ Describe "Basic Verbs" {
173170

174171
It "is for commands that delete data" {
175172
<#
176-
Using the Get-Command cmdlet, which retrieves all available commands,
177-
find 5 new remove commands you haven't previously used.
178-
#>
173+
Using Get-Command, find 5 commands with the Remove verb.
179174
180-
# Replace each ____ with the name of a Remove cmdlet
181-
$Answers = "____","____","____","____","____"
175+
Replace each ____ with the name of a Remove-* command.
176+
#>
177+
$Answers = "____", "____", "____", "____", "____"
182178
$Answers | Should -BeIn (Get-Command -Verb Remove).Name
183179

184-
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets should be supplied"
180+
$Answers | Get-Unique | Should -HaveCount 5 -Because "five unique cmdlets are required"
185181
}
186182
}
187183
}

0 commit comments

Comments
 (0)