Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

powershell add line to beginning of file

# 1st create file with lines to be placed on top and then
Add-Content -Path "<path_of_file_with_top_lines_temp>" -Value (Get-Content "<path_of_original_file")
# content is in temp file
Move-Item -Path "<path_of_file_with_top_lines_temp>" -Destination "<path_of_original_file" -Force
Source by dotnet-helpers.com #
 
PREVIOUS NEXT
Tagged: #powershell #add #line #beginning #file
ADD COMMENT
Topic
Name
4+4 =