Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to redirect operators in POWERSHELL

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to redirect operators in POWERSHELL, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Tee-Object tee object

Save the command output in a file or variable and send it to the pipe.

Description

The redirect output of the three-way object cmdlet, that is, it sends the output of the command in two directions (such as the letter T). It stores the output in a file or variable and sends it along the pipe. If Tee-Object is the last command in the pipe, the command output is displayed at the prompt.

We are not going to read the commands in this tutorial. We will only check the redirection operator.

The PowerShell redirect operator specifies the file output using specific characters. Please check the following list:

*-all output

1-successful output

2-error

3-warning messa

4-detailed output

5-Debug messa

6-Information flow

In order to use *, you need to have PowerShell3.0 or above. These four types are introduced in Powershell 3.0. The new type introduced in PowerShell 5.0is 6. You need to use PowerShell 5.0 or later to use it.

Redirect operator

>-sends the output to the specified file

>-appends the output to the contents of the specified file

2 > >-appends an error to the contents of the specified file

2 > & 1-send error and success output to the success output stream

3 >-send a warning to the specified file

3 > >-appends a warning to the contents of the specified file.

3 > & 1-send warning and successful output to successful output stream

4 >-send detailed output to the specified file

4 > >-appends detailed output to the contents of the specified file

4 > & 1-send detailed and successful output to the successful output stream

5 >-send debug messages to the specified file

5 > >-appends debug messages to the contents of the specified file

5 > & 1-send debug messages and successful output to the successful output stream

6 >-sends the information flow to the specified file

6 > >-appends the information flow to the contents of the specified file

6 > & 1-sends a stream of information and successful output to the successful output stream.

* >-sends all output types to the specified file

* > >-appends all output types to the contents of the specified file

* > & 1-send all output types to the successful output stream

After reading the above, do you have any further understanding of how to redirect operators in POWERSHELL? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report