Skip to content

Commit 089afe1

Browse files
authored
Merge pull request #11629 from MicrosoftDocs/main
1/3/2024 PM Publish
2 parents 0b902a1 + e96eaaa commit 089afe1

26 files changed

+1301
-824
lines changed

.github/ISSUE_TEMPLATE/01-article.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ body:
3333
multiple: true
3434
options:
3535
- "5.1"
36-
- "7.2"
37-
- "7.3"
3836
- "7.4"
37+
- "7.5"
3938
- type: textarea
4039
id: summary
4140
validations:

CODE_OF_CONDUCT.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
11
# Microsoft Open Source Code of Conduct
22

3-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
3+
This project has adopted the [Microsoft Open Source Code of Conduct][02].
44

5-
Resources:
5+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and
6+
healthy community.
67

7-
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8-
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9-
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
10-
- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)
8+
## Our Standards
9+
10+
Examples of behavior that contributes to a positive environment for our community include:
11+
12+
- Demonstrating empathy and kindness toward other people
13+
- Being respectful of differing opinions, viewpoints, and experiences
14+
- Giving and gracefully accepting constructive feedback
15+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the
16+
experience
17+
- Focusing on what's best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
- Disruptive behavior
22+
- Submitting spam comments, issues, or pull requests
23+
- Defacing or vandalizing the project, repository, content, or documentation
24+
- Intentionally introducing security vulnerabilities
25+
- Disrespectful behavior
26+
- Trolling, insulting or derogatory comments, and personal or political attacks
27+
- Public or private harassment
28+
- Publishing others' private information, such as a physical or email address, without their
29+
explicit permission
30+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
31+
- Other conduct that could reasonably be considered inappropriate in a professional setting
32+
33+
## Resources
34+
35+
- [Microsoft Open Source Code of Conduct][02]
36+
- [Microsoft Code of Conduct FAQ][03]
37+
- Contact [[email protected]][04] with questions or concerns
38+
- Employees can reach out at [aka.ms/opensource/moderation-support][01]
39+
40+
<!-- link references -->
41+
[01]: https://aka.ms/opensource/moderation-support
42+
[02]: https://opensource.microsoft.com/codeofconduct/
43+
[03]: https://opensource.microsoft.com/codeofconduct/faq/
44+
[04]: mailto:[email protected]

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
Thank you for your interest in contributing to quality documentations.
44
As an open source project, we welcome input and updates from the community.
55

6-
Please see our Contributor's Guide at https://aka.ms/PSDocsContributor.
6+
Please see our Contributor's Guide at <https://aka.ms/PSDocsContributor>

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
ms.date: 11/02/2024
2+
ms.date: 01/03/2025
33
---
44
# PowerShell Documentation
55

@@ -9,15 +9,6 @@ Welcome to the PowerShell-Docs repository, the home of the official PowerShell d
99

1010
This project has adopted the [Microsoft Open Source Code of Conduct][04].
1111

12-
## Build Status
13-
14-
[live-badge]: https://powershell.visualstudio.com/PowerShell-Docs/_apis/build/status/PowerShell-Docs-CI?branchName=live
15-
[main-badge]: https://powershell.visualstudio.com/PowerShell-Docs/_apis/build/status/PowerShell-Docs-CI?branchName=main
16-
17-
| live branch | main branch |
18-
| :---------------------------- | :---------------------------- |
19-
| [![live-badge][]][live-badge] | [![main-badge][]][main-badge] |
20-
2112
## PowerShell Updatable Help (CabGen) CI Build Status
2213

2314
[![Build Status][cabgen-status]][cabgen-log]
@@ -29,14 +20,13 @@ This project has adopted the [Microsoft Open Source Code of Conduct][04].
2920

3021
The following list describes the main folders in this repository.
3122

23+
- `.devcontainer` - configuration files for the VS Code Remote - Containers extension
3224
- `.github` - contains configuration settings used by GitHub for this repository
33-
- `.vscode` - contains configuration settings and recommended extensions for Visual Studio Code (VS
34-
Code)
25+
- `.vscode` - contains configuration settings and recommended extensions for VS Code
3526
- `assets` - contains downloadable files linked in the documentation
3627
- `redir` - contain redirection mapping files
37-
- `reference` - contains the documentation published to
38-
[learn.microsoft.com][01]. This includes both
39-
reference and conceptual content.
28+
- `reference` - contains the documentation published to [learn.microsoft.com][01]. This includes
29+
both reference and conceptual content.
4030
- `5.1` - contains the cmdlet reference and about topics for PowerShell 5.1
4131
- `7.4` - contains the cmdlet reference and about topics for PowerShell 7.4
4232
- `7.5` - contains the cmdlet reference and about topics for PowerShell 7.5
@@ -52,9 +42,10 @@ The following list describes the main folders in this repository.
5242
- `tests` - contains the Pester tests used by the build system
5343
- `tools` - contains other tools used by the build system
5444

55-
> NOTE: The reference content (in the numbered folders) is used to create the webpages on the Docs
56-
> site as well as the updateable help used by PowerShell. The articles in the `docs-conceptual`
57-
> folder are only published to the Docs website.
45+
> [!NOTE]
46+
> The reference content (in the numbered folders) is used to create the webpages on the Docs site as
47+
> well as the updateable help used by PowerShell. The articles in the `docs-conceptual` folder are
48+
> only published to the Docs website.
5849
5950
## Contributing
6051

@@ -69,11 +60,13 @@ consistent across versions.
6960

7061
## Licenses
7162

72-
There are two license files for this project. The MIT License applies to the code contained in this
73-
repo. The Creative Commons license applies to the documentation.
63+
There are two license files for this project. The [MIT License][05] applies to the code contained in
64+
this repo. The [Creative Commons license][06] applies to the documentation.
7465

7566
<!-- link references -->
7667
[01]: https://learn.microsoft.com/powershell/scripting/
7768
[02]: https://aka.ms/PSDocsContributor
7869
[03]: https://cla.microsoft.com/
7970
[04]: CODE_OF_CONDUCT.md
71+
[05]: LICENSE-CODE.md
72+
[06]: LICENSE.md

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

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Describes arrays, which are data structures designed to store collections of items.
33
Locale: en-US
4-
ms.date: 03/07/2024
4+
ms.date: 01/03/2025
55
no-loc: [Count, Length, LongLength, Rank, ForEach, Clear, Default, First, Last, SkipUntil, Until, Split, Tuple]
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_arrays?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
@@ -10,6 +10,7 @@ title: about_Arrays
1010
# about_Arrays
1111

1212
## Short description
13+
1314
Describes arrays, which are data structures designed to store collections of
1415
items.
1516

@@ -341,9 +342,25 @@ while($i -lt 4) {
341342

342343
### Count or Length or LongLength
343344

344-
To determine how many items are in an array, use the **Length** property or its
345-
**Count** alias. **Longlength** is useful if the array contains more than
346-
2,147,483,647 elements.
345+
In PowerShell, arrays have three properties that indicate the number of items
346+
contained in the array.
347+
348+
- **Count** - This property is the most commonly used property to determine the
349+
number of items in any collection, not just an array. It's an `[Int32]` type
350+
value. In Windows PowerShell 5.1 (and older) **Count** alias property for
351+
**Length**.
352+
353+
- **Length** - This property is an `[Int32]` type value. This contains the same
354+
value as **Count**.
355+
356+
> [!NOTE]
357+
> While **Count** and **Length** are equivalent for arrays, **Length** can
358+
> have a different meaning for other types. For example, **Length** for a
359+
> string is the number of characters in the string. But the **Count**
360+
> property is always `1`.
361+
362+
- **Longlength** - This property is an `[Int64]` type value. Use this property
363+
for arrays containing more than 2,147,483,647 elements.
347364

348365
```powershell
349366
$a = 0..9
@@ -470,7 +487,7 @@ True
470487
In this example, `$intA` is explicitly typed to contain integers.
471488

472489
```powershell
473-
[int[]] $intA = 1, 2, 3
490+
[Int[]] $intA = 1, 2, 3
474491
$intA.Clear()
475492
$intA
476493
```
@@ -488,7 +505,7 @@ for each element of the array.
488505

489506
The `ForEach()` method has several overloads that perform different operations.
490507

491-
```
508+
```Syntax
492509
ForEach(scriptblock expression)
493510
ForEach(scriptblock expression, object[] arguments)
494511
ForEach(type convertToType)
@@ -884,10 +901,11 @@ faster, especially for large arrays.
884901

885902
## Arrays of zero or one
886903

887-
Beginning in Windows PowerShell 3.0, a collection of zero or one object has the
888-
**Count** and **Length** properties. Also, you can index into an array of one
889-
object. This feature helps you to avoid scripting errors that occur when a
890-
command that expects a collection gets fewer than two items.
904+
Beginning in Windows PowerShell 3.0, a scalar types and collection of zero or
905+
one objects has the **Count** and **Length** properties. Also, you can use
906+
array index notation to access the value of a singleton scalar object. This
907+
feature helps you to avoid scripting errors that occur when a command that
908+
expects a collection gets fewer than two items.
891909

892910
> [!NOTE]
893911
In Windows PowerShell, objects created by casting a **Hashtable** to
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Introduces advanced functions that are a way to create cmdlets using scripts.
33
Locale: en-US
4-
ms.date: 01/20/2023
4+
ms.date: 01/02/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions_advanced?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Functions_Advanced
@@ -14,8 +14,8 @@ Introduces advanced functions that are a way to create cmdlets using scripts.
1414
## Long description
1515

1616
A cmdlet is a single command that participates in the pipeline semantics of
17-
PowerShell. This includes binary cmdlets, advanced script functions, CDXML, and
18-
Workflows.
17+
PowerShell. This includes binary cmdlets, PowerShell advanced script
18+
functions, CDXML, and Workflows.
1919

2020
Advanced functions allow you create cmdlets that are written as a PowerShell
2121
function. Advanced functions make it easier to create cmdlets without having to
@@ -28,6 +28,12 @@ the Cmdlet attribute that's used in compiled cmdlet classes to identify the
2828
class as a cmdlet. For more information about this attribute, see
2929
[about_Functions_CmdletBindingAttribute][03].
3030

31+
The parameters of the function are variables declared in the `param()`
32+
statement. You can use the optional `[Parameter()]` attribute alone or in
33+
combination with the `[Alias()]` attribute or any of the parameter validation
34+
attributes. For more information about how to declare parameters, see
35+
[about_Functions_Advanced_Parameters][02].
36+
3137
The following example shows a function that accepts a name and then prints a
3238
greeting using the supplied name. Also notice that this function defines a name
3339
that includes a verb (Send) and noun (Greeting) pair like the verb-noun pair of
@@ -37,36 +43,29 @@ a compiled cmdlet. However, functions aren't required to have a verb-noun name.
3743
function Send-Greeting
3844
{
3945
[CmdletBinding()]
40-
Param(
46+
param(
4147
[Parameter(Mandatory=$true)]
4248
[string] $Name
4349
)
4450
45-
Process
51+
process
4652
{
4753
Write-Host ("Hello " + $Name + "!")
4854
}
4955
}
5056
```
5157

52-
The parameters of the function are declared using the `Parameter` attribute.
53-
This attribute can be used alone, or it can be combined with the Alias
54-
attribute or with several other parameter validation attributes. For more
55-
information about how to declare parameters (including dynamic parameters that
56-
are added at runtime), see [about_Functions_Advanced_Parameters][02].
57-
58-
The actual work of the previous function is performed in the `process` block,
59-
which is equivalent to the **ProcessingRecord** method that's used by compiled
60-
cmdlets to process the data that's passed to the cmdlet. This block, along with
61-
the `begin` and `end` blocks, is described in the
62-
[about_Functions_Advanced_Methods][01] topic.
58+
This function performs the work in the `process` block, which is equivalent to
59+
the **ProcessingRecord** method used in compiled cmdlets. The `process` block
60+
and the other named blocks are described in
61+
[about_Functions_Advanced_Methods][01].
6362

6463
Advanced functions differ from compiled cmdlets in the following ways:
6564

6665
- Advanced function parameter binding doesn't throw an exception when an array
6766
of strings is bound to a **Boolean** parameter.
68-
- The `ValidateSet` attribute and the `ValidatePattern` attribute can't pass named
69-
parameters.
67+
- The `ValidateSet` attribute and the `ValidatePattern` attribute can't pass
68+
named parameters.
7069
- Advanced functions can't be used in transactions.
7170

7271
## See also
@@ -76,10 +75,12 @@ Advanced functions differ from compiled cmdlets in the following ways:
7675
- [about_Functions_Advanced_Parameters][02]
7776
- [about_Functions_CmdletBindingAttribute][03]
7877
- [about_Functions_OutputTypeAttribute][04]
78+
- [about_Variables][06]
7979

8080
<!-- link references -->
8181
[01]: about_Functions_Advanced_Methods.md
8282
[02]: about_Functions_Advanced_Parameters.md
8383
[03]: about_Functions_CmdletBindingAttribute.md
8484
[04]: about_Functions_OutputTypeAttribute.md
8585
[05]: about_Functions.md
86+
[06]: about_Variables.md

0 commit comments

Comments
 (0)