set-content

Welcome Forums General PowerShell Q&A set-content

This topic contains 1 reply, has 1 voice, and was last updated by

 
Participant
1 year, 11 months ago.

  • Author
    Posts
  • #60333

    Participant
    Points: 53
    Rank: Member

    This seems like it should be simple, but I'm stuck on this.

    I have a text file with 8 email addresses.
    It does add the new email address to the text file in the correct place. So, now the count should be 9, but when I do a write-host to see the number, it' telling me 8 when it's really 9. When I open the text file, I can see it added the new email.

    $New_User = Read-Host "Enter new employee's email address"
    $Read_INI[$Calender_Groups] += "`r`n$New_User"
    $Read_INI | Set-Content $INI_Location -Force     
    Write-Host $Read_INI[$Users..$Calender_Groups].Count -ForegroundColor Green 

    Thank you,

    Tony

  • #60337

    Participant
    Points: 53
    Rank: Member

    Please close this post, double post.

    Thank you,

    Tony

The topic ‘set-content’ is closed to new replies.