我需要在PowerShell中創建自定義列到腳本的輸出。powershell腳本創建自定義列到屏幕輸出
dc55 (UTC-04:00) Santiago 4/26/2017 11:34:42 AM
DC10 (UTC-04:00) Santiago 4/26/2017 11:34:43 AM
DC11 (UTC-04:00) Santiago 4/26/2017 11:34:44 AM
DHCP10 (UTC-04:00) Santiago 4/26/2017 11:34:44 AM
DHCP11 (UTC-04:00) Santiago 4/26/2017 11:34:45 AM
因此,例如,我需要格式化輸出這樣
Server TimeZone Date and Time
----- -------- --------------
dc55 (UTC-04:00) Santiago 4/26/2017 11:34:42 AM
DC10 (UTC-04:00) Santiago 4/26/2017 11:34:43 AM
DC11 (UTC-04:00) Santiago 4/26/2017 11:34:44 AM
DHCP10 (UTC-04:00) Santiago 4/26/2017 11:34:44 AM
DHCP11 (UTC-04:00) Santiago 4/26/2017 11:34:45 AM
這是輸出的在我的腳本行:
Write-Host "$Server $TimeZone $date_time"
歡迎來到Stack Overflow。請參加2分鐘的[遊覽]。 此外,打開[幫助]並至少閱讀[問]。然後,[編輯]你的問題提供[mcve]。 – JosefZ