![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Retaining variables after script execution Hi all, While sitting at a powershell command prompt, is there a way to execute a script and retain all the variables the script used after execution is complete? Thanks. -- Tim. |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Retaining variables after script execution Tim, You can make variables global in scope during script execution. So if you have the following line in your script: $GLOBAL:someVar = "Hello" Even if that variable doesn't exist before you run the script, it will after. --George "Tim Munro" wrote: Quote: > Hi all, > > While sitting at a powershell command prompt, is there a way to > execute a script and retain all the variables the script used after > execution is complete? > > Thanks. > -- > Tim. > > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Retaining variables after script execution George, thatnks for your input. I'm looking for something that will let me see the final state of things after a scruipt runs. To scope everything as Global for debugging and then having to remove it all when all is working just doesn't seem like the right way to do things. -- Tim "George Davis" <GeorgeDavis@xxxxxx> wrote in message news:40511FD2-38B1-444B-9127-35D1CA231CF3@xxxxxx Quote: > Tim, > You can make variables global in scope during script execution. So if you > have the following line in your script: > > $GLOBAL:someVar = "Hello" > > Even if that variable doesn't exist before you run the script, it will > after. > > --George > > > "Tim Munro" wrote: > Quote: >> Hi all, >> >> While sitting at a powershell command prompt, is there a way to >> execute a script and retain all the variables the script used after >> execution is complete? >> >> Thanks. >> -- >> Tim. >> >> >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| paaing variables from script to plink cmd | VB Script | |||
| Include another script, keep variables in included script? | PowerShell | |||
| Need help with PHP Script variables | Network & Sharing | |||
| Pop-up to enter variables to pass to script | PowerShell | |||
| Passing variables to script | PowerShell | |||