If Amazon used this Bezos wouldn't have banned PowerPoint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bezos-loves-slides/scripts/focus_control.ps1

17 lines
444 B

Add-Type @"
using System;
using System.Runtime.InteropServices;
public class User32 {
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetForegroundWindow(IntPtr hWnd);
}
"@
$process = Get-Process | Where-Object { $_.MainWindowTitle -like "*Bezos Loves Slides*" }
Write-Host $process.MainWindowTitle
if ($process) {
[User32]::SetForegroundWindow($process.MainWindowHandle)
}