Question: I have one big batch script which sets bunch of environment variables. 
I want to call that batch script from powershell, that way I can get benefits of both i.e. enviorment variable set by my script and powershell.

Answer: 
@Roman Kuzmin's solution works great, but piping the command output to nul can kind of leave you in the dark. So I made a few tweaks to allow for the command output to display normally, and instead pipe the env vars to a temp file to read in afterwards:

```bsh
param
(
    [Parameter(Mandatory=$true)] [string]
    $Command
)
$VarsPath = [IO.Path]::GetTempFileName()
cmd /c "$Command && set > $VarsPath"
if (-not $LASTEXITCODE) {
    Get-Content $VarsPath | ForEach-Object {
        if ($_ -match '^([^=]+)=(.*)') {
            [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
        }
    }
}
Remove-Item $VarsPath

```
You can run a batch script from Powershell just by putting its name, but that won't help you. Environment variables set in the batch script will only be visible from *that batch and anything that batch runs*. Once the control returns back to Powershell the environment variables are gone. You could have the batch script run `set` at the end and then parse its output into your PSH environment variables, though.