Null coalescing and null conditional operators#5298
Null coalescing and null conditional operators#5298sdwheeler merged 4 commits intoMicrosoftDocs:stagingfrom
Conversation
|
Docs Build status updates of commit 5e6001d:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/7.0/Microsoft.PowerShell.Core/About/about_Operators.md | View (powershell-7) | Details |
reference/7.0/Microsoft.PowerShell.Core/About/about_Operators.md
- [Warning]
Metadata with following name(s) are not allowed to be set in Yaml header, or as file level metadata in docfx.json, or as global metadata in docfx.json: locale. They are generated by Docs platform, so the values set in these 3 places will be ignored. Please remove them from all 3 places to resolve the warning.
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.
|
Docs Build status updates of commit 8d27795:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/7.0/Microsoft.PowerShell.Core/About/about_Operators.md | View (powershell-7) | Details |
reference/7.0/Microsoft.PowerShell.Core/About/about_Operators.md
- [Warning]
Metadata with following name(s) are not allowed to be set in Yaml header, or as file level metadata in docfx.json, or as global metadata in docfx.json: locale. They are generated by Docs platform, so the values set in these 3 places will be ignored. Please remove them from all 3 places to resolve the warning.
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.
|
|
||
| #### Null-coalescing operator `??` | ||
|
|
||
| The null-coalescing operator `??` returns the value of its left-hand operand if it isn't null; |
There was a problem hiding this comment.
Change the semicolon to period and start a new sentence.
| $x ?? 100 | ||
| ``` | ||
|
|
||
| ```output |
| A null-conditional operator applies a member access, `?.`, or element access, `?[]`, operation to | ||
| its operand only if that operand evaluates to non-null; otherwise, it returns null. | ||
|
|
||
| Since PowerShell allows *?* to be part of the variable name, formal specification of the variable |
There was a problem hiding this comment.
Change to:
Since PowerShell allows ? to be part...
| its operand only if that operand evaluates to non-null; otherwise, it returns null. | ||
|
|
||
| Since PowerShell allows *?* to be part of the variable name, formal specification of the variable | ||
| name is required for using these operators. So it is _required_ to use *{}* around the variable names |
There was a problem hiding this comment.
Don't need to italicize "required". Also change the braces to {}
| name is required for using these operators. So it is _required_ to use *{}* around the variable names | ||
| like `${a}` or when *?* is part of the variable name `${a?}`. | ||
|
|
||
| In the following example, the value of *PropName* is returned. |
There was a problem hiding this comment.
Propname should be bold
|
Docs Build status updates of commit b3ce4de:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/7.0/Microsoft.PowerShell.Core/About/about_Operators.md | View (powershell-7) | Details |
reference/7.0/Microsoft.PowerShell.Core/About/about_Operators.md
- [Warning]
Metadata with following name(s) are not allowed to be set in Yaml header, or as file level metadata in docfx.json, or as global metadata in docfx.json: locale. They are generated by Docs platform, so the values set in these 3 places will be ignored. Please remove them from all 3 places to resolve the warning.
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.
|
Docs Build status updates of commit ba82762:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| reference/7.0/Microsoft.PowerShell.Core/About/about_Operators.md | View (powershell-7) | Details |
reference/7.0/Microsoft.PowerShell.Core/About/about_Operators.md
- [Warning]
Metadata with following name(s) are not allowed to be set in Yaml header, or as file level metadata in docfx.json, or as global metadata in docfx.json: locale. They are generated by Docs platform, so the values set in these 3 places will be ignored. Please remove them from all 3 places to resolve the warning.
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.
PR Summary
Fixes #4925
Add documentation for
????=?.and?[]operators.PR Context
Select the type(s) of documents being changed.
Cmdlet reference & about_ topics
Conceptual articles
PR Checklist
WIP:or[ WIP ]to the beginning of thetitle and remove the prefix when the PR is ready.