Skip to content

Commit 378c7ed

Browse files
author
Sean Wheeler
authored
Merging latest updates to Live (#2013)
* Update the example of `Where-Object -IsNot` (#1841) * Update Example 5 in Group-Object.md (#1845) * removing @{Text=} tags * fixing UTF8 characters * removed empty H3 * added H3 for input and output types * removed mangled UTF8 character * updating Out-* commands with -NoNewLine per Issue 1739 * Fix the example of `Format-Table -DisplayError` (#1848) The example is a `-DisplayError` parameter example. But it uses `-ShowError` parameter. * Fix the example of `Format-Wide -DisplayError` (#1850) * Fix the example of `Format-Custom -DisplayError` (#1849) The example is a -DisplayError parameter example. But it uses -ShowError parameter. * updating set-acl docs per PR#901 * using semantic link breaks * Fix the example of `Format-Wide -ShowError` (#1851) * Fixed Test-ScriptFileInfo example (#1852) * fixing issue 1768 * Formatting, example fix for Body parameter (#1847) 1. Replaced variable names with PascalCase convention and for consistency 2. Removed directory information [c:\] in the examples 3. Put powershell keyword for formatting examples 4. Replaced Invoke-RestMethod with Invoke-WebRequest in the Body example, added method Post 5. Removed InformationAction and InformationVariable parameters, which were mistakenly a copy of Body, included already in CommonVariables part * fixing style consistency across articles * Fix example numbers in Resume-Job.md (#1857) Example 4 is duplicated. * Fixes typo $WebSiteName in separatingEnvData.md (#1856) - Adds the website name to common node property inside configuration data. - Also, it is now referenced (e.g. $Node.WebSiteName) in the DSC configuration document in MyWebApp.ps1. * Updates configurations.md (#1855) Two set of changes made. - Example scripts e.g. MyDscConfiguration.ps1 define the configuration inside them and call the configuration at the end line. Removed the call to the configuration at the end. Since the article demonstrates dot-sourcing the file and calling the configuration explicitly. - Fixed typo in the file name (TEST-PC1.mof to localhost.mof ), since the ComputerName was not specified it should default to using 'localhost' as the default argument for it. P.S. - There is a comment on the web-page regarding the fixes made * Fix typo in comment (#1854) * Updating the help content for v6. (#1853) * Updating the help content for v6. * Address code review comments * Fix broken links * Fix example numbers in about_Transactions.md (#1859) Example number '7' is duplicated. * Update Alias-Provider.md (#1831) 1. Removed statement that an alias is to an executable, the definition cotnains the path. It may - but does not need to be. For example: Try Set-Alias np Notepad then look at the definition. 2. Clarified that an alias can also be to a powershell script (ps1 file). 3. Tidied up the language removing multiple 'And,' clauses to improve readability. * Add documentation of new -AsHashtable switch for ConvertFrom-Json introduced by PR #5043 (#1858) * add documentation of new -AsHashTable switch for ConvertFrom-Json and also document the behaviour in case of duplicate strings. * correct casing of -AsHashtable switch. * Address PR comments about -AsHashtable switch for ConvertFrom-Json.md * Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md * Revert "Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md" Accidentally change the wrong field. This reverts commit 6e76191. * Accept pipeline input: False for -AsHashtable switch in ConvertFrom-Json.md * Fix example numbers in Invoke-WebRequest.md (#1862) Example number '4' is duplicated. * reformatting and integrating changes from PR#1831 (#1860) * Fix example numbers in Get-Help.md (#1869) Example number 12 and 13 are missing. * Fix example numbers in Import-Module.md (#1868) Example number '10' is duplicated. * Fix example number in ConvertTo-Html.html (#1867) Example number '10' is duplicated. * Update dscCiCd.md (#1865) Missing a period on line 378. Should be `$(Build.ArtifactStagingDirectory)\` not `$(BuildArtifactStagingDirectory)\`. * Web Cmdlets 6.0.0 Documentation Refresh (#1870) * Web Cmdlets 6.0.0 Documentation Refresh * Address PR Feedback * Merge Example 4 and 5 in Get-Member.md (#1874) Example 4 and 5 in Get-Member.md v3.0 and v4.0 are almost the same. They should be merged as with v5.0. * Remove hash algorithms unsupported in v6.0 (#1873) MACTripleDES and RIPEMD160 are no longer supported in v6.0. * Update outputs of Get-Verb (#1872) Since v6.0, `Get-Verb` returns not MemberDefinition but VerbInfo that has Verb and Group properties. * Fix typo in ConvertTo-Html.md (UTF-x) (#1879) * Fix "Accept wildcard characters" in Get-Service.md v6 (#1878) * Fixed "False" -> "True" (`DisplayName`, `Exclude`, `Include`, and `Name`) * Removed `InformationAction` and `InformationVariable` * Fixed Get-WindowsFeature cmdlet HyperLink (#1877) * Fixed Get-WindowsFeature cmdlet HyperLink Minor edit. Update Get-WindowsFeature cmdlet HyperLink to https://technet.microsoft.com/library/jj205469(v=wps.630).aspx * Changed URL to new docs.microsoft.com location The TechNet URL did not work. TechNet and MSDN are being retired. * Update Get-WinEvent.md (#1876) Removed future tense in a couple of places to improve readability. Minor edit. * Update Example 8 in Get-Process.md (find the owner of a process) (#1875) * Update Example 8 in Get-Process.md (Find the owner of a process) * Update to attempt to avoid build errors It seems that the build system does not accept multiple script blocks per one Example header. * updated localmachine\Root to LocalMachine\My (#1880) The example where we import the PFX on the target node should import the cert into Personal store and not root. * Update Group property example in Get-Verb.md (#1881) * adding missing space (#1885) * removing stray character (#1886) * Update Example 9 in Get-Process.md (#1888) * powershell -> pwsh (only v6.0) * Windows PowerShell -> PowerShell * Remove "About ISE" files of v6.0 (#1891) * Remove "About ISE" files of v6.0 ISE is no longer bundled with PowerShell 6.0. * Remove links for "About ISE" files of v6.0 * Update Get-Process.md (#1890) Fixed name parameter details to show it accepts wildcards in the name * Update productincompat.md (#1892) The list of compatible systems should include Skype For Business Server 2015 and Lync Server 2013. * Update unapproved verbs examples in Get-Verb.md (#1896) * Updated Example 4 * Removed Example 5 * Removing extra space in the Example 5A script (#1894) It was highlighting as string in the documentation, I was trying to remove all the extra space. * fixing merge conflict * updates to style and contrib * tweak format * tweak format 2 * fix typo * fix number list example * adding review feedback * fix broken links * incorporating feedback from zach * reformatting About_* for 80 columns - part 1 * reformat about_* * reformatting About_* topics - Part 2 * fixing broken links * fixing more broken links * more broken links fixed * Fix parameter's position in Get-Random.md (#1901) * Fix parameter's position in Measure-Command.md (#1905) * Fix parameter's position in Trace-Command.md (#1904) * Actually call the configuration in the example (#1906) On line 74, it says... "The last line of the example containing only the name of the configuration, calls the configuration." This change actually makes that call. * reformatting About_* for 80 columns - part 3 (#1902) * reformatting About_* * reformatting About_* part 3 * fixing broken links * fixing more broken links * one more time with the links * reformatting About_* for 80 columns - part 4 * Adding PreRelease versioning info for PSGallery & PSGet (#1903) * PowerShellGet PreRelease Support Adding descriptive doc for pre-release versioning support * Correcting typos in pre-release doc Minor typos and case issues fixed * Updated prerelease info based on feedback Mostly cosmetic updates. Functional change: added line 28, stating we only support 3-segment module versions. * Adding prerelease to module install update find save commands * Updating PSGet -Script commands for Prerelease support * Hyphen listed as optional rather than preferred in Prereleasestring * Minor corrections from Rebro review * Addressing @sdwheeler feedback on links and double slashes * Fixing broken link * Update PreReleaseScript.md * Style tweaks in STYLE.md (#1913) * Fix YAML metadata on "Understanding Concepts" (#1911) I'm not quite sure what this means, but it certainly looks terrible on docs.microsoft.com when it's malformed. (To be perfectly honest, I only managed to even figure out it's called "YAML metadata" by peeking at the DOM of github's HTML.) * Fix parameter's position in Join-Path.md (#1909) * typo correction on line 85 (#1916) E:\Windows\Sytem32 sould be E:\Windows\System32 * Fix parameter's position in Get-TraceSource.md (#1917) * Changed required PSGet version to 1.6.0 (#1920) * Update Example 5 in Get-Process.md (#1923) * fixing backlashes reported in PR1921 (#1924) * fixing backlashes reported in PR1921 * found more backslashes * reformatting About_* for 80 columns - part 5 * reformatting About_* for 80 columns - part 6 * incorporating review feedback * reformatting About_* for 80 columns - part 7 * Fixed formatting of output per issue #808 * Fix typo in syntax description (#1931) * Fix parameter's position in ConvertTo-Xml.md (#1929) * Remove descriptions about ComputerName parameter in Get-Process.md v6.0 (#1928) * Line 192 Single Quote Breaks Example (#1930) * Line 192 Single Quote Breaks Example * clarified the example for -Regex * Update Example 2 in Get-Alias.md (ineffective Exclude) (#1935) `-Exclude Get-*` is ineffective because there are no aliases that begin with `Get-`. * Fix formatting: DESCRIPTION section in ConvertTo-Xml.md (#1934) * Fix typo in Unregister-ScheduledJob (#1932) * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md * Fix parameter's position in ConvertFrom-Csv.md (#1937) * fix typo on metaConfig.md (#1936) fixed typo * Quick edits (#1938) * Changed required PSGet version to 1.6.0 * Fixes to PSGet TOC and WMF 5.1 compat page * Update Get-Item.md (#1942) Proof-read some of the examples. The first two were wrong entirely: The user must be in the ps-test folder for the result shown to happen. * Add description about Format-Hex -InputObject (#1939) * Fix parameter's position in Add-Member.md (#1946) * Fix parameter's position in Select-Object.md (#1945) * Correcting add to hash table example (#1944) * Update about_Hash_Tables.md corrected add to hash table example in 3.0 * Update about_Hash_Tables.md corrected add to hash table examples in 4.0 * Update about_Hash_Tables.md corrected add to hash table example in 5.0 * Update about_Hash_Tables.md corrected add to hash table example in 5.1 * Update about_Hash_Tables.md corrected add to hash table example in 6 * Fix Set-TraceSource -ListenerOption parameter (#1949) * Fixed the value of "Accepted values:" * Fixed minor differences in formatting and wording * Fix Trace-Command -ListenerOption parameter (#1948) * Fixed the value of "Accepted values:" * Fixed minor differences in formatting and wording * Fix parameter's position in Select-Xml.md (#1953) * Fix Get-Alias -Name parameter (#1952) * Position: 0 * Default value: All aliases * Accept wildcard characters: True * Fixed minor differences in formatting and wording And also removed InformationAction/InformationVariable in v6.0. * Wmf 5.1 cleanup (#1950) * Changed required PSGet version to 1.6.0 * Fixes to PSGet TOC and WMF 5.1 compat page * Add note explaining WMF does not ship in Windows * Typo fix ("you will are not" -> "you will not"). (#1951) * Typo fix ("you will are not" -> "you will not"). * Changed from passive voice to active voice * added article about formatting code samples * fixing typos * fixed typos and incorporated feedback * updating metadata tags in docfx.json * fixing filename spelling * Fix parameter's position in Get-Content.md (#1959) * Fix parameter's position in Get-Member.md (#1958) * Update PSGallery "Items Tab" (for the new prerelease feature) (#1957) * Fix link for about_WorkflowCommonParameters in New-PSWorkflowExecutionOption.md (#1962) * Fix link for about_Types.ps1xml in Update-TypeData.md (#1961) * Fix parameter's position in Group-Object.md (#1966) * Fix hex values in about_Arithmetic_Operators.md (#1965) * Indent headers as subheaders (#1967) * Update minor typo in Limit-EventLog.md (#1968) * Update Example 3 in Get-FileHash.md (#1969) * Fix parameter's position in Tee-Object.md (#1970) * fixing output example per issue 1933 * fix -Path metadata to reflect wildcard support * fixing issue 1640 * fixing issue 1651 * Fix link for about_Remote_Requirements (#1976) * Split parameter set in Sort-Object.md v6.0 (#1975) Since v6.0, Sort-Object cmdlet has two parameter sets, "Default" and "Bottom". * Fix link for about_Preference_Variables (#1982) http://... -> relative path * Fix broken headers in Get-CimSession.md v6.0 (#1981) * Update Example 1 in Import-Counter.md (#1980) * move $OFS to prefs article added note about read-only (#1978) * Update decisionMaker.md (#1984) Slight, but critical corrections to the definition of DevOps. * Update configurations.md (#1985) * Fix parameter's position in Restart-Service.md (#1993) * Fix link for logical operators in about_Operator_Precedence.md (#1992) * Update scriptResource.md (#1986) Match specified GetScript rule * Bad link (#1988) The link "http://go.microsoft.com/fwlink/?LinkId=119096" is supposed to point to a page or a document about "Code-Signing Best Practices". However, it points to a video about "Understanding Extension INFs and Component INFs". I watched the whole video and there is nothing inside about "Code-Signing Best Practices". The best match I have found is the following one: http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/best_practices.doc It would be a very good idea to make a web page from this document. Pieces of advice it contains are still accurate. * Update Example 1 of Protect-CmsMessage (#1987) The existing example did not specify you needed to create the INF. This not only says so but does so using a script block piped to out-file * Small edits for mispellings (#1989) * Corrected command (#1990) The CanPauseAndContinue property is a boolean so the correct comparison to use is $true rather than "True". * removing module ref for modules that do not ship in v6-rc2 (#1996) * Fix parameter's position in Resume-Service.md (#1998) * Fix link for about_Providers (#1999) * Help doc enhancement for ConvertFrom-StringData cmdlet (#2002) * Help doc correction Removed an unwanted * from Notes section Corrected intenting for last example Removed unwanted ... from example 2 * Help doc wnhancements in all versions for ConvertFrom-StringData Removed an unwanted * from Notes section Corrected intenting for last example Removed unwanted ... from example 2 * PowerShell 6 logging on Windows, Linux, and MacOS (#1922) * First draft of PowerShell 6 logging * Fix style guideline issues. * Document logging settings in PowerShellProperties.json * Address PR Feedback Limit lines to 80 columns, when possible Insert <br> in selected locations to improve readability of rendered markdown. * Reformatted tables Reformatted tables to work with new processing of About_* topics * Adding calling the ComputerName parameter to the example (#1964) * Adding calling the ComputerName parameter to the example * Changing quotes to brackets * Removed unused variable in Example 1 (#2004) The variable was declared but not used. It also appears in the same place in Example 2 but is used later on. * Made surrounding text agree with sample code. (#2003) * Reformatting v4 About_ topics missed in first pass (#2006) * v4 about scrub missed files * fixing broken links * fix broken link * Reformatting v3 About_ topics missed in first pass (#2005) * v3 about scrub missed files * fixing broken links * fix broken link * Reformatting v5 About_ topics missed in first pass (#2008) * v5 about scrub missed files * fixing broken links * v5.1 about scrub missed files (#2009) * Reformatting v6 About_ topics missed in first pass (#2010) * v6 about scrub missed files * fixing broken links and removing non-v6 content * final pass on About_ topic reformat (#2011)
1 parent 60f06a0 commit 378c7ed

File tree

204 files changed

+23582
-22597
lines changed

Some content is hidden

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

204 files changed

+23582
-22597
lines changed

dsc/configurations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Configuration MyDscConfiguration {
6161
}
6262
}
6363
}
64-
MyDscConfiguration
64+
MyDscConfiguration -ComputerName <MyComputer>
6565
6666
```
6767

dsc/scriptResource.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ Script [string] #ResourceName
4747

4848
## Example 1
4949
```powershell
50-
$version = Get-Content 'version.txt'
51-
5250
Configuration ScriptTest
5351
{
5452
Import-DscResource –ModuleName 'PSDesiredStateConfiguration'

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

Lines changed: 358 additions & 305 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ The environment variables that store preferences include:
244244
The default value of $Env:PSModulePath is:
245245

246246
```
247-
$home\Documents\WindowsPowerShell\Modules; $pshome\Modules
247+
$HOME\Documents\WindowsPowerShell\Modules; $PSHOME\Modules
248248
```
249249

250-
Windows PowerShell sets the value of "\$pshome\\Modules" in the registry. It
251-
sets the value of "\$home\\Documents\\WindowsPowerShell\\Modules" each time you
250+
Windows PowerShell sets the value of "\$PSHOME\\Modules" in the registry. It
251+
sets the value of "\$HOME\\Documents\\WindowsPowerShell\\Modules" each time you
252252
start Windows PowerShell.
253253

254254
In addition, setup programs that install modules in other directories, such as
@@ -294,7 +294,7 @@ $path = [System.Environment]::GetEnvironmentVariable("PSModulePath",
294294
```
295295

296296
For more information about the methods of the System.Environment class, see
297-
[Environment Methods](http://go.microsoft.com/fwlink/?LinkId=242783) in
297+
[Environment Methods](https://go.microsoft.com/fwlink/?LinkId=242783) in
298298
MSDN.
299299

300300
You can add also add a command that changes the value to your profile or use

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ all the values in an array, consider using a Foreach statement.
2525
The following shows the For statement syntax.
2626

2727
```powershell
28-
for (>init>; <condition>; <repeat>)
28+
for (<init>; <condition>; <repeat>)
2929
{<statement list>}
3030
```
3131

Lines changed: 134 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,77 @@
11
---
2-
ms.date: 2017-06-09
2+
ms.date: 2018-01-03
33
schema: 2.0.0
44
locale: en-us
55
keywords: powershell,cmdlet
66
title: about_Functions_Advanced_Methods
77
---
88

99
# About Functions Advanced Methods
10-
## about_Functions_Advanced_Methods
1110

11+
## SHORT DESCRIPTION
1212

13-
# SHORT DESCRIPTION
14-
15-
Describes how functions that specify the `CmdletBinding` attribute can use
16-
the methods and properties that are available to compiled cmdlets.
13+
Describes how functions that specify the `CmdletBinding` attribute can use the
14+
methods and properties that are available to compiled cmdlets.
1715

1816
# LONG DESCRIPTION
1917

2018
Functions that specify the `CmdletBinding` attribute can access a number of
21-
methods and properties through the `$pscmdlet` variable. These methods
22-
include the following methods:
19+
methods and properties through the `$pscmdlet` variable. These methods include
20+
the following methods:
2321

2422
- Input-processing methods that compiled cmdlets use to do their work.
25-
2623
- The `ShouldProcess` and `ShouldContinue` methods that are used to get
27-
user feedback before an action is performed.
28-
24+
user feedback before an action is performed.
2925
- The `ThrowTerminatingError` method for generating error records.
30-
3126
- Several Write methods that return different types of output.
3227

3328
All the methods and properties of the `PSCmdlet` class are available to
34-
advanced functions. For more information about these methods and
35-
properties, see `System.Management.Automation.PSCmdlet` in the MSDN
36-
(Microsoft Developer Network) library at
37-
http://go.microsoft.com/fwlink/?LinkId=142139.
38-
39-
# Input Processing Methods
40-
41-
The methods described in this section are referred to as the input
42-
processing methods. For functions, these three methods are represented
43-
by the `Begin`, `Process`, and `End` blocks of the function. Each function
44-
must include one or more of these blocks. The Windows PowerShell runtime
45-
uses the code within these blocks when it is running a function. (These
46-
blocks are also available to functions that do not use the `CmdletBinding`
47-
attribute.)
48-
49-
## Begin
29+
advanced functions. For more information about these methods and properties,
30+
see [`System.Management.Automation.PSCmdlet`](http://go.microsoft.com/fwlink/?LinkId=142139) in the MSDN library.
31+
32+
### Input Processing Methods
33+
34+
The methods described in this section are referred to as the input processing
35+
methods. For functions, these three methods are represented by the `Begin`,
36+
`Process`, and `End` blocks of the function. Each function must include one or
37+
more of these blocks. The Windows PowerShell runtime uses the code within
38+
these blocks when it is running a function. (These blocks are also available
39+
to functions that do not use the `CmdletBinding` attribute.)
40+
41+
#### Begin
42+
5043
This block is used to provide optional one-time preprocessing for the
51-
function. The Windows PowerShell runtime uses the code in this block one
52-
time for each instance of the function in the pipeline.
53-
54-
## Process
55-
This block is used to provide record-by-record processing for the
56-
function. This block might be used any number of times, or not at all,
57-
depending on the input to the function. For example, if the function is
58-
the first command in the pipeline, the `Process` block will be used one
59-
time. If the function is not the first command in the pipeline, the
60-
`Process` block is used one time for every input that the function
61-
receives from the pipeline. If there is no pipeline input, the `Process`
62-
block is not used.
63-
64-
This block must be defined if a function parameter is set to accept
65-
pipeline input. If this block is not defined and the parameter accepts
66-
input from the pipeline, the function will miss the values that are
67-
passed to the function through the pipeline.
44+
function. The Windows PowerShell runtime uses the code in this block one time
45+
for each instance of the function in the pipeline.
46+
47+
#### Process
48+
49+
This block is used to provide record-by-record processing for the function.
50+
This block might be used any number of times, or not at all, depending on the
51+
input to the function. For example, if the function is the first command in
52+
the pipeline, the `Process` block will be used one time. If the function is
53+
not the first command in the pipeline, the `Process` block is used one time
54+
for every input that the function receives from the pipeline. If there is no
55+
pipeline input, the `Process` block is not used.
56+
57+
This block must be defined if a function parameter is set to accept pipeline
58+
input. If this block is not defined and the parameter accepts input from the
59+
pipeline, the function will miss the values that are passed to the function
60+
through the pipeline.
6861

6962
Also, when the function supports confirmation requests (when the
7063
`SupportsShouldProcess` parameter of the Parameter attribute is set to
71-
`$True`), the call to the `ShouldProcess` method must be made from within
72-
the Process block.
64+
`$True`), the call to the `ShouldProcess` method must be made from within the
65+
Process block.
66+
67+
#### End
7368

74-
## End
75-
This block is used to provide optional one-time post-processing for
76-
the function.
69+
This block is used to provide optional one-time post-processing for the
70+
function.
7771

78-
The following example shows the outline of a function that contains a
79-
`Begin` block for one-time preprocessing, a `Process` block for multiple
80-
record processing, and an `End` block for one-time post-processing.
72+
The following example shows the outline of a function that contains a `Begin`
73+
block for one-time preprocessing, a `Process` block for multiple record
74+
processing, and an `End` block for one-time post-processing.
8175

8276
```powershell
8377
Function Test-ScriptCmdlet
@@ -90,119 +84,125 @@ Function Test-ScriptCmdlet
9084
}
9185
```
9286

93-
# Confirmation Methods
87+
### Confirmation Methods
88+
89+
#### ShouldProcess
9490

95-
## ShouldProcess
9691
This method is called to request confirmation from the user before the
97-
function performs an action that would change the system. The function
98-
can continue based on the Boolean value returned by the method. This
99-
method can be called only from within the `Process{}` block of the
100-
function. And, the `CmdletBinding` attribute must declare that the
101-
function supports `ShouldProcess` (as shown in the previous example).
92+
function performs an action that would change the system. The function can
93+
continue based on the Boolean value returned by the method. This method can be
94+
called only from within the `Process{}` block of the function. And, the
95+
`CmdletBinding` attribute must declare that the function supports
96+
`ShouldProcess` (as shown in the previous example).
10297

10398
For more information about this method, see
104-
`System.Management.Automation.Cmdlet.ShouldProcess` in the MSDN library at
105-
http://go.microsoft.com/fwlink/?LinkId=142142.
99+
[`System.Management.Automation.Cmdlet.ShouldProcess`](http://go.microsoft.com/fwlink/?LinkId=142142)
100+
in the MSDN library.
106101

107102
For more information about how to request confirmation, see
108-
"Requesting Confirmation" in the MSDN library at
109-
http://go.microsoft.com/fwlink/?LinkID=136658.
103+
[Requesting Confirmation](http://go.microsoft.com/fwlink/?LinkID=136658)
104+
in the MSDN library.
105+
106+
#### ShouldContinue
110107

111-
## ShouldContinue
112-
This method is called to request a second confirmation message. It
113-
should be called when the `ShouldProcess` method returns `$true`. For more
114-
information about this method, see
115-
`System.Management.Automation.Cmdlet.ShouldContinue` in the MSDN library
116-
at http://go.microsoft.com/fwlink/?LinkId=142143.
108+
This method is called to request a second confirmation message. It should be
109+
called when the `ShouldProcess` method returns `$true`. For more information
110+
about this method, see `System.Management.Automation.Cmdlet.ShouldContinue` in
111+
the MSDN library at http://go.microsoft.com/fwlink/?LinkId=142143.
117112

118-
# Error Methods
113+
### Error Methods
119114

120115
Functions can call two different methods when errors occur. When a
121-
nonterminating error occurs, the function should call the `WriteError`
122-
method, which is described in the "Write Methods" section. When a
123-
terminating error occurs and the function cannot continue, it should call
124-
the `ThrowTerminatingError` method. You can also use the `Throw` statement for
116+
nonterminating error occurs, the function should call the `WriteError` method,
117+
which is described in the "Write Methods" section. When a terminating error
118+
occurs and the function cannot continue, it should call the
119+
`ThrowTerminatingError` method. You can also use the `Throw` statement for
125120
terminating errors and the `Write-Error` cmdlet for nonterminating errors.
126121

127-
For more information, see `System.Management.Automation.Cmdlet.ThrowTerminatingError`
128-
in the MSDN libray at
129-
http://go.microsoft.com/fwlink/?LinkId=142144.
122+
For more information, see
123+
[`System.Management.Automation.Cmdlet.ThrowTerminatingError`](http://go.microsoft.com/fwlink/?LinkId=142144)
124+
in the MSDN libray.
130125

131-
# Write Methods
126+
### Write Methods
132127

133-
A function can call the following methods to return different types of
134-
output. Notice that not all the output goes to the next command in the
135-
pipeline. You can also use the various Write cmdlets, such as
136-
Write-Error.
128+
A function can call the following methods to return different types of output.
129+
Notice that not all the output goes to the next command in the pipeline. You
130+
can also use the various Write cmdlets, such as Write-Error.
131+
132+
#### WriteCommandDetail
137133

138-
## WriteCommandDetail
139134
For information about the `WriteCommandDetails` method, see
140-
`System.Management.Automation.Cmdlet.WriteCommandDetail` in the MSDN
141-
library at http://go.microsoft.com/fwlink/?LinkId=142155.
142-
143-
## WriteDebug
144-
To provide information that can be used to troubleshoot a function,
145-
make the function call the `WriteDebug` method. This displays debug
146-
messages to the user. For more information, see
147-
`System.Management.Automation.Cmdlet.WriteDebug` in the MSDN library
148-
at http://go.microsoft.com/fwlink/?LinkId=142156.
149-
150-
## WriteError
151-
Functions should call this method when nonterminating errors occur and
152-
the function is designed to continue processing records. For more
153-
information, see `System.Management.Automation.Cmdlet.WriteError` in the
154-
MSDN library at http://go.microsoft.com/fwlink/?LinkId=142157.
135+
[`System.Management.Automation.Cmdlet.WriteCommandDetail`](http://go.microsoft.com/fwlink/?LinkId=142155)
136+
in the MSDN library.
137+
138+
#### WriteDebug
139+
140+
To provide information that can be used to troubleshoot a function, make the
141+
function call the `WriteDebug` method. This displays debug messages to the
142+
user. For more information, see
143+
[`System.Management.Automation.Cmdlet.WriteDebug`](http://go.microsoft.com/fwlink/?LinkId=142156)
144+
in the MSDN library.
145+
146+
#### WriteError
147+
148+
Functions should call this method when nonterminating errors occur and the
149+
function is designed to continue processing records. For more information, see
150+
[`System.Management.Automation.Cmdlet.WriteError`](http://go.microsoft.com/fwlink/?LinkId=142157)
151+
in the MSDN library.
155152

156153
Note: If a terminating error occurs, the function should call the
157154
`ThrowTerminatingError` method.
158155

159-
## WriteObject
160-
This method allows the function to send an object to the next command in
161-
the pipeline. In most cases, this is the method to use when the function
162-
returns data. For more information, see
163-
`System.Management.Automation.PSCmdlet.WriteObject` in the MSDN library at
164-
http://go.microsoft.com/fwlink/?LinkId=142158.
165-
166-
## WriteProgress
167-
For functions whose actions take a long time to complete, this method
168-
allows the function to call the `WriteProgress` method so that progress
169-
information is displayed. For example, you can display the percent
170-
completed. For more information, see
171-
`System.Management.Automation.PSCmdlet.WriteProgress` in the MSDN library
172-
at http://go.microsoft.com/fwlink/?LinkId=142160.
173-
174-
## WriteVerbose
175-
To provide detailed information about what the function is doing, make
176-
the function call the `WriteVerbose` method to display verbose messages to
177-
the user. By default, verbose messages are not displayed. For more
178-
information, see `System.Management.Automation.PSCmdlet.WriteVerbose`
179-
in the MSDN library at http://go.microsoft.com/fwlink/?LinkId=142162.
180-
181-
## WriteWarning
182-
To provide information about conditions that may cause unexpected
183-
results, make the function call the WriteWarning method to display
184-
warning messages to the user. By default, warning messages are displayed.
185-
For more information, see
186-
`System.Management.Automation.PSCmdlet.WriteWarning` in the MSDN library
187-
at http://go.microsoft.com/fwlink/?LinkId=142164.
156+
#### WriteObject
157+
158+
This method allows the function to send an object to the next command in the
159+
pipeline. In most cases, this is the method to use when the function returns
160+
data. For more information, see
161+
[`System.Management.Automation.PSCmdlet.WriteObject`](http://go.microsoft.com/fwlink/?LinkId=142158)
162+
in the MSDN library.
163+
164+
#### WriteProgress
165+
166+
For functions whose actions take a long time to complete, this method allows
167+
the function to call the `WriteProgress` method so that progress information
168+
is displayed. For example, you can display the percent completed. For more
169+
information, see [`System.Management.Automation.PSCmdlet.WriteProgress`](http://go.microsoft.com/fwlink/?LinkId=142160)
170+
in the MSDN library.
171+
172+
#### WriteVerbose
173+
174+
To provide detailed information about what the function is doing, make the
175+
function call the `WriteVerbose` method to display verbose messages to the
176+
user. By default, verbose messages are not displayed. For more information,
177+
see
178+
[`System.Management.Automation.PSCmdlet.WriteVerbose`](http://go.microsoft.com/fwlink/?LinkId=142162)
179+
in the MSDN library.
180+
181+
#### WriteWarning
182+
183+
To provide information about conditions that may cause unexpected results,
184+
make the function call the WriteWarning method to display warning messages to
185+
the user. By default, warning messages are displayed. For more information,
186+
see [`System.Management.Automation.PSCmdlet.WriteWarning`](http://go.microsoft.com/fwlink/?LinkId=142164)
187+
in the MSDN library.
188188

189189
Note: You can also display warning messages by configuring the
190190
`WarningPreference` variable or by using the `Verbose` and `Debug`
191191
command-line options.
192192

193-
# Other Methods and Properties
193+
### Other Methods and Properties
194194

195195
For information about the other methods and properties that can be
196196
accessed through the `$PSCmdlet` variable, see
197-
`System.Management.Automation.PSCmdlet` in the MSDN library at
198-
http://go.microsoft.com/fwlink/?LinkId=142139.
197+
[`System.Management.Automation.PSCmdlet`](http://go.microsoft.com/fwlink/?LinkId=142139)
198+
in the MSDN library.
199199

200200
For example, the `ParameterSetName` property allows you to see the parameter
201201
set that is being used. Parameter sets allow you to create a function that
202-
performs different tasks based on the parameters that are specified when
203-
the function is run.
202+
performs different tasks based on the parameters that are specified when the
203+
function is run.
204204

205-
# SEE ALSO
205+
## SEE ALSO
206206

207207
[about_Functions](about_Functions.md)
208208

@@ -213,4 +213,3 @@ the function is run.
213213
[about_Functions_CmdletBindingAttribute](about_Functions_CmdletBindingAttribute.md)
214214

215215
[about_Functions_OutputTypeAttribute](about_Functions_OutputTypeAttribute.md)
216-

0 commit comments

Comments
 (0)