Use the
Formatter (Java Platform SE 7 )[
^] to build a string with parameters.
Example:
String command = String.format("powershell.exe $Add-DnsServerResourceRecordA -ZoneName %1$s -Name %2$s -IPv4Address %3$s -TimeToLive %4$s", parts[0], parts[1], parts[2], parts[3]);
Note that the above may be not what you want because you did not specify what the input is and if it matches the parameters expected by the
Add-DnsServerResourceRecordA
cmdlet.