Skip to content

Merging latest updates into Live #1927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 92 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
2a3ccf3
Update the example of `Where-Object -IsNot` (#1841)
matt9ucci Nov 7, 2017
f778a37
Update Example 5 in Group-Object.md (#1845)
matt9ucci Nov 8, 2017
1357977
removing @{Text=} tags
Nov 7, 2017
efba651
fixing UTF8 characters
Nov 7, 2017
b93a6ba
removed empty H3
Nov 7, 2017
ec505bf
added H3 for input and output types
Nov 7, 2017
c2abb44
removed mangled UTF8 character
Nov 8, 2017
bbffd77
updating Out-* commands with -NoNewLine per Issue 1739
Nov 9, 2017
2bdb9e6
Fix the example of `Format-Table -DisplayError` (#1848)
matt9ucci Nov 9, 2017
61cb77d
Fix the example of `Format-Wide -DisplayError` (#1850)
matt9ucci Nov 10, 2017
882b0e8
Fix the example of `Format-Custom -DisplayError` (#1849)
matt9ucci Nov 10, 2017
67db02a
updating set-acl docs per PR#901
Nov 7, 2017
9799c2b
using semantic link breaks
Nov 10, 2017
a5f21c5
Fix the example of `Format-Wide -ShowError` (#1851)
matt9ucci Nov 13, 2017
9467262
Fixed Test-ScriptFileInfo example (#1852)
alan-null Nov 13, 2017
b5d12a3
fixing issue 1768
Nov 7, 2017
b04197f
Formatting, example fix for Body parameter (#1847)
ebrucucen Nov 13, 2017
b6b156a
fixing style consistency across articles
Nov 13, 2017
e03a354
fixing conflicts
Nov 13, 2017
07b21b0
Fix example numbers in Resume-Job.md (#1857)
matt9ucci Nov 14, 2017
348ed70
Fixes typo $WebSiteName in separatingEnvData.md (#1856)
DexterPOSH Nov 14, 2017
b04a75a
Updates configurations.md (#1855)
DexterPOSH Nov 14, 2017
484d598
Fix typo in comment (#1854)
ciriarte Nov 14, 2017
e46d3a1
Merge pull request #1846 from sdwheeler/sdw-issue1739
zjalexander Nov 14, 2017
f42a62f
Updating the help content for v6. (#1853)
adityapatwardhan Nov 15, 2017
eade8e4
Fix example numbers in about_Transactions.md (#1859)
matt9ucci Nov 15, 2017
518fde2
Update Alias-Provider.md (#1831)
doctordns Nov 15, 2017
248e283
Add documentation of new -AsHashtable switch for ConvertFrom-Json int…
bergmeister Nov 15, 2017
bcedaf0
Fix example numbers in Invoke-WebRequest.md (#1862)
matt9ucci Nov 16, 2017
8e4ac81
Merge branch 'live' into staging
Nov 16, 2017
1f54577
reformatting and integrating changes from PR#1831 (#1860)
Nov 16, 2017
aeeb091
Fix example numbers in Get-Help.md (#1869)
matt9ucci Nov 17, 2017
83b1241
Fix example numbers in Import-Module.md (#1868)
matt9ucci Nov 17, 2017
99be9ad
Fix example number in ConvertTo-Html.html (#1867)
matt9ucci Nov 17, 2017
919d940
Update dscCiCd.md (#1865)
tomlarse Nov 17, 2017
cb00730
Web Cmdlets 6.0.0 Documentation Refresh (#1870)
markekraus Nov 18, 2017
6e31c85
Merge Example 4 and 5 in Get-Member.md (#1874)
matt9ucci Nov 18, 2017
cc018bf
Remove hash algorithms unsupported in v6.0 (#1873)
matt9ucci Nov 19, 2017
b98aa67
Update outputs of Get-Verb (#1872)
matt9ucci Nov 19, 2017
1b2889e
Fix typo in ConvertTo-Html.md (UTF-x) (#1879)
matt9ucci Nov 20, 2017
4fec39b
Fix "Accept wildcard characters" in Get-Service.md v6 (#1878)
matt9ucci Nov 20, 2017
061245d
Fixed Get-WindowsFeature cmdlet HyperLink (#1877)
keeratsingh Nov 20, 2017
496832f
Update Get-WinEvent.md (#1876)
doctordns Nov 20, 2017
c644c38
Update Example 8 in Get-Process.md (find the owner of a process) (#1875)
matt9ucci Nov 20, 2017
58b15dd
updated localmachine\Root to LocalMachine\My (#1880)
rchaganti Nov 20, 2017
69c037d
Update Group property example in Get-Verb.md (#1881)
matt9ucci Nov 21, 2017
d69465e
adding missing space (#1885)
mairaw Nov 21, 2017
a066c77
removing stray character (#1886)
mairaw Nov 21, 2017
bf70ac9
Update Example 9 in Get-Process.md (#1888)
matt9ucci Nov 22, 2017
6687a84
Remove "About ISE" files of v6.0 (#1891)
matt9ucci Nov 27, 2017
23afc78
Update Get-Process.md (#1890)
doctordns Nov 27, 2017
5a8d5f4
Update productincompat.md (#1892)
Cloud-Writer Nov 27, 2017
46d7c99
Update unapproved verbs examples in Get-Verb.md (#1896)
matt9ucci Nov 28, 2017
a88c947
Removing extra space in the Example 5A script (#1894)
vrnithinkumar Nov 28, 2017
a2d0e9b
fixing merge conflict
Nov 28, 2017
f0f0da0
resolving conflict
Nov 28, 2017
d395d0e
updates to style and contrib
Nov 16, 2017
d4d446d
tweak format
Nov 16, 2017
67ad296
tweak format 2
Nov 16, 2017
7883844
fix typo
Nov 16, 2017
b4877f3
fix number list example
Nov 16, 2017
9e6ebd0
adding review feedback
Nov 22, 2017
323e325
fix broken links
Nov 22, 2017
e6b4a53
incorporating feedback from zach
Nov 27, 2017
7514fcf
reformatting About_* for 80 columns - part 1
Nov 27, 2017
66ecafd
reformat about_*
Nov 28, 2017
56dc2df
reformatting About_* topics - Part 2
Nov 28, 2017
d310e14
fixing broken links
Nov 28, 2017
e084dc5
fixing more broken links
Nov 28, 2017
05ff294
more broken links fixed
Nov 28, 2017
a935671
Fix parameter's position in Get-Random.md (#1901)
matt9ucci Nov 29, 2017
9040d65
Fix parameter's position in Measure-Command.md (#1905)
matt9ucci Nov 30, 2017
c715ab2
Fix parameter's position in Trace-Command.md (#1904)
matt9ucci Nov 30, 2017
6824d85
Actually call the configuration in the example (#1906)
charlesbihis Nov 30, 2017
cece485
reformatting About_* for 80 columns - part 3 (#1902)
Nov 30, 2017
877c2cc
reformatting About_* for 80 columns - part 4
Nov 30, 2017
1e0c256
Adding PreRelease versioning info for PSGallery & PSGet (#1903)
Dec 1, 2017
38d64d4
Style tweaks in STYLE.md (#1913)
SamB Dec 2, 2017
c6f3f13
Fix YAML metadata on "Understanding Concepts" (#1911)
SamB Dec 2, 2017
92e1b1b
Fix parameter's position in Join-Path.md (#1909)
matt9ucci Dec 2, 2017
b71d428
typo correction on line 85 (#1916)
J0F3 Dec 4, 2017
4e6505f
Fix parameter's position in Get-TraceSource.md (#1917)
matt9ucci Dec 4, 2017
a935850
Changed required PSGet version to 1.6.0 (#1920)
Dec 4, 2017
96504e3
Update Example 5 in Get-Process.md (#1923)
matt9ucci Dec 5, 2017
f586a98
fixing backlashes reported in PR1921 (#1924)
Dec 5, 2017
a08dbd5
Merge branch 'live' into staging
Dec 5, 2017
66349ff
reformatting About_* for 80 columns - part 5
Dec 1, 2017
6424e0d
reformatting About_* for 80 columns - part 6
Dec 1, 2017
03211c6
incorporating review feedback
Dec 4, 2017
a0b952c
reformatting About_* for 80 columns - part 7
Dec 2, 2017
bbe8f07
Fixed formatting of output per issue #808
Dec 4, 2017
eb2a12b
Merge branch 'live' into staging
Dec 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
364 changes: 195 additions & 169 deletions reference/3.0/Microsoft.PowerShell.Core/About/about_Properties.md

Large diffs are not rendered by default.

197 changes: 103 additions & 94 deletions reference/3.0/Microsoft.PowerShell.Core/About/about_Redirection.md
Original file line number Diff line number Diff line change
@@ -1,135 +1,145 @@
---
ms.date: 2017-06-09
ms.date: 2017-12-01
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
keywords: PowerShell,cmdlet
title: about_Redirection
---

# About Redirection
## about_Redirection


## SHORT DESCRIPTION
Explains how to redirect output from Windows PowerShell® to text files.

Explains how to redirect output from PowerShell to text files.

## LONG DESCRIPTION
By default, Windows PowerShell sends its command output to the Windows PowerShell console. However, you can direct the output to a text file, and you can redirect error output to the regular output stream.

You can use the following methods to redirect output:
By default, PowerShell sends its command output to the PowerShell console.
However, you can direct the output to a text file, and you can redirect error
output to the regular output stream.

- Use the Out-File cmdlet, which sends command output to a text file. Typically, you use the Out-File cmdlet when you need to use its parameters, such as the Encoding, Force, Width, or NoClobber parameters.
You can use the following methods to redirect output:

- Use the Tee-Object cmdlet, which sends command output to a text file and then sends it to the pipeline.
- Use the `Out-File` cmdlet, which sends command output to a text file.
Typically, you use the `Out-File` cmdlet when you need to use its parameters,
such as the **Encoding**, **Force**, **Width**, or **NoClobber** parameters.

- Use the Windows PowerShell redirection operators.
- Use the Tee-Object cmdlet, which sends command output to a text file and
then sends it to the pipeline.

- Use the PowerShell redirection operators.

### WINDOWS POWERSHELL REDIRECTION OPERATORS
The redirection operators enable you to send particular types of output to files and to the success output stream.
### POWERSHELL REDIRECTION OPERATORS

The Windows PowerShell redirection operators use the following characters to represent each output type:
The redirection operators enable you to send particular types of output to
files and to the success output stream.

The PowerShell redirection operators use the following characters to represent
each output type:

```
* All output
1 Success output
2 Errors
3 Warning messages
4 Verbose output
* All output
1 Success output
2 Errors
3 Warning messages
4 Verbose output
5 Debug messages
```

NOTE: The All (\*), Warning (3), Verbose (4) and Debug (5) redirection
operators were introduced in PowerShell 3.0. They do not work in earlier
versions of PowerShell.

NOTE: The All (\*), Warning (3), Verbose (4) and Debug (5) redirection operators were introduced in Windows PowerShell 3.0. They do not work in earlier versions of Windows PowerShell.
The PowerShell redirection operators are as follows.

The Windows PowerShell redirection operators are as follows.
```
Operator Description Example
-------- ---------------------- ------------------------------
> Sends output to the Get-Process > Process.txt
specified file.

>> Appends the output to dir *.ps1 >> Scripts.txt
the contents of the
specified file.

```
Operator Description Example
-------- ---------------------- ------------------------------
> Sends output to the Get-Process > Process.txt
specified file.

>> Appends the output to dir *.ps1 >> Scripts.txt
the contents of the
specified file.

2> Sends errors to the Get-Process none 2> Errors.txt
specified file.

2>> Appends errors to Get-Process none 2>> Save-Errors.txt
the contents of the
specified file.

2>&1 Sends errors (2) and Get-Process none, Powershell 2>&1
success output (1)
to the success
output stream.

3> Sends warnings to the Write-Warning "Test!" 3> Warnings.txt
specified file.

3>> Appends warnings to Write-Warning "Test!" 3>> Save-Warnings.txt
the contents of the
specified file.

3>&1 Sends warnings (3) and function Test-Warning
success output (1) { Get-Process PowerShell;
to the success Write-Warning "Test!" }
output stream. Test-Warning 3>&1

4> Sends verbose output to Import-Module * -Verbose 4> Verbose.txt
the specified file.

4>> Appends verbose output Import-Module * -Verbose 4>> Save-Verbose.txt
to the contents of the
specified file.

4>&1 Sends verbose output (4) Import-Module * -Verbose 4>&1
and success output (1)
to the success output
stream.

5> Sends debug messages to Write-Debug "Starting" 5> Debug.txt
the specified file.

5>> Appends debug messages Write-Debug "Saving" 5>> Save-Debug.txt
to the contents of the
specified file.

5>&1 Sends debug messages (5) function Test-Debug
and success output (1) { Get-Process PowerShell
to the success output Write-Debug "PS" }
stream. Test-Debug 5>&1

*> Sends all output types function Test-Output
to the specified file. { Get-Process PowerShell, none
Write-Warning "Test!"
*>> Appends all output types Write-Verbose "Test Verbose"
to the contents of the Write-Debug "Test Debug" }
specified file.
Test-Output *> Test-Output.txt
*>&1 Sends all output types Test-Output *>> Test-Output.txt
(*) to the success output Test-Output *>&1
2> Sends errors to the Get-Process none 2> Errors.txt
specified file.

2>> Appends errors to Get-Process none 2>> Save-Errors.txt
the contents of the
specified file.

2>&1 Sends errors (2) and Get-Process none, Powershell 2>&1
success output (1)
to the success
output stream.

3> Sends warnings to the Write-Warning "Test!" 3> Warnings.txt
specified file.

3>> Appends warnings to Write-Warning "Test!" 3>> Warnings.txt
the contents of the
specified file.

3>&1 Sends warnings (3) and function Test-Warning
success output (1) { Get-Process PowerShell;
to the success Write-Warning "Test!" }
output stream. Test-Warning 3>&1

4> Sends verbose output to Import-Module * -Verbose 4> Verbose.txt
the specified file.

4>> Appends verbose output Import-Module * -Verbose 4>> Verbose.txt
to the contents of the
specified file.

4>&1 Sends verbose output (4) Import-Module * -Verbose 4>&1
and success output (1)
to the success output
stream.
```

5> Sends debug messages to Write-Debug "Starting" 5> Debug.txt
the specified file.

5>> Appends debug messages Write-Debug "Saving" 5>> Debug.txt
to the contents of the
specified file.

5>&1 Sends debug messages (5) function Test-Debug
and success output (1) { Get-Process PowerShell
to the success output Write-Debug "PS" }
stream. Test-Debug 5>&1

*> Sends all output types function Test-Output
to the specified file. { Get-Process PowerShell, none
Write-Warning "Test!"
*>> Appends all output types Write-Verbose "Test Verbose"
to the contents of the Write-Debug "Test Debug" }
specified file.
Test-Output *> Test-Output.txt
*>&1 Sends all output types Test-Output *>> Test-Output.txt
(*) to the success Test-Output *>&1
output stream.
```

The syntax of the redirection operators is as follows:


```
<input> <operator> [<path>\]<file>
```

If the specified file already exists, the redirection operators that do not
append data (> and n>) overwrite the current contents of the file without
warning. However, if the file is a read-only, hidden, or system file, the
redirection fails. The append redirection operators (>> and n>>) do not write
to a read-only file, but they append content to a system or hidden file.

If the specified file already exists, the redirection operators that do not append data (> and n>) overwrite the current contents of the file without warning. However, if the file is a read-only, hidden, or system file, the redirection fails. The append redirection operators (>> and n>>) do not write to a read-only file, but they append content to a system or hidden file.

To force the redirection of content to a read-only, hidden, or system file, use the Out-File cmdlet with its Force parameter. When you are writing to files, the redirection operators use Unicode encoding. If the file has a different encoding, the output might not be formatted correctly. To redirect content to non-Unicode files, use the Out-File cmdlet with its Encoding parameter.

To force the redirection of content to a read-only, hidden, or system file,
use the Out-File cmdlet with its Force parameter. When you are writing to
files, the redirection operators use Unicode encoding. If the file has a
different encoding, the output might not be formatted correctly. To redirect
content to non-Unicode files, use the Out-File cmdlet with its Encoding
parameter.

## SEE ALSO

Expand All @@ -142,4 +152,3 @@ Tee-Object
[about_Command_Syntax](about_Command_Syntax.md)

[about_Path_Syntax](about_Path_Syntax.md)

Loading