我试图使用任务计划程序使下面的PowerShell脚本工作.问题是它不会删除任何文件.
当我手动运行它时,需要在删除文件之前进行确认.
Recurse parameter was not specified. If you continue, all children will be removed with the item. Are you sure you want
to continue?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
Run Code Online (Sandbox Code Playgroud)
如何编辑此脚本以删除文件而不进行任何确认,以便我可以使用任务管理器运行它?
#----- define parameters -----#
#----- get current date ----#
$Now = Get-Date
#----- define amount of days ----#
$Days = "10"
#----- define folder where files are located ----#
$TargetFolder = "D:\Shares\Downloads\TV\AutoDL"
#----- define extension …Run Code Online (Sandbox Code Playgroud) powershell ×1