What is the best practice to set system varibles?

Hello, I am a newbie to PowerShell. I have few questions related to setting system variables and installing software.

Usecase: Create and update few system variables as a prerequisite for software installation and then install software. ( Note : I am not updating Path variable)

I am using Start-Process to set the system variables:

 Start-Process -WindowStyle hidden powershell -Verb runAs -ArgumentList " 
 [System.Environment]::SetEnvironmentVariable('TEMP','C:\Temp','Machine')"

Is there a way to reload the TEMP system variables before installing the software?

What is the best practice to set system and user variables and then install the software in the same shell?

Thanks