-
1. Re: Unable to execute program on remote VMs
LucD Feb 6, 2019 3:52 AM (in response to ganapa2000)The default value for the ScriptType parameter on Invoke-VMScript is PowerShell for any Windows guest OS.
Add -ScriptType Bat to your Invoke-VMScript cmdlet.
-
2. Re: Unable to execute program on remote VMs
ganapa2000 Feb 6, 2019 4:17 AM (in response to LucD)Hi LucD,
I have modified the line as below, but still I am getting error
$output = Invoke-VMScript -VM $serv -ScriptText "C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /DATE /EXPAND 1 /EXCEL "D:\$serv_Export.xlsx" /EXPANDABLEREPORT /EXTENSIONSLIST /TOPFILESLIST /PIECHART /TREEMAP /AGEOFFILES /EXTENSIONSPIECHART "D:\" -ScriptType BAT -GuestUser admin -GuestPassword "password"
Error
At D:\tree_export.ps1:8 char:105
+ ... Text {"C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /DATE /EX ...
+ ~
You must provide a value expression following the '/' operator.
At D:\tree_export.ps1:8 char:105
+ ... {"C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /DATE /EXPAND ...
+ ~~~~
Unexpected token 'DATE' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : ExpectedValueExpression
But If I run the direct command works without any error
&"C:\Program Files\JAM Software\TreeSize\TreeSize.exe" /DATE /EXPAND 1 /EXCEL "D:\$serv_Export.xlsx" /EXPANDABLEREPORT /EXTENSIONSLIST /TOPFILESLIST /PIECHART /TREEMAP /AGEOFFILES /EXTENSIONSPIECHART "D:\"
-
3. Re: Unable to execute program on remote VMs
LucD Feb 6, 2019 4:30 AM (in response to ganapa2000)But that is another error, your quotes are not correct.