I know this is a PowerShell forum but I figured the technical expertise would be found here.
I need to do the following. Machine abc does not have Office installed locally. A user who is logged into machine abc goes to a network share and double clicks on an Office doc (.xlsx, docx etc…) I need that document to launch in Office.Live.com
Now, I can modify the File Association and point any .xlsx or docx file to run a custom PowerShell Script. This PowerShell script looks like this:
(if an Excel file was clicked on…)
if (Test-Path “C:\Program Files\Microsoft Office 15\root\office15\Excel.exe”){start-sleep -m 1}
ELSE {cmd.exe /c “C:\Program Files\Internet Explorer\iexplore.exe” “Sign in to your account”}
My issue is this does not open the document that was actually clicked on. How would that be done? So the file could be something like this: \Server\Share\SubFolder\SubFolder2\Expense Report for January 2017.xlsx
How would you launch that in Office.Live with Powershell?