hi Guys.
I have read many forums reg. this but I cannot get it right . I have following PS script :
********************************************
$NetworkStatus = $NetworkStatusValue
$nameSrv = 'netadapter'
$service = Get-NetAdapter
If ($service.status -eq "Up") {
$NetworkStatusValue = "true"
}
else {
$NetworkStatusValue = "false"
}
********************************************
Very easy script that will set $networkStatus to either True or false :) .
What I read is that I can invoke powershell from command line using this :
$TSEnv = New-Object -COMObject Microsoft.SMS.TSEnvironment
$TSEnv.Value($ComputerNetworkStatus) = $NetworkStatus
What I am trying to do, is to set either True or False variable for TSvariable called ComputerNetworkStatus.
I checked this post : http://www.potentengineer.com/using-powershell-to-set-osd-task-sequence-variables/ , but all of this are regarding very easy and one-lined codes. I don't know how to put it to command line - doesn't seem to be working. Also splitting this into 2 TS - one with PS.1 call and another with command isn't working either.
Could you please help me with this matter ?
Many many thanks