Out-Default

將輸出傳送到預設格式化器和預設輸出指令檔。

語法

Default (預設值)

Out-Default
    [-Transcript]
    [-InputObject <PSObject>]
    [<CommonParameters>]

Description

PowerShell 會 Out-Default 自動加入每個頂層互動管線的末端。 Out-Default 將收到的物件傳遞給 PowerShell 格式系統。 接著,它會把格式化的輸出寫入主控台。 這個 cmdlet 並非設計給最終使用者使用。

範例

範例 1

雖然此指令本不打算由最終使用者直接執行,但可以。

Get-Process | Select-Object -First 5 | Out-Default
 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
     12     2.56       5.20       0.00    7376   0 aesm_service
     48    34.32      18.10      26.64    9320  13 AlertusDesktopAlert
     24    13.97      12.74       0.77   12656  13 ApplicationFrameHost
      8     1.79       4.41       0.00    8180   0 AppVShNotify
      9     1.99       5.07       0.19   19320  13 AppVShNotify

使用 Out-Default 時不會丟出錯誤,但如果沒有明確呼叫,輸出也不會改變。

參數

-InputObject

接受對指令碼的輸入。

參數屬性

類型:PSObject
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:True
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Transcript

使用這個參數時,輸出只會傳送到 PowerShell 的文字記錄。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

CommonParameters

此 cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。