I’m trying to create a one click method for Office 365 to install. This is what it looks like now:
$uncServer = "\\networkshare" $uncFullPath = "$uncServer\Office365" $uncDestination = "C:\Office365_install-x64" mkdir $uncDestination Copy-Item -Path $uncFullPath -Destination $uncDestination -Recurse -Force Start-Process -FilePath "$uncDestination\Office365\Install_Office365-x64_batch.bat" -ArgumentList /S Start-Sleep -s 300 Remove-Item -path $uncDestination -recurse
In the batch file I have the following:
c:\Office365_install-x64\setup.exe /configure configuration-64.xml
As soon as I get to Start-Process, it will create a Office-Click-to-Run process while installing Office. I want to remove the $uncDestination as soon as the Office-Click-to-Run process terminates. If there is a method to rather run the batch command in Powershell, I can add a -Wait command.
Any help would be appreciated.