Appearance
SourceTree 添加自定义操作
创建 PowerShell 脚本,如:
PowerShellparam($repo, $file1, $file2, $sha) write-Host $repo write-Host $file1 write-Host $file2 write-Host $sha $useless = read-host "press any key to exit."1
2
3
4
5
6
7
8将文件保存到
D:\docs\my\sec-brain\settings\git\test.ps1打开 Sourcetree 的 “编辑自定义操作” 界面


TextC:\Program Files\WindowsApps\Microsoft.PowerShell_7.2.4.0_x64__8wekyb3d8bbwe\pwsh.exe D:\docs\my\sec-brain\settings\git\test.ps1 $REPO $FILE $SHA1
2如果选中了多个文件,则
$FILE会依次传入多个参数