Skip to content

Commit b5fd952

Browse files
authored
Merge pull request #2 from PowerShell/staging
upd
2 parents fb804cf + 2f40f5d commit b5fd952

File tree

76 files changed

+821
-821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+821
-821
lines changed

dsc/registryResource.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Registry [string] #ResourceName
3232
| Property | Description |
3333
|---|---|
3434
| Key| Indicates the path of the registry key for which you want to ensure a specific state. This path must include the hive.|
35-
| ValueName| Indicates the name of the registry value.|
35+
| ValueName| Indicates the name of the registry value. To add or remove a registry key, specify this property as an empty string without specifying ValueType or ValueData. To modify or remove the default value of a registry key, specify this property as an empty string while also specifying ValueType or ValueData.|
3636
| Ensure| Indicates if the key and value exist. To ensure that they do, set this property to "Present". To ensure that they do not exist, set the property to "Absent". The default value is "Present".|
37-
| Force| If the specified registry key is present, __Force__ overwrites it with the new value.|
37+
| Force| If the specified registry key is present, __Force__ overwrites it with the new value. If deleting a registry key with subkeys, this needs to be __$true__|
3838
| Hex| Indicates if data will be expressed in hexadecimal format. If specified, the DWORD/QWORD value data is presented in hexadecimal format. Not valid for other types. The default value is __$false__.|
3939
| DependsOn| Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is __ResourceName__ and its type is __ResourceType__, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`.|
4040
| ValueData| The data for the registry value.|

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

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ from the variable name by the assignment operator (=).
3232
For example, to create an array named $A that contains the seven
3333
numeric (int) values of 22, 5, 10, 8, 12, 9, and 80, type:
3434

35-
```PowerShell
35+
```powershell
3636
$A = 22,5,10,8,12,9,80
3737
```
3838

3939
You can also create and initialize an array by using the range
4040
operator (..). For example, to create and initialize an array named
4141
"$B" that contains the values 5 through 8, type:
4242

43-
```PowerShell
43+
```powershell
4444
$B = 5..8
4545
```
4646

@@ -51,7 +51,7 @@ an object array (type: System.Object[]). To determine the data type of an array,
5151
use the GetType() method. For example, to determine the data type of the
5252
$a array, type:
5353

54-
```PowerShell
54+
```powershell
5555
$a.GetType()
5656
```
5757

@@ -62,7 +62,7 @@ name with an array type enclosed in brackets. For example, to create a
6262
32-bit integer array named $ia containing four integers (1500, 2230, 3350,
6363
and 4000), type:
6464

65-
```PowerShell
65+
```powershell
6666
[int32[]]$ia = 1500,2230,3350,4000
6767
```
6868

@@ -74,7 +74,7 @@ retrieves to represent processes are of the System.Diagnostics.Process
7474
type. To create a strongly typed array of process objects, enter the
7575
following command:
7676

77-
```PowerShell
77+
```powershell
7878
[Diagnostics.Process[]]$zz = Get-Process
7979
```
8080

@@ -92,7 +92,7 @@ The syntax of the array operator is as follows:
9292
You can use the array operator to create an array of zero or
9393
one object. For example:
9494

95-
```PowerShell
95+
```powershell
9696
$a = @("Hello World")
9797
$a.Count
9898
@@ -111,7 +111,7 @@ The array operator is particularly useful in scripts when
111111
you are getting objects, but do not know how many objects
112112
you will get. For example:
113113

114-
```PowerShell
114+
```powershell
115115
$p = @(Get-Process Notepad)
116116
```
117117

@@ -127,7 +127,7 @@ To display all the elements in the array, type the array name.
127127
For example, assuming *$a* is an array containing integers 0, 1, 2, until 9;
128128
typing:
129129

130-
```PowerShell
130+
```powershell
131131
$a
132132
```
133133

@@ -150,7 +150,7 @@ You can refer to the elements in an array by using an index, beginning
150150
at position 0. Enclose the index number in brackets. For example,
151151
to display the first element in the *$a* array, type:
152152

153-
```PowerShell
153+
```powershell
154154
$a[0]
155155
```
156156

@@ -162,7 +162,7 @@ produces:
162162

163163
To display the third element in the $a array, type:
164164

165-
```PowerShell
165+
```powershell
166166
$a[2]
167167
```
168168

@@ -176,7 +176,7 @@ You can retrive part of the array using a range operator for the index.
176176
For example, to retrieve the second to fifth elements of the array,
177177
you would type:
178178

179-
```PowerShell
179+
```powershell
180180
$a[1..4]
181181
```
182182

@@ -193,7 +193,7 @@ Negative numbers count from the end of the array. For example, "-1"
193193
refers to the last element of the array. To display the last three elements
194194
of the array, in index ascending order, type:
195195

196-
```PowerShell
196+
```powershell
197197
$a = 0 .. 9
198198
$a[-3..-1]
199199
```
@@ -209,7 +209,7 @@ produces:
209209
If you type negative indexes in descending order,
210210
your output changes.
211211

212-
```PowerShell
212+
```powershell
213213
$a = 0 .. 9
214214
$a[-1..-3]
215215
```
@@ -226,7 +226,7 @@ However, be cautious when using this notation.
226226
The notation cycles from the end boundary to the
227227
beginning of the array.
228228

229-
```PowerShell
229+
```powershell
230230
$a = 0 .. 9
231231
$a[2..-2]
232232
```
@@ -251,7 +251,7 @@ You can use the plus operator (+) to combine a ranges with a list of
251251
elements in an array. For example, to display the elements at index
252252
positions 0, 2, and 4 through 6, type:
253253

254-
```PowerShell
254+
```powershell
255255
$a = 0 .. 9
256256
$a[0,2+4..6]
257257
```
@@ -271,7 +271,7 @@ you can use the plus operator.
271271
For example, to list elements zero to two, four to six,
272272
and the element at eighth positionat type:
273273

274-
```PowerShell
274+
```powershell
275275
$a = 0..9
276276
$a[+0..2+4..6+8]
277277
```
@@ -295,7 +295,7 @@ to refer to the elements in an array.
295295
For example, to use a ForEach loop
296296
to display the elements in the $a array, type:
297297

298-
```PowerShell
298+
```powershell
299299
$a = 0..9
300300
foreach ($element in $a) {
301301
$element
@@ -323,7 +323,7 @@ The For loop is useful when you are incrementing counters while examining
323323
the elements in an array. For example, to use a For loop to return every
324324
other value in an array, type:
325325

326-
```PowerShell
326+
```powershell
327327
$a = 0..9
328328
for ($i = 0; $i -le ($a.length - 1); $i += 2) {
329329
$a[$i]
@@ -344,7 +344,7 @@ defined condition is no longer true.
344344
For example, to display the elements
345345
in the $a array while the array index is less than 4, type:
346346

347-
```PowerShell
347+
```powershell
348348
$a = 0..9
349349
$i=0
350350
while($i -lt 4) {
@@ -367,7 +367,7 @@ To determine how many items are in an array, use the Length property
367367
or its Count alias. Longlength is useful if the array contains
368368
more than 2,147,483,647 elements.
369369

370-
```PowerShell
370+
```powershell
371371
$a = 0 .. 9
372372
$a.Count
373373
$a.Length
@@ -386,7 +386,7 @@ Most arrays in PowerShell have one dimension, only.
386386
Even when you think you are building a multidimensional array;
387387
like the following example:
388388

389-
```PowerShell
389+
```powershell
390390
$a = @(
391391
@(0,1),
392392
@("b", "c"),
@@ -405,7 +405,7 @@ Building a truly multidimensional array, in PowerShell,
405405
requires the assistance of the *.Net Framework*.
406406
Like in the following example:
407407

408-
```PowerShell
408+
```powershell
409409
[int[,]]$rank2 = [int[,]]::new(5,5)
410410
$rank2.rank
411411
```
@@ -421,7 +421,7 @@ $rank2.rank
421421
Removes all elements in the array.
422422
The following example shows the effect of the clear method.
423423

424-
```PowerShell
424+
```powershell
425425
$a = 0 .. 2
426426
"Before the clear"
427427
$a
@@ -454,7 +454,7 @@ The following example shows how use the foreach method.
454454
In this case the intent is to generate the square value
455455
of the elements in the array.
456456

457-
```PowerShell
457+
```powershell
458458
$a = @(0 .. 3)
459459
$a.ForEach({ $_ * $_})
460460
```
@@ -472,7 +472,7 @@ the elements to a different type;
472472
the following example shows how to convert
473473
a list of string dates to `[DateTime]` type.
474474

475-
```PowerShell
475+
```powershell
476476
@("1/1/2017", "2/1/2017", "3/1/2017").ForEach([datetime])
477477
```
478478

@@ -498,7 +498,7 @@ to show after the `Where`
498498
The following example shows how to
499499
select all odd numbers from the array.
500500

501-
```PowerShell
501+
```powershell
502502
@(0..9).Where{ $_ % 2 }
503503
```
504504

@@ -526,7 +526,7 @@ members of the array.
526526

527527
For example, the following command gets the members of the `$a` array variable.
528528

529-
```PowerShell
529+
```powershell
530530
Get-Member -InputObject $a
531531
```
532532

@@ -536,7 +536,7 @@ array the second item in an array of arrays. Windows PowerShell pipes
536536
the arrays one at a time and Get-Member returns the members of the array.
537537
Like the next two examples.
538538

539-
```PowerShell
539+
```powershell
540540
,$a | Get-Member
541541
542542
,(1,2,3) | Get-Member
@@ -553,23 +553,23 @@ use the assignment operator (=) to specify a new value for the element. For
553553
example, to change the value of the second item in the `$a` array (index
554554
position 1) to 10, type:
555555

556-
```PowerShell
556+
```powershell
557557
$a[1] = 10
558558
```
559559

560560
You can also use the SetValue method of an array to change a value. The
561561
following example changes the second value (index position 1) of the $a
562562
array to 500:
563563

564-
```PowerShell
564+
```powershell
565565
$a.SetValue(500,1)
566566
```
567567

568568
You can use the += operator to add an element to an array.
569569
The following example shows how to add an element to the `$a`
570570
array.
571571

572-
```PowerShell
572+
```powershell
573573
$a = @(0..4)
574574
$a += 5
575575
```
@@ -617,7 +617,7 @@ The following examples demonstrate this feature.
617617

618618
## Zero objects
619619

620-
```PowerShell
620+
```powershell
621621
$a = $null
622622
$a.Count
623623
$a.Length
@@ -630,7 +630,7 @@ $a.Length
630630

631631
## One object
632632

633-
```PowerShell
633+
```powershell
634634
$a = 4
635635
$a.Count
636636
$a.Length

0 commit comments

Comments
 (0)