将torrent名称添加到PowerShell脚本,该脚本在下载完成后运行
我有一个脚本,可以在torrent通过BitTorrent完成下载时发送Pushover通知。 剧本是:将torrent名称添加到PowerShell脚本,该脚本在下载完成后运行,powershell,bittorrent,Powershell,Bittorrent,我有一个脚本,可以在torrent通过BitTorrent完成下载时发送Pushover通知。 剧本是: $parameters = New-Object System.Collections.Specialized.NameValueCollection $parameters.Add("token", "xxxxxxxxxxxxxxxxxxzbzx") $parameters.Add("user", "xxxxxxxxxxxxxxxxxxxWJcV") $parameters.Add("me
$parameters = New-Object System.Collections.Specialized.NameValueCollection
$parameters.Add("token", "xxxxxxxxxxxxxxxxxxzbzx")
$parameters.Add("user", "xxxxxxxxxxxxxxxxxxxWJcV")
$parameters.Add("message", "Your torrent has finished dowloading.")
$client = New-Object System.Net.WebClient
$client.UploadValues("https://api.pushover.net/1/messages.json", $parameters)
我想添加torrent的名称。
在BitTorrent上,我在torrent完成时运行此命令:
powershell.exe -noexit c:\Scripts\transfinish.ps
如何执行此操作。宏%N表示torrent的标题。以以下方式运行命令行:
powershell.exe -ExecutionPolicy Unrestricted -File c:\Scripts\transfinish.ps "%N"
然后可以使用$args变量访问传递给脚本的参数
例如:
$TorrentName = $args[0]
你正在运行什么程序来下载你的torrents?不。它给出了某种错误,然后终止了命令行。第5行应该是:$parameters.Addmessage,你的torrent$$arg[0]已经完成下载。我的错误是,$args[0]不是$arg[0],我已经更新了答案