BizRobo!(DA) ファイルリストを取得する」で紹介した、PowerShellスクリプト「BizSprt4DA.ps1」の拡張案の一つです。「アクティブウィンドウ切替」のためのfunctionと、分岐処理を追加したスクリプトメインを載せておきます。
Biz→PS
【PowerShellスクリプト例】
$OutputEncoding = [System.Text.Encoding]::Default

#このスクリプトファイルを保存しているフォルダパスを取得する。
$parentPath = Split-Path $MyInvocation.MyCommand.path -Parent
#結果ファイルのパスを設定する。
$resultPath = Join-Path $parentPath "PS結果.json"

#処理結果の固定値定義
$RESULT_SUCCESS = "成功"
$RESULT_FAILURE = "失敗"
#結果詳細の固定値定義
$EXIST = "有"
$NOT_EXIST = "無"

#---------------------------------------------------
#アクティブウィンドウ切替
#【引数】
#$windowTitle:ウィンドウタイトル(前方一致で処理する)
#---------------------------------------------------
function activateWindow($windowTitle){
    add-type -assembly microsoft.visualbasic
    #結果格納ファイルを削除する。
    if(Test-Path $resultPath){
        Remove-Item $resultPath
    }
    try{
        [microsoft.visualbasic.interaction]::AppActivate($windowTitle)
        #処理結果を「成功」に設定する。
        $result = $RESULT_SUCCESS
        $detail = $null
        $errormsg = $null
    }catch{
        #処理結果を「失敗」に設定する。
        $result = $RESULT_FAILURE
        $detail = $null
        $errormsg = $_.Exception.Message
    }
    #json形式で結果を出力する。
    $json = @{
      result = $result;
      detail = $detail;
      error = $errormsg
    }
    $json | ConvertTo-Json | Out-File $resultPath
}

#============================================================
#スクリプトメイン
#============================================================
switch ($args[0]){
    "ファイルリスト取得"
    {
        $dirPath = $args[1]
        getFileList $dirPath 
    }
    "アクティブウィンドウ切替"
    {
        $windowTitle = $args[1]
        activateWindow($windowTitle)
    }
}
【追記 2021/5/15】
BizRobo!のDesktop Automationには、アクティブウィンドウを切り替える手段が用意されていました。Pressステップで「Ctrl+Alt+Tab」すると、「タスクの切り替え」ウィンドウがレコーディングビューに現れるので、「タスクの切り替え」ウィンドウでアクティブにしたいウィンドウをクリックすることで実装できることが分かりました。この方法を使えば、わざわざスクリプトを使う必要はありませんね~。