# Invoke-Command

*noun*

say it: **“in-VOHK kuh-MAND”** **/ɪnˈvoʊk kəˈmænd/**

A PowerShell command that runs a block of code on one or more other computers at once and brings back their answers, each labeled with the computer it came from.

## What does **Invoke-Command** do?

`Invoke-Command` sends a script block, code in braces, to other computers like a note in an envelope, runs it on all of them at the same time and brings the answers back as objects. Each answer's `PSComputerName` says which computer it came from. The other computers need remoting turned on.

```powershell
Invoke-Command -ComputerName front-desk, back-office, meeting-room -ScriptBlock {
    Get-Service -Name Spooler
}
```

## In a sentence

- “One **Invoke-Command** asked all three office PCs about the print service at the same time.”
- “Each answer from **Invoke-Command** carried a PSComputerName, so the stuck PC stood out.”

Level: Freelancer · [More PowerShell terms at this level](https://www.ask-codey.com/glossary?category=powershell&level=4)

Updated: November 10, 2026

Source: https://www.ask-codey.com/glossary/invoke-command
