Write Debug 幫助資訊

2021-04-13 07:11:50 字數 1993 閱讀 5816

如下說明是翻譯

: help write-debug

產生的幫助資訊.

譯者: edengundam(馬濤)

write-debug

大綱

輸出調式資訊到

host.

語法

write-debug [-message]

詳細描述

從指令碼或命令中輸出除錯資訊到控制台

. 資訊是否被輸出到控制台

, 取決於

$debugpreference

變數.

輸入$debugpreference

產看該變數的當前取值

. 為當前會話設定該變數的值

, 輸入

$debugpreference  = "".

合法取值為

: silentlycontinue, stop, continue

和inquire.

如果設定為

silentlycontinue, write-debug

將不會向控制台輸出任何資訊.

引數

-message

指定傳送到控制台的除錯資訊.

強制引數?

true

引數位置?

1 預設值

允許從管道繫結輸入?

true (傳值)

允許萬用字元擴充套件?

false

<公共引數>

此命令支援公共引數

: -verbose, -debug, -erroraction, -errorvariable, and -outvariable.

更多資訊

, 輸入

, "get-help about_commonparameters".

輸入型別

字串

返回型別

注意

更多資訊

, 輸入

"get-help write-debug -detailed".

需要技術資訊

, 輸入

"get-help write-debug -full".

如果需要為該命令提供多個引數

, 請使用逗號進行分隔

. 例如

, ", ".

1

c:/ps>$debugpreference = "continue"

write-debug "this script has attempted to open file xyx and cannot."

$debugpreference = "silentlycontinue"

write-debug "this is another debug statement."

此命令輸出的調式資訊

, 將根據

$debugpreference

變數的取值來決定是否顯示

. 當該變數取值為

"silentlycontinue"

意味著不輸出該語句

. 當該變數取值為

"continue"

意味著輸出該值.

debug: this script has attempted to open file xyx and cannot.

相關鏈結

write-verbose

write-error

write-host

write-progress

write-output

write-warning

Write Warning 幫助資訊

如下說明是翻譯 help write warning 產生的幫助資訊.譯者 edengundam 馬濤 write warning 大綱 輸出警告資訊.語法 write warning message 詳細描述 輸出警告資訊 錯誤資訊被直接發往宿主 host 根據 warningpreference...

Write host 幫助資訊

如下說明是翻譯 help write host 產生的幫助資訊.譯者 edengundam 馬濤 write host 大綱 使用host 使用者介面顯示輸入物件 語法 write host object nonewline separator foregroundcolor backgroundc...

Update TypeData 幫助資訊

如下說明是翻譯 help update typedata 產生的幫助資訊.譯者 edengundam 馬濤 update typedata 大綱 通過重新讀取 types.ps1xml 檔案到記憶體 更新型別擴充套件的配置資訊.語法 詳細描述 通過重新讀取 types.ps1xml 檔案到記憶體 更...