daily pastebin goal
2%
SHARE
TWEET

install-OneDrive

Workspace-Guru Jun 12th, 2018 (edited) 660 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ### User Parameters
  2. $OneDriveSetupPath = "C:\TEMP\OneDriveSetup.exe" ### Change to location of OneDriveSetup.exe
  3.  
  4. ### Script Parameters
  5. $user = $env:USERNAME
  6. $OneDrivePath = "C:\Users\$user\AppData\Local\Microsoft\OneDrive\OneDrive.exe"
  7.  
  8. ### Check OneDrive and Install or startup
  9. $testPath = Test-Path $OneDrivePath
  10.  
  11. if (!$testPath){
  12. $arguments = "/Silent"
  13. $process = Start-Process -FilePath "$OneDriveSetupPath" -ArgumentList $arguments -Wait -PassThru -NoNewWindow
  14. Start-Process -FilePath $OneDrivePath
  15. } else {
  16. Start-Process -FilePath $OneDrivePath -ArgumentList "/background"}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top