我正在執行一個exe參數,如下所示(我正在使用powershell)。如何從XML獲取參數並執行exe列表?
$path="C:\Program Files\RobWare\RVTools"
$VCServer="15.3.3.3"
$VCServer2="16.5.4.4"
$AttachmentFile=$vcserver.xls
&"$path\rvtools.exe" -s $VCServer -u user-p password-c ExportAll2xls -d $AttachmentDir -f $AttachmentFile
&"$path\rvtools.exe" -s $VCServer2 -u user2 -p password123 -c ExportAll2xls -d $AttachmentDir -f $AttachmentFile
由於我有很多的VC服務器,我認爲最好是有XML文件,然後執行這個EXE的所有VC服務器。
我想寫一個XML文件,其中所有的參數將被指定如下。
<Host>
<IP>15.3.3.3</IP>
<User>user</User>
<Password>password</Password>
</Host>
<Host>
<IP>16.3.3.3</IP>
<User>user</User>
<Password>password</Password>
</Host>
然後調用exe並從XML傳遞此參數。怎麼做 ?