相关文章推荐
听话的吐司  ·  spring ...·  1 年前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

Description

The Out-Null cmdlet sends its output to NULL, in effect, removing it from the pipeline and preventing the output from being displayed on screen.

Examples

Example 1: Delete output

Get-ChildItem | Out-Null

This command gets items in the current location/directory, but its output is not passed through the pipeline nor displayed at the command line. This is useful for hiding output that you do not need.

Parameters

-InputObject

Specifies the object to be sent to NULL (removed from pipeline). Enter a variable that contains the objects, or type a command or expression that gets the objects.

Type: PSObject Position:Named Default value:None Accept pipeline input:True Accept wildcard characters:False

Inputs

PSObject

You can pipe any object to this cmdlet.

Outputs

This cmdlet returns no output.

Notes

  • The cmdlets that contain the Out verb (the Out cmdlets) do not have parameters for names or file paths. To send data to an Out cmdlet, use a pipeline operator ( | ) to send the output of a PowerShell command to the cmdlet. You can also store data in a variable and use the InputObject parameter to pass the data to the cmdlet. For more information, see the examples.
  • Out-Null does not return any output objects. If you pipe the output of Out-Null to the Get-Member cmdlet, Get-Member reports that no objects have been specified.
  • Out-Default
  • Out-Host
  •