I have a share containing a text file per machine with the name of the last logged on user. I wanted to add that information to my search. The get-content works fine when running alone. It is only returning a single string as checked with trim and length. What am I doing wrong?
What exactly does that mean? Do you get an error? Do you get nothing at all? Did you try to output the path you’re building just to check if it is what you expect. Do these paths really exist? “… will not run …” is pretty unprofessional.
Sorry for the short answer I agree it was not very informative. If I run the get-content command on its own I get the results supplementing the computername for a chosen device that would of appeared in the results. However when I run it combined the user field is blank. I have tried running trim and length commands and the string returned by the single command should be easily displayed.