SynopsisGive focus to the specified window that is open on the desktop of the local computer.
- Set-WindowFocus [-Window]
DescriptionThe Set-WindowFocus cmdlet is used to give focus to an application window that is open on the desktop of the local computer.
Set-WindowFocus requires that you use the Get-Window cmdlet to identify the target application window. The target window will then be brought to the front and activated on the user's desktop.
- Window The target application window. AppWindow objects are generated using the Get-Window cmdlet.
InputsSet-WindowFocus must be used in conjunction with the Get-Window cmdlet and accepts the output of Get-Window as an input object.
OutputsSet-WindowFocus does not output any PowerShell objects.
NotesThere are no notes associated with the Set-WindowFocus cmdlet.
Example 1Set-Window focus must be used in conjunction with the Get-Window cmdlet.
This command will set Internet Explorer to the front of all other windows:
C:\PS>Get-Window iexplore | Set-WindowFocus