none
Media Deployment - Using TSEnv Variables RRS feed

  • Question

  • Hi Guys

    I'm having a few problems with a USB Media deployment with a specific application that I roll out via a Powershell script. I decided to do it with a powershell script as we use different scalability servers depending on the site the PC is used at, so I scripted a check based no name to write in the correct scalability server.

    The deployment works fine from the server as I have 'hard-coded' the deployment share path for the application installer into the script (now I understand the TSEnv part a bit better, I think I can use %DEPLOYROOT% instead), but obviously when deploying from media I don't have a pre-defined share (Z:) to point at and the USB drive letter could be different. I found a great post on Scriptimus Ex Machina advising how to pause a sequence and access TSEnv variables, but it doesn't seem applicable to media deployments as I do not have c:\MININT\Modules folder on the PC I'm deploying, so I cannot import ztiutility.

    If I import it from the location on the USB key, it works and I can see TSEnv and all the variables, but why doesn't a media deployment copy this across to the C: drive?

    Any suggestions on how to get this working would be appreciated.

    Maybe I should copy the install files to the C: drive and install from there?

    Wednesday, February 26, 2014 9:30 AM

Answers

  • I don't understand what the problem is here. When programming a Powershell script for use within MDT, you would simply perform a Import-Module ZTIUtility.psm1 in your script. The Powershell host should already have the Library path added to the environment, so I don't understand why you would be worried about where Z: points and where the \modules folder is.

    Keith Garner - keithga.wordpress.com

    • Marked as answer by coachphil71 Thursday, February 27, 2014 9:41 AM
    Wednesday, February 26, 2014 11:39 PM
    Moderator

All replies

  • I don't understand what the problem is here. When programming a Powershell script for use within MDT, you would simply perform a Import-Module ZTIUtility.psm1 in your script. The Powershell host should already have the Library path added to the environment, so I don't understand why you would be worried about where Z: points and where the \modules folder is.

    Keith Garner - keithga.wordpress.com

    • Marked as answer by coachphil71 Thursday, February 27, 2014 9:41 AM
    Wednesday, February 26, 2014 11:39 PM
    Moderator
  • Thanks Keith

    I've marked as answered as I've got it working now - it was down to my own stupidity and a week off on holiday!

    Turns out I was pointing at the wrong installation files as I had moved them.

    I was using a different method to pause the task sequence, so once I worked out I needed to run a Powershell Task to access the modules correctly on the pause all was good.

    Thursday, February 27, 2014 9:45 AM