Out-Null
Applies To: Windows PowerShell 2.0
Deletes output instead of sending it to the console.
Syntax
Out-Null [-InputObject <psobject>] [<CommonParameters>]
Description
The Out-Null cmdlet sends output to NULL, in effect, deleting it.
Parameters
-InputObject <psobject>
Specifies the object that was sent to null (deleted). Enter a variable that contains the objects, or type a command or expression that gets the objects.
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This command supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, OutBuffer, OutVariable, WarningAction, and WarningVariable. For more information, see about_CommonParameters.
Inputs and Outputs
The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns.
Inputs |
System.Management.Automation.PSObject You can pipe any object to Out-Null. |
Outputs |
None Out-Null does not generate any 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 Windows 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 Get-Member, Get-Member reports that no objects have been specified.
Example 1
C:\PS>get-childitem | out-null
Description
-----------
This command gets the items in the local directory, but then it discards them instead of passing them through the pipeline or displaying them at the command line. This is useful for discarding output that you do not need.