Skip to content

Instantly share code, notes, and snippets.

@mark05e
Last active January 15, 2025 02:36
Show Gist options
  • Save mark05e/3cb020151660c2c71b706dc85c699d24 to your computer and use it in GitHub Desktop.
Save mark05e/3cb020151660c2c71b706dc85c699d24 to your computer and use it in GitHub Desktop.
#ref: http://eddiejackson.net/wp/?p=23710
# https://www.microsoft.com/en-ca/microsoft-365/onedrive/download
# Variables
$WebFile = "https://go.microsoft.com/fwlink/p/?LinkID=844652&clcid=0x1009&culture=en-ca&country=CA"
$PPath = "C:\TempPath\OneDriveInstaller"
$ProcName = "OneDriveSetup.exe"
# Create the folder anyway
New-Item -ItemType "directory" -Path $PPath | Out-Null
# Download the file
(New-Object System.Net.WebClient).DownloadFile($WebFile,"$PPath\$ProcName")
# Run the installer
Start-Process ("$PPath\$ProcName")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment