Hi there,
I have a text file (temp.txt) that gets populated as a result of running a specific query.
$x and $y are dynamically assigned values based on some calculations
then i check
if( $numlinesinfile -ne ($x+$y))
{ Write-Host -ForegroundColor Magenta "Error..."
//I want to delete lines from 2 to end of file and just retaining the header}
else
{Write-Host "Finished.."-ForegroundColor DarkBlue}
Is this possible?
Thanks
Rashm