1

Sorry if this was asked before, but i don't know why the same command acts differently. I executed the following command on the local machine Invoke-Command -ComputerName servername -Credential username@domainname {Get-HotFix | Sort-Object -Descending InstalledOn | Select-Object HotFixID} and got the following output:

HotFixID  PSComputerName RunspaceId                          
--------  -------------- ----------                          
KB3084905 servername    25412368-2543-2541-3258-254687qw25rt
KB3102429 servername    25412368-2543-2541-3258-254687qw25rt
KB3004545 servername    25412368-2543-2541-3258-254687qw25rt
KB4576486 servername    25412368-2543-2541-3258-254687qw25rt
KB4576489 servername    25412368-2543-2541-3258-254687qw25rt

but if i execute the same command Get-HotFix | Sort-Object -Descending InstalledOn | Select-Object HotFixID directly on the server i get

HotFixID 
-------- 
KB3084905
KB3102429
KB3004545
KB4576486
KB4576489

How can i get the same output when using the Invoke-Command?

1 Answer 1

1

Well after posting i solved my question. I just needed to run this command to print the same output Invoke-Command -ComputerName servername -Credential username@domainname {Get-HotFix | Sort-Object -Descending InstalledOn} -HideComputerName | Select-Object HotFixId

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.