function prompt { "Posh >" ; return " " }
#copy locally all unique file names
Get-ChildItem -Path \\server\ARC\Exp\AM\ -Recurse -Filter "*.txt" | ForEach-Object {"Copy " + $_.FullName + " ""\\Dest\temp\ExperiantRegistration\" + $_.Name + " " + $_.LastWriteTime + ".txt""" -replace ":", "" -replace "/", "" >> copyLocal.bat}
#Make the script file to Get just the top few lines
Get-ChildItem -Path C:\temp\ExperiantRegistration\ -Filter "*.txt" | ForEach-Object {"Get-Content " + """" + $_.FullName + """ -totalcount 3" > getHeaders.ps1}
No comments:
Post a Comment