Powershell variables use in another script RRS feed

  • Question

  • I have a script that runs from anyone's desktop that creates variables from input and subsequently prepares SCCM for a new a OS build. So the script finishes and SCCM Task Sequence kicks off and during this, towards end, another script runs to use these variables in the original script. Now I thought whether to output these variables to a share and then get SCCM script to read but even doing this is difficult as SCCM isn't going to know what file to read.

    Can anyone think of a better way of doing this?

    Saturday, July 28, 2018 6:49 PM


All replies

  • Yes.  I can think of a number of ways to do this.

    1.  Use one script instead of two.
    2.  As in SCCM forum to find out how to use variables in SCCM.
    3.  Use the registry
    4.  Use PowerShell's built in telepathic and time travel functions.


    • Proposed as answer by Jesper Arnecke Saturday, July 28, 2018 7:35 PM
    Saturday, July 28, 2018 7:01 PM
  • The OS isn't built yet so last script cant run till this is complete. First script simply starts the OS build of. I suppose first script could somehow wait for completion by doing checks in background?
    Saturday, July 28, 2018 7:21 PM
  • Post in SCCM forum to learn how to stage this with steps.  SCCM can orchestrate most of this.


    Saturday, July 28, 2018 7:31 PM