I have a command that I am running in CMD which is returning an object. I want to store the output of that command in a variable so that I can access that variable in further commands.
I tried the for loop method which did not seem to work for a command returning an object and also the set var-value which considered the command as the string I wanted to store in the object. The for loop only stored the last braces of the command output in the variable and not the entire object
Ishpreet Kaur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.