Deleting Gmail Emails via Google API using Powershell v2.0
问题 $user = "example@gmail.com" $pass= "examplepassword" $secpasswd = ConvertTo-SecureString $user -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential ($pass, $secpasswd) Invoke-RestMethod 'https://www.googleapis.com/gmail/v1/users/me/messages/0' -Method Delete -Credentials $cred So, my problem here is twofold. I originally tried using Invoke-WebRequest to delete gmail emails via the Google API with a http delete request. However, this did not work because Powershell