Is there a way to know to which computer an output text belongs when executing an Invoke-Command on a list of computers?
If I run something like this:
Invoke-Command -ComputerName Computer1,Computer2 -ScriptBlock { Remove-Item C:\Backup -Verbose }
I'll get output that looks something like this:
VERBOSE: Performing operation "Remove Directory" on Target "C:\Backup". VERBOSE: Performing operation "Remove Directory" on Target "C:\Backup".
But I would like to get something like this:
Computer1: VERBOSE: Performing operation "Remove Directory" on Target "C:\Backup". Computer2: VERBOSE: Performing operation "Remove Directory" on Target "C:\Backup".
Paulo Morgado