It works, but for some reason I get a diffrent output when I do it remotely as to when I run it locally. Remotely it sees applications it does not see when ran locally and vice versa.
Firstly, when posting code or data in the forum, please can you use the preformatted text </> button. It really helps us with readability, and copying and pasting your code (we don’t have to faff about replacing curly quote marks to get things working). If you can’t see the </> in your toolbar, you will find it under the gear icon.
In the code you’ve posted you’re not connecting to a remote machine, you’re querying the same item properties on your local machine as many times as you have PCs in pcs.txt
If you can see it, use the pencil icon to edit your post. I’m not sure if this option is immediately available to new members as it’s common for spammers to edit their posts so if you can’t see it you may need to spend more time here / post more often before the forum software grants you that right.
You can use Invoke-Command to run commands on remote computers. The latest version of the help is linked below, be sure to read the help for your version of PowerShell if you’re not running 7.4.x.
For more information on remoting in general, see the topic about_Remote.