When you use the command prompt to execute the setx command, the %path% variable is interpreted by the command prompt (cmd.exe) not by setx.exe.
In the PowerShell command, you are executing setx.exe and passing it a %path% variable it does not understand.
To get the same results, you would need to execute cmd.exe instead of setx.exe.
I would suggest a PowerShell method for changing the path environment variable:
[Environment]::SetEnvironmentVariable(‘Path’, $env:Path + “;C:\test2222”, [EnvironmentVariableTarget]::Machine)