I have this script that changes services per a csv file input

```
Import-CSV .\SSAS_services.csv |
    ForEach-Object{
        Get-Service $_.Service -ComputerName $_.Server -PipelineVariable svc|
            Set-Service -Status $_.Task -StartupType $_.'Startup Type' -PassThru
    } |
    Select-Object MachineName, Name, Status, StartType, @{n='OldStatus';e={$svc.Status}}, @{n='OldStartType';e={$svc.StartType}} | 
    tee-object -FilePath '.\ChangeServices_LOG.txt' #-Append

```

```none
Server,Service,Startup Type,Task
DCVPIM108,SQL Server Analysis Services (MSSQLSERVER),automatic,start
server2,"SQL Server Analysis Services (MSSQLSERVER), SQL Server Analysis Services (MSSQLSERVER) CEIP",Manual,stop

```

it works great, except for my `-PipelineVariable svc`is not working as intended. if a service was "stopped" and "Manual" before being changed to "running" and "automatic", it doesnt get the old values "stopped" and "Manual" for `OldStatus` and `OldStartType`

```none
MachineName  : DCVPIM108
Name         : MSSQLServerOLAPService
Status       : Running
StartType    : Automatic
OldStatus    : Running
OldStartType : Automatic

```

why is that?