Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### User Parameters
- $OneDriveSetupPath = "C:\TEMP\OneDriveSetup.exe" ### Change to location of OneDriveSetup.exe
- ### Script Parameters
- $user = $env:USERNAME
- $OneDrivePath = "C:\Users\$user\AppData\Local\Microsoft\OneDrive\OneDrive.exe"
- ### Check OneDrive and Install or startup
- $testPath = Test-Path $OneDrivePath
- if (!$testPath){
- $arguments = "/Silent"
- $process = Start-Process -FilePath "$OneDriveSetupPath" -ArgumentList $arguments -Wait -PassThru -NoNewWindow
- Start-Process -FilePath $OneDrivePath
- } else {
- Start-Process -FilePath $OneDrivePath -ArgumentList "/background"}
Advertisement
Add Comment
Please, Sign In to add comment