
PowerShellから
・pythonファイルを
・同期実行する
方法を記載します!
前提
pythonがインストールされていること。
pythonのコード
ここでは例として、
・「pythonからのメッセージ出力です!」というメッセージを出力する
・「test.py」を作成
します。
from tkinter import messagebox
import sys
messagebox.showinfo('メッセージ', 'pythonからのメッセージ出力です!')

PowerShellのコード
ここでは例として、
・上記で作成したpythonのファイル「test.py」を
・同期実行
します。
※ここでは先程作成したpythonのファイル「test.vbs」をデスクトップ配下に配置しています。
# pythonファイルのパスを指定
$pyFile = "C:\Users\user\Desktop\test.py"
$ws = New-Object -ComObject Wscript.Shell
try
{
# pythonを実行
Start-Process -FilePath $pyFile -Wait -WindowStyle Hidden
$ws.popup("正常終了しました。")
}
catch
{
$ws.popup("エラー : " + $PSItem)
}
実行結果
pythonファイルを同期実行できました。


参考
上記で使用した以下の詳細は、公式サイトをご確認ください。
●「Start-Process」コマンドレット