[Solved] how to create ps1 file which takes input as json and based on parameters exceute batch file? [closed]


This is a Batch-file solution (posted here because this question have the batch-file tag) that IMO is simpler than any ps1 solution, but I am sure it run faster than the ps1 solution.

@echo off
setlocal EnableDelayedExpansion

set "Version="
for /F "tokens=1,2 delims=:, " %%a in ('findstr ":" input.txt') do (
   set "%%a=%%~b"
   if defined Version (
      ECHO !Name! !Create! !Version!
      set "Version="
   )
)

After check that the displayed commands are correct, you must remove the ECHO part in order to execute the Batch files. Output example:

test1.bat Yes 2
test2.bat Yes 3

solved how to create ps1 file which takes input as json and based on parameters exceute batch file? [closed]