From the course: PowerShell 5 Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Scaling out with one-to-many operations

Scaling out with one-to-many operations - PowerShell Tutorial

From the course: PowerShell 5 Essential Training

Start my 1-month free trial

Scaling out with one-to-many operations

- When I wanna manage multiple servers or computers at once, I'm gonna use a special remoting command called invoke command. Now, again, using something like this with -ComputerName, this uses the old decom protocol, slow and one at a time kind of stuff. I want to use PowerShell remoting. We have a special command for that. Invoke-Command. Now, Invoke-Command will take a computer name, and you put in the computers that you'd like to manage. s3, s4. The parameter is called - ScriptBlock, even though you don't see people use the parameter. You've got two squigglies. Whatever you put inside those squigglies is what we're gonna execute on those machines. Now, I'm gonna get rid of ScriptBlock, because that's not normally how you see it. Now, I need you to think about this. Everything that you've done so far with PowerShell, you've been building one-liners, you've been learning how to select and filter and do different things by using commandlets. That's what goes in those squigglies that…

Contents