Author Posts

October 30, 2017 at 1:34 pm

I'm trying to add the word "br" in a text file, but it's not adding.

if ($employees.Title -eq "NULL") {
        (Get-Content $public_html_files\$txt_file_names) | Where-Object {$_ -notmatch "TITLE"}  | Set-Content $public_html_files\$txt_file_names -Force        
        $add_break = Get-Content $public_html_files\$txt_file_names
        $add_break[5] += "br"
}

October 30, 2017 at 2:09 pm

I figured it out, thank you

if ($employees.Title -eq "NULL") {
        (Get-Content $public_html_files\$txt_file_names) | Where-Object {$_ -notmatch "TITLE"} | Set-Content $public_html_files\$txt_file_names -Force        
        $add_break = Get-Content $public_html_files\$txt_file_names
        $add_break[5] += ""
        $add_break | Set-Content $public_html_files\$txt_file_names -Force                
    }