Hello I`ve wrote a script for installing programs directly from USB drive in powershell, but as before i used the just the paths so
start-process "D:\programs\program.exe" for ex.
everything was fine but then it stroke me that some computers might assign my USB Drive a different letter, therefore I`ve put up a variable "$P = volume | ? drivetype -eq removable | % driveletter" that gets the letter of currently plugged in USB (obviously working only when only one is in) but as all below command works
start-process "${P}:\programs\program.exe"
the issue I have is silent office install as with path projected it works
D:\office\setup.exe /configure D:\office\configuration.xml
with variable
${P}:\office\setup.exe /configure ${P}:\office\Configuration.xml
It doesn`t put the variable as the assigned letter and when i try to put the whole path into a variable it so for ex.
$D ="${P}:\office\setup.exe"
it says /configure is wrong
cannot user start-process cause /configure is also not working there, can someone please tell me what can i fix it?