However, the result of the command shows all the services with the same name and display name (this is copy-pasted directly from the transcript file) :
I just don’t understand why. If I execute the Get-Service command in a PowerShell prompt directly on the machine, I get the expected result (i.e. services names and display names are different).
I am at a loss, and so are ChatGPT and Copilot. And I cannot find anything about that exact issue through Google searches.
Just to confirm, the transcript file is the output you copied where the name and displayname are the same?
If so, I’m not able to reproduce. I used basically the same code you shared and the transcript file looks normal
Status Name DisplayName
------ ---- -----------
Running AdobeARMservice Adobe Acrobat Update Service
Running AdobeUpdateService AdobeUpdateService
can you confirm where you are seeing that? I ran the code ad-hoc not as a login script but I’d think it’d be no different. Is this all the code? you’re not manipulating it and outputting it in another fashion? This isn’t a seperate log file where someone is doing custom output?
I have edited my post to answer your questions, but in short yes I have provided the full, unaltered source-code of the script and the service table is copy-pasted directly from the transcript file (except the […] part at the end, which I have added).