We are trying to install Oracle Virtual box extension using below commands (using extpack extensions).
Execute-Process works successfully however Start-ADTProcess gives us the prompt shown in attached image (which is not displaying with PSADT 3*) and it causes a installation to fail.
explanation:
You are opening the double quotes before extpack install... and then closing them again after ...--replace , you then briefly open (and close) a second pair of double quotes at the end of ....vbox-extpack So PowerShell does not understand what you are asking it to perform.
The same rule applies to your Start-ADTProcess command
When using multiple double quotes in a PowerShell command you need to use the escape character `.
Also it is good practice to wrap variables inside a string with $() as this ensures paths with a space in them get expanded correctly.
Please note the name and path in the 2nd "Start-ADTProcess" command is different to your first "Execute-Process" command - this might be part of the problem too.
So, your code 'should' work with these modifications (I have not updated the path or name of the .vbox-extpack file):
In the "Oracle_VirtualBox_Extension_Pack-7.2.6-172322-ENTERPRISE (1).vbox-extpack" part, there's no $($adtSession.DirFiles) part to fully qualify the path like the old line, which is likely your issue.
I have executed the commands as per your suggestions. However issue is still the same.
Ideally VBoxManage.exe supposed to run the vbox-extpack with the Arguments we are passing which is not happing. Refer the Task Manager snap below.
This behavior in PSADT4 is totally different from what we observed in PSADT 3
(With Start-ADTProcess Only VBoxManage.exe process is getting launch and it is not passing th e arguments to launch processes VBoxSDS.exe and VBoxSVC.exe)
Are you running the 3.x and 4.x commands on the same device, or different devices? One device looks cooked to me whereas the 3.x device looks like it's not.
I can appreciate what you're saying about thinking Start-ADTProcess isn't working right, however its ultimately the single-most important function in the toolkit so if it wasn't working right, we'd absolutely know about it!
When I mentioned Start-ADTProcess isn't working means we are not getting the same expected result we were getting while running the same commands with Execute-Process.
Yeah but you're not getting me either, you need to refer to my post above your last one and see what the StdErr says: "VBoxManage.exe: error: Failed to create the VirtualBox object!...", etc. It indicates that there's a problem with your deployment.
When I ran Start-ADTProcess -FilePath 'C:\Program Files\Oracle\VirtualBox\VBoxManage.exe' -ArgumentList "extpack install --replace ""C:\Users\MitchRichters\Downloads\Oracle_VirtualBox_Extension_Pack-7.2.6.vbox-extpack""", everything worked fine, but I did get a console window appearing saying I needed to accept a EULA:
To get around this, I used the following command: Start-ADTProcess -FilePath 'C:\Program Files\Oracle\VirtualBox\VBoxManage.exe' -ArgumentList "extpack install --replace ""C:\Users\MitchRichters\Downloads\Oracle_VirtualBox_Extension_Pack-7.2.6.vbox-extpack""" -CreateNoWindow -StandardInput y:
To sum up, your screenshot of 4.1.8 not working is not at the fault of PSAppDeployToolkit v4, its the fault of your device and the StdOut in the screenshot you placed above clearly demonstrates that. If you were using 3.x and the interactivity to press Y as part of the vbox-extpack is no issue, then a working machine with 4.1.8 should work also. If you do want a truly silent experience, which you would not have been able to get on PSAppDeployToolkit 3.x as the toolkit has never had stdin support, use the pre-release I linked above with the command line I provided.