I’m going thru and piping multiple addresses into the parameters and it simply does not save the output to a text file. This is what i’ve tried thus far using Out-File command below. The console screen output in ISE is perfect, but for some reason nothing gets saved to text file via Out-File cmdlet. Please help. Thanks a bunch
Hi Matt, I forgot to add in my question that I already tried “-Append” and it still does not output anything to the text file (empty, 0kb file). I even tried just one user query (code below) and it too did not output to file which perplexes me quite a bit. Thank you
Thank you for your input. I tried using your $result variable and that too unfortunately did not work, nothing was output to the text file. I executed the $result variable and also saw that it too did not contain any data stored within it. I’m quite puzzled by this.
Yup Olaf, “just some output” does work successfully (i output lots of stuff to C:\temp). If you open up the script, and you see that it has “Out-String” after the Get-ADobject cmdlet on lines 174 and 182. Not sure if that is causing the issue for it not to be able to save to file. I also tried " | tee -filepath “c:\temp\UPNduplicates.txt” " and that did not work either. Thanks
I did a little debugging on the Find-DuplicateValues.ps1 script and was able to reproduce the same results you had where the 0kb file was generated but not populated. I believe it has something to do with the FormatColor function being called after Out-String. I commented out everything after Out-String on 174, 182, 209, and 213. After doing that the text file populated with output.