Last active
December 3, 2016 15:09
-
-
Save JasonMorgan/a2f0231d815b1c0c52e14cfd10d43c1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-OneDriveUrl { | |
param ( | |
$sharingUrl | |
) | |
$base64Value = [System.Convert]::ToBase64String( [System.Text.Encoding]::UTF8.GetBytes($sharingUrl) ) | |
$encodedUrl = "u!" + $base64Value.TrimEnd('=').Replace('/','_').Replace('+','-') | |
(Invoke-RestMethod -Uri "https://api.onedrive.com/v1.0/shares/$encodedUrl/root?expand=children").'@content.downloadUrl' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment