Is it possible to set multiple environment variables in one CMD line statement?

Question:

I have a PowerShell script set to execute after an MSBuild is finished. It uses environment variables set in the POSTBUILD section of the build process (build directories and the like.) Currently it looks like this:

With each set operating on a separate line, but still within the same CMD instance.

Is there a way I can set multiple variables at once using just one line instead of 7?

Answer:

Yes, you can pipe the commands together:

Source:

Is it possible to set multiple environment variables in one CMD line statement? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply