多くのアプリケーションには、F1キーを押して呼び出すヘルプが関連付けられています。
どのPowerShellコマンドでアプリケーションを起動し、ヘルプを開きますか?
私が考えているアプリケーションは、Powershell ISE、Visual Studio、Microsoft Officeなど
です。これに標準的なメカニズムはありますか?
ありがとう。
多くのアプリケーションには、F1キーを押して呼び出すヘルプが関連付けられています。
どのPowerShellコマンドでアプリケーションを起動し、ヘルプを開きますか?
私が考えているアプリケーションは、Powershell ISE、Visual Studio、Microsoft Officeなど
です。これに標準的なメカニズムはありますか?
ありがとう。
それを実行するコマンドは1つではありませんが、次の方法で実行できます。
方法は次のとおりです。
アプリケーションを起動します。
Start-Process -FilePath C:\The\Path\To\Program.exe
それを待つ:
$WindowTitle = "The App You're Waiting For"
while ($true) {
Start-Sleep -Seconds 1
$p = get-process | ? {$_.MainWindowTitle -match $WindowTitle}
if ($p) {break}
}
ウィンドウをアクティブにします。
[void] [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic")
[Microsoft.VisualBasic.Interaction]::AppActivate($WindowTitle)
F1キーを送信します。
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("{F1}")