Quantcast
Channel: Configuration Manager 2012 - Operating System Deployment forum
Viewing all articles
Browse latest Browse all 9126

SSD Detection Script will not working

$
0
0

Hello,

 i wrote a script to detect SSD's. When run de script  on lokal Client it works fine.

In  taskseq  it will not working  with error "+ $diskspeed = $test[5].Trim <<<< ("")"  and i think  the Process from WINSAT is not starting.

I have start the script from commandline "powershell.exe  -command "%scriptroot%\custom\ssdtest.ps1"" or from MDT2012SP1 run Powershellscript with same Error.

Why  run not winsat  ??

Please Help

thanks henrik.b

Function ssdtest
{

$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = "C:\Windows\system32\winsat.exe"
$pinfo.Arguments = "disk -seq -read"
$pinfo.RedirectStandardOutput = $true
$pinfo.RedirectStandardError = $true
$pinfo.UseShellExecute = $false



$p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo
$p.Start() | out-null
$p.WaitForExit()

$output = $p.StandardOutput.ReadToEnd()
$test = $output.Split(">") 


$diskspeed = $test[5].Trim("")
$Tempspeed = $diskspeed.Substring(($diskspeed.Length -3 ))


if ($Tempspeed -cge "6.9")
{
$ISSSDDISK = "TRUE";

}
else
{
$ISSSDDISK = "False";

}

$ISSSDDISK

$ssddisk = New-Object -COMObject Microsoft.SMS.TSEnvironment 
$ssddisk.Value("SSDDISK") = $ISSSDDISK

}

ssdtest


Viewing all articles
Browse latest Browse all 9126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>