During a planned maintenance window, a systems administrator is writing a PowerShell script that will iterate through a list of Windows Server hosts stored in the $servers variable:
The script must issue the shutdown request to every host and then continue running so it can write a status log while the machines power off. Which parameter should replace to meet this requirement?
Adding -AsJob runs Stop-Computer as a background job. The cmdlet returns immediately, allowing the loop (and the rest of the script) to keep running while each remote server proceeds to shut down. ThrottleLimit only caps simultaneous connections but the command still waits for completion; WhatIf performs a dry-run and never powers off the servers; Confirm interrupts the script for user input, preventing unattended operation.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the -AsJob parameter do in PowerShell?
Open an interactive chat with Bash
What is the purpose of the Stop-Computer cmdlet in PowerShell?
Open an interactive chat with Bash
What would happen if the -WhatIf parameter was used instead of -AsJob?