dan-osull / PowerShell-Backup-Restore-Microsoft-Todo

Code for blog post on data export using Microsoft Graph API
https://blog.osull.com/2020/09/14/backup-migrate-microsoft-to-do-tasks-with-powershell-and-microsoft-graph/
22 stars 4 forks source link

nothing happens after powershell execute ps1 #1

Open jasonwang115 opened 2 years ago

jasonwang115 commented 2 years ago

Thanks to the author for the backup method, it's important to me , I have a problem and I want to ask you how to solve it , I open powershell ISE to create a ps1 file, paste all the code, and paste the token on line 11 (between the " " symbols) , After saving, right-click on the ps1 file and choose to execute with powershell, nothing happens after that , Which step is wrong? Or is there any missing information? Thank you very much for your great help

jasonwang115 commented 2 years ago

I'm a newbie and I'm making some progress now , I can perform the step of pasting the token , But after pasting the token, the following error message appears

Invoke-RestMethod: C:\Users\jasonwang115\Desktop\todo\Todo.ps1:14 Line | 14 | $me = Invoke-RestMethod -Uri ($graphBaseUri + "/me") -Authenticat … | ~~~~~~~~~~~~~~~ | Bad Request Bad Request HTTP Error 400. The request is badly formed.

I saw other brothers mention changing line 14 to $accessToken = ConvertTo-SecureString “pastedOAuthTokenhere” -AsPlainText -Force

But it doesn't work for me, and there is an extra line 21 error

Just one last step, please help