sách gpt4 ai đã đi

Powershell 脚本 - 脚本 - 我如何禁用它

In lại 作者:行者123 更新时间:2023-12-03 07:51:16 26 4
mua khóa gpt4 Nike

我有 powershell 脚本。通过调度程序,我运行 bat 文件,该文件运行 PS1 文件。

BAT文件

Powershell.exe -executionpolicy remotesigned -File script.PS1

PS1 文件

$path = "D:\data";
$limit = (Get-Date).AddHours(-3);
Get-ChildItem -Path $path -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force;

在同一目录中,powershell 创建格式为 YYYYMMDD 的目录,其中包含文件 PowerShell_transcript.SERVER.t7eh07Gy.20230914031500.txt。这是整个脚本的运行过程。

例如:D:\data\20230914\PowerShell_transcript.SERVER.t7eh07Gy.20230914031500.txtD:\data\20230915\PowerShell_transcript.SERVER.t7eh07Gy.20230914031500.txt等等

如何禁用它?

我尝试过停止转录等。

我需要停止转录。

1 Câu trả lời

转录的开始可以由组策略确定并独立于脚本执行。请查看此处的政策示例:

HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription

如果此键中有 EnableTranscripting 值且不等于 0,则启用转录。

关于Powershell 脚本 - 脚本 - 我如何禁用它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77112562/

26 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com