Many applications have associated help that you invoke by pressing F1.
What PowerShell command would launch the application AND open the help?
Applications I have in mind are Powershell ISE, Visual Studio, Microsoft Office, etc.
Is there a standard mechanism for this?
Thanks.
There's no one command to do it but you can do it by:
Here's how:
Launch an application:
Start-Process -FilePath C:\The\Path\To\Program.exe
Wait for it:
$WindowTitle = "The App You're Waiting For"
while ($true) {
Start-Sleep -Seconds 1
$p = get-process | ? {$_.MainWindowTitle -match $WindowTitle}
if ($p) {break}
}
Activate the window:
[void] [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic")
[Microsoft.VisualBasic.Interaction]::AppActivate($WindowTitle)
Send the F1 key:
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("{F1}")