Out-Null
Hides the output instead of sending it down the pipeline or displaying it.
语法
Default (默认值)
Out-Null
[-InputObject <PSObject>]
[<CommonParameters>]
说明
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.
示例
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.
参数
-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.
参数属性
类型: | PSObject |
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | True |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
输入
PSObject
You can pipe any object to this cmdlet.
输出
None
This cmdlet returns no output.
备注
- 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 ofOut-Null
to the Get-Member cmdlet,Get-Member
reports that no objects have been specified.