I need to find in a file specific line and add some data at the end of the line, something like this:
function AddSomeData($file, $key, $value)
{
$content = Get-Content $file
if ($content -match "I work very")
{
$content- add at the end $value
Set-Content $file
}
}
AddSomeData "settings.conf" "I work very" " hard"
As a result - file with changed line: I work very hard. How to do that ?