Stop-Transcript

停止脚本。

语法

Default (默认值)

Stop-Transcript
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

说明

Stop-Transcript cmdlet 停止由 Start-Transcript cmdlet 启动的脚本。 或者,您可以结束会话以停止文字记录。

示例

示例 1:停止所有脚本

Stop-Transcript

此命令将停止所有脚本。

参数

-Confirm

在运行 cmdlet 之前,提示你进行确认。

此参数已在 PowerShell 7.4 中添加。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

显示 cmdlet 运行时会发生什么情况。 cmdlet 未能运行。

此参数已在 PowerShell 7.4 中添加。

参数属性

类型: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

输入

None

不能用管道将对象传送到此 cmdlet。

输出

String

此 cmdlet 返回一个字符串,其中包含状态消息和输出文件的路径。

备注

如果脚本尚未启动,则命令失败。