私は、オンデマンドでElasticSearch's Support Diagnosticsツールを実行するPowerShellスクリプトを作成しています。PowerShellのパラメータを使用してバッチコマンドを実行する方法
私のコードは次のとおりです。 ES.Config.xml - PowerShellから実行する診断コマンドを格納するxmlファイルです。その文字列として保存された(DEV.Diagnostic.ExecuteCommand参照:
Invoke-Expression -Command $global:DiagnosticCommand
グローバル$::私のPowerShellスクリプトでは
<DEV>
<Diagnostic FolderPath="" ExecuteCommand="C:\ElasticSearch\support-diagnostics-5.12\diagnostics.bat --host localhost --port 9200 --user elastic -p" />
を私のようにコマンドを実行しようとしているDiagnosticCommandは、グローバル変数であります"C:¥ElasticSearch¥support-diagnostics-5.12¥diagnostics.bat --host localhost --port 9200 --user elastic -p"という値を格納しています。アドバイスをいただければ幸いです。
**私は常にエラー... **を取得しますか?それはどこから来ますか? 'powershell'または[diagnostics.bat](https://github.com/elastic/elasticsearch-support-diagnostics/blob/master/scripts/diagnostics.bat)または' java'から?質問を編集して完全なトレースバックを提供してください。 – JosefZ
'call'演算子を見ることをお勧めします。 – Eris
次のエラーは次のとおりです。エラー:メインクラスcom.elastic.support.diagnostics.DiagnosticAppが見つかりませんでした。 –