Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To connect to SharePoint Online with Powershell 7 #12108

Closed
7Shubhamb opened this issue Mar 12, 2020 · 2 comments
Closed

To connect to SharePoint Online with Powershell 7 #12108

7Shubhamb opened this issue Mar 12, 2020 · 2 comments
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered.

Comments

@7Shubhamb
Copy link

I am not able to connect to SharePoint Online Site collection with Powreshell 7.I am getting below error -The remote server returned an error: (400) Bad Request.

Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
$userName = "***"
$password = ConvertTo-SecureString "" -AsPlainText -Force
$webURL="https://test.sharepoint.com/sites/test/"
$Context=New-Object Microsoft.SharePoint.Client.ClientContext($webURL)
$Context.Credentials=New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username,$password)
$Web=$context.Web
$Context.Load($web)
$Context.executeQuery()
Write-host $Web.URL

@7Shubhamb 7Shubhamb added the Issue-Enhancement the issue is more of a feature request than a bug label Mar 12, 2020
@iSazonov
Copy link
Collaborator

I guess the Sharepoint module is not compatible with PowerShell Core. Please use other channels to report the issue like UserVoice.

@iSazonov iSazonov added Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered. and removed Issue-Enhancement the issue is more of a feature request than a bug labels Mar 12, 2020
@AspenForester
Copy link

I'm currently able to import the 'Microsoft.Online.SharePoint.PowerShell' on a windows machine in PS7 using the -UseWindowsPowerShell switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question ideally support can be provided via other mechanisms, but sometimes folks do open an issue to get a Resolution-Answered The question is answered.
Projects
None yet
Development

No branches or pull requests

3 participants