1
Vote

Unable to pipe variable of TSProcess

description

This code work
$computer = 'TSE1.domain.adds'
Get-TSSession -computerName $computer -ID $($Sess.ID) | Get-TSProcess | Stop-TSProcess
but if I need an action after list process and before Stop-Process :
$Process = Get-TSSession -computerName $computer -ID $($Sess.ID) | Get-TSProcess
# many Actions...
$Process | Stop-TSProcess
the last line don't work, insteal i use
$Process | %{
     Get-TSProcess -computerName $_.Server -ID $_.ProcessId | Stop-TSProcess -force
}

comments