Creating Task Sequence Variable

I have a powershell script that is "Working" but not working.  I am using a 64 bit Boot Image and my script is running but I keep getting this error in SMSTS.LOG.

My script works fine if I tell it to write host instead of create variable... What am I missing... Here is my code below.

$GetHardDriveType = Get-PhysicalDisk | Select-Object -ExpandProperty DeviceId | .\ssd_check.ps1
If ($GetHardDriveType -eq "TRUE"){
 $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
 $tsevn.Value("isSSD") = "TRUE"
}
Else
{
 $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
 $tsevn.Value("isSSD") = "FALSE"
}

May 28th, 2015 8:38am

There is a typo in your value lines. You wrote

$tsevn.Value("isSSD") = "TRUE"

while it should be

$tsenv.Value("isSSD") = "TRUE"

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 8:48am

Is it?

I take is isSSD is a variable from ssd_check.ps1 script?

$tsevn.Value($isSSD) = "TRUE"

May 28th, 2015 8:51am

Is it?

I take is isSSD is a variable from ssd_check.ps1 script?

$tsevn.Value($isSSD) = "TRUE"		
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 8:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics