Write-Debug 帮助信息

 
如下说明是翻译 : help write-debug 产生的帮助信息 .
译者 : Edengundam( 马涛 )
 
Write-Debug
 
大纲
输出调式信息到 host.
 
语法
Write-Debug [-message] <string> [<CommonParameters>]
 
详细描述
从脚本或命令中输出调试信息到控制台 . 信息是否被输出到控制台 , 取决于 $DebugPreference 变量 . 输入 $DebugPreference 产看该变量的当前取值 . 为当前会话设置该变量的值 , 输入 $DebugPreference  = "<value>". 合法取值为 : SilentlyContinue, Stop, Continue Inquire. 如果设置为 SilentlyContinue, Write-Debug 将不会向控制台输出任何信息 .
 
参数
 
-message <string>
指定发送到控制台的调试信息 .
 
强制参数 ?
true
参数位置 ?
1
默认值
 
允许从管道绑定输入 ?
true ( 传值 )
允许通配符扩展 ?
false
 
< 公共参数 >
此命令支持公共参数 : -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. 更多信息 , 输入 , "get-help about_commonparameters".
 
输入类型
字符串
 
返回类型
 
注意
 
更多信息 , 输入 "Get-Help Write-Debug -detailed". 需要技术信息 , 输入 "Get-Help Write-Debug -full".
 
如果需要为该命令提供多个参数 , 请使用逗号进行分隔 . 例如 , "<parameter-name> <value1>, <value2>".
 
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
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值