Tee-Object can't save output command comments to file
<p>I have this code in <a href="/questions/tagged/powershell" class="post-tag" title="show questions tagged &#39;powershell&#39;" rel="tag">powershell</a> and <code>Tee-Object</code> can't save all <code>Write-Host</code> command to file.txt. What I can do to repair this code?</p>

<pre><code>Import-Module ActiveDirectory
Add-Type -AssemblyName System.Web 
$users = Get-Content -Path 'G:\Shares\xx xxx\ResetPassword\UserList.txt'
ForEach ($user in $users) 
{
$unsecuredpwd = [System.Web.Security.Membership]::GeneratePassword(10, 3)
$password = ConvertTo-SecureString -AsPlainText $unsecuredpwd -Force
Get-ADUser $user | Set-ADAccountPassword -NewPassword $password -Reset
Get-ADUser $user | Set-AdUser -ChangePasswordAtLogon $true
Enable-ADAccount -Identity $user
Write-Host “uzytkownik: $user”
Write-Host “haslo: $unsecuredpwd”
Write-Host “ `r`n`r`n”
} | Tee-Object -FilePath G:\Shares\xx xxx\ResetPassword\Output.txt
Read-Host -Prompt "click enter to exit"
</code></pre>