1
Vote

Hello Scriptimus, When I try to run the 'Build' script, here us what I get:

description

PS C:\Program Files\CompletePgms\HydrationPgm2012\Build>

======================================================================================
Method invocation failed because [System.Char] does not contain a method named 'Substring'.
At C:\Program Files\CompletePgms\HydrationPgm2012\Build\Modules\TestLab.psm1:141 char:9
  • $MDTDrive = ((Get-MDTPersistentDrive | Sort name).name[-1]).Substring(2) ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : MethodNotFound
    Directory: C:\TestLab_BaseConfigMedia\Content
Mode LastWriteTime Length Name

d---- 6/14/2016 3:59 AM Deploy

ReadOnly : False
IsSaving : False
CurrentLocation :
Name : DS001
Provider : MicrosoftDeploymentToolkit\MDTProvider
Root : C:\TestlabDS
Description :
Credential : System.Management.Automation.PSCredential
DisplayRoot :
Used :
Free :


Name : MEDIA001


ReadOnly : False
IsSaving : False
CurrentLocation :
Name : MEDIA001
Provider : MicrosoftDeploymentToolkit\MDTProvider
Root : C:\TestLab_BaseConfigMedia\Content\Deploy
Description : Embedded media deployment share
Credential : System.Management.Automation.PSCredential
DisplayRoot :
Used :
Free :

I also included a screen shot.

How do I get past this. I am no programmer.

Sean

file attachments

comments

binaryman1 wrote Jun 23, 2016 at 11:55 PM

Hello again Scriptimus,

I saw your update in the discussions:

In Build-Kit.ps1 the following line needs to change to respect passed Media parameter:

Copy-KitScripts -Name $DS -MDTMediaPath C:\TestLab_BaseConfigMedia

to
Copy-KitScripts -Name $DS -MDTMediaPath $MediaPath


I deleted the folder TestLab_BaseConfigMedia and also the folder TestlabDS . I tried two things. I then replaced the TestLab_BaseConfigMedia folder with a new empty one with the same name. I got the same message as above. I then did this again, but also added a new empty TestlabDS folder. Same result again. What do I need to do differently?