$prename and $lastname don't get passed to migration.exe - they are empty!
These variable references are not empty; they're - unexpectedly - not expanded (interpolated), as of PowerShell 7.1; that is, external program .\migration unexpectedly receives the following arguments verbatim: -name=$prename and -password=$lastname.
This should be considered a bug - see GitHub issue #14587.
The workaround is to use explicit string interpolation ("..."):
.\migration.exe -name="$prename" -password="$lastname"
Note: On Windows, the partial quoting is not guaranteed to be passed through as-is to the target program; instead, PowerShell performs its own parsing first and then performs ("-based) re-quoting on demand behind the scenes, depending on whether the resulting argument contains whitespace. For instance, if $prename's value is foo,
verbatim -name=foo is passed to migration.exe; if the value is foo bar,
verbatim "-name=foo bar" is passed - which the target program may or may not process properly; if not, you'll have to use --%, the stop-parsing symbol operator - see this answer.