set-content

Tagged: 

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Tony Antony Tony Antony 3 months, 1 week ago.

  • Author
    Posts
  • #60333
    Profile photo of Tony Antony
    Tony Antony
    Participant

    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
    Profile photo of Tony Antony
    Tony Antony
    Participant

    Please close this post, double post.

    Thank you,

    Tony

You must be logged in to reply to this topic.