Cannot update prebuild steps in target.cs, a rebuild triggers 2800 actions and takes hours

Hi,

I am using VS2022 and UE5.2 to build my project on Windows.
I created a custom prebuild step by

PreBuildSteps.Add("$(ProjectDir)\\Automation\\PrebuildStep.bat");

in target.cs

however, when I tried to update it to

PreBuildSteps.Add("$(ProjectDir)\\Automation\\PrebuildStep.bat Param1");

My batch script could not read that parameter from the command line.
I had a look at the intermediate prebuild batch file (PreBuild-1.bat) generated by UBT, it is not updated, it is still “…\Automation\PrebuildStep.bat” without Param1

Then I tried to rebuild my project (not engine) in Visual Studio, the prebuild step is updated, but it compiled more than 2800 files and took more than an hour.

Both of these behaviours are not in my expectation. I wonder if there is a simpler way to update the prebuild step or rebuild the project code only instead of 2800 files.

Regards