Powershell - Remove Last 3 Lines

Embed Size (px)

Citation preview

  • 8/16/2019 Powershell - Remove Last 3 Lines

    1/25

    $path = "D:\MSSQLExport\temp\Output\accessrights.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\adddeleteresource.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\affinitybudget.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\affinityexpense.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\affinityfocusarea.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\affinitygroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\affinitysecurity.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\al_ms_resources.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\allassociates.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\amgroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    2/25

    $path = "D:\MSSQLExport\temp\Output\amotemp.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\amrole.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\applicationresource.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\applicationrole.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\applications.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\applicationserver.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\applicationskill.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\applicationsla.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\applicationssdmlist.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\appwave.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    3/25

    $path = "D:\MSSQLExport\temp\Output\ar2.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\ar_bk.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\assoccertifications.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\associatedeploymentinfo.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\associatestatement.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\associatestatementtypedates.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\associatestatementvacpershoursaccruals.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\associateteam.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\assocskills.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\auditcontractemployee.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    4/25

    $path = "D:\MSSQLExport\temp\Output\awards.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\awardsdata.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\awardsecurity.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\businessunit.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\calendar.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\category.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\categorymaster.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\cgorg.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\changeresource.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\checklist.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    5/25

    $path = "D:\MSSQLExport\temp\Output\classification.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\clienthridtemp.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\clientlocation.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\company.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\companycert.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\confidencelevel.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\contractsupport.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\counselor.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\counselorcounselee.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\coursedetail.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    6/25

    $path = "D:\MSSQLExport\temp\Output\courseregistration.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\courseschedule.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\coursesurveydata.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\datapointcodemap.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\datapointfactorssdmwise.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\datapointgroups.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\datapointhours.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\datapointhoursfinal.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\datapointhourssummary.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\dtpthrs.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    7/25

    $path = "D:\MSSQLExport\temp\Output\dtpthrsall.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\empproj.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\events.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\eventtype.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\exceptions.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\focusareagroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\followupprjkpi.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\holiday.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\hpappbundle.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\hpapplicationsla.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    8/25

    $path = "D:\MSSQLExport\temp\Output\hpdomain.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\hpspoc.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\hpwave.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\legent.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\legentbkup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\loc.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\masteroperation.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\modifyhomepage.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\neworgmapp_matching_ciid.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\neworgmapp_not_matching_ciid.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    9/25

    $path = "D:\MSSQLExport\temp\Output\neworgmappmissing.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaecategory.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaedatapointmaster.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaeinsert.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaematrixdatadump.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaematrixticket.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaemonths.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaeoffshoreoverheads.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaescorecardmonths.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaescorecardyears.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    10/25

    $path = "D:\MSSQLExport\temp\Output\oaesdmtoresource.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaetimedatadump.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\oaetimedatadumpticket.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\offshoreohhours.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\offshoresdm.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\ohsares.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardactivity.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardactivitygroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardautochecklist.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardchecklist.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    11/25

    $path = "D:\MSSQLExport\temp\Output\onboardchecklistentry.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardingreqgroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardingreqrsc.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardingreqstatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardingreqtype.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardingrequest.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboardstatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\onboradchecklistentry.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\operation.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\operationphase.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    12/25

    $path = "D:\MSSQLExport\temp\Output\overheadshare.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\pageaccesslistrolebased.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\pageaccesslistuserbased.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\pageaccessname.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\phase.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\phasestatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\primaryskillset.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\priority.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\project.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectapplication.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    13/25

    $path = "D:\MSSQLExport\temp\Output\projectapplication_amo.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectarchive.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectaudit.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectaudittype.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectbkup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectcategory.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectclassification.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectcr.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectcrtype.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectgate.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    14/25

    $path = "D:\MSSQLExport\temp\Output\projectgatemst.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectgatestatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projecthealth.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectinvoice.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectparameters.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectrequeststatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectrequesttype.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectresource.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectresourcebkup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectresourcerole.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    15/25

    $path = "D:\MSSQLExport\temp\Output\projectrole.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectrolemst.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectsla.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectslabkup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectslamst.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectslaold.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectsowtype.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectstatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projectstatustab.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\projecttype.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    16/25

    $path = "D:\MSSQLExport\temp\Output\recondata.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\reconmatch.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\reptype.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\request.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\requestapplication.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\requestassignment.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\requestbackup_issue.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\requeststatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\requesttimeentry.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resamodata.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    17/25

    $path = "D:\MSSQLExport\temp\Output\resource.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resource2.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resourceaccessright.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resourceimage.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resourceleaveinfo.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resources_autoapprovedid.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resourcestatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resourceutilisation.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resutilreport.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\resutilreportmembers.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    18/25

    $path = "D:\MSSQLExport\temp\Output\rolemap.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\salesteam.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\sdmprodshare.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\sheet1$.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\skilllevel.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\skillsdetail.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\skillsgroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\snakecategory.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\snakedataloaded.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\snakedataloadednew.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    19/25

    $path = "D:\MSSQLExport\temp\Output\snakelocations.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\snakelog.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\snakeregions.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\snakeresourcelevel.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\snaketest.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\stafflevel.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\standardevents.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\success_register.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\supportgroupmaster.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\t_ticket_detail.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    20/25

    $path = "D:\MSSQLExport\temp\Output\tasks_activities.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbdatapointhoursall.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbl_aetweekly.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbl_fiscal.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbl_km_errorlog.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbl_km_solution.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbl_km_solutionrejectlog.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbl_km_solutionstatus.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbl_km_solutionticket.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tblcheckoae.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    21/25

    $path = "D:\MSSQLExport\temp\Output\tblfinaldistribution.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tblforecast.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tbloverheadshares.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tblstatusposition.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tblstatusstaffing.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\teaminitiative.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\temghan.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\temp1.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\temp2.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\temp3.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    22/25

    $path = "D:\MSSQLExport\temp\Output\tempallassociates.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tempdeb.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tempocreskpi.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\temponboardactivity.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\temponboardactivitygroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tempprojkpi.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tempskillsdetail.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tempskillsgroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\temptable.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tickettimeentry.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    23/25

    $path = "D:\MSSQLExport\temp\Output\tickettracker.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tickettrackerlog.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\timeentrysummaryconfiguration.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\timeentrysummaryconfigurationnew.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\timeentrysummarypool.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\timeentrysummarypoolnew.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\timesheet.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\timesheetbkup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\timesheetdata.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\timesheetdata_tmp.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    24/25

    $path = "D:\MSSQLExport\temp\Output\timesheettrack.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tmp_resource_utilization.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tmp_resource_utilization_ms.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tooladmin.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\toolcategorymapping.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\toolrequest.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\toolrequestcomment.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\toolrequestparams.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\training_details.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\training_tracker.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

  • 8/16/2019 Powershell - Remove Last 3 Lines

    25/25

    $path = "D:\MSSQLExport\temp\Output\tt_com_update_temp.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\tt_temp.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\ttimeentrysummaryconfigurationnew.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\updatedprj.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\users.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\websiteissues.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\wipstages.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\workgroup.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\workgroupperson.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))

    $path = "D:\MSSQLExport\temp\Output\worklocation.csv"

    $file = Get-Content $path -ReadCount 0Set-Content $path -Value ($file | Select-Object -First ($file.count-3))