Reputation: 637
I'm executing a powershell script from cmd window. Within the powershell script I want to set a variable that later can be reached from cmd window, once the ps script has finsihed. How do I do that?
I have tried:
PS promt: Set-Variable -Name "MyParameter" -Value "MyParameter1234" -Scope Global -Visibility Public
CMD promt: set MyParameter
Please help me figure this out.
Upvotes: 1
Views: 301
Reputation: 819
Easiest way would be to write the variable to a file, close the Powershell window, read the file in the cmd window and put it in to a variable and then delete the file.
Upvotes: 1