“PowerShell Agregar línea al comienzo del archivo” Código de respuesta

Agregue una nueva línea al final de este archivo en PowerShell

Add-Content "C:\dotnet-helpers\DummyfiletoDelete.txt" "This is the last line"
Blue Buzzard

PowerShell Agregar línea al comienzo del archivo

# 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
Andreas Kuglgruber

Respuestas similares a “PowerShell Agregar línea al comienzo del archivo”

Preguntas similares a “PowerShell Agregar línea al comienzo del archivo”

Más respuestas relacionadas con “PowerShell Agregar línea al comienzo del archivo” en Shell/Bash

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código