This can be done with Dot Sourcing .
Create a .ps1 file, declare your variables in it, then specify the source of the source. This will transfer any variables declared in the file to the global scope.
Example:
Contents of Variables.ps1:
$foo = "blarg" $bar = "other blarg"
Point Source:
. ./Variables.ps1 Write-Host "$foo $bar"
dugas source share