msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
Cannot upload file to Sharepoint
Cannot upload file to Sharepoint.
Set-MgDriveItemContent -DriveId $DriveId -DriveItemId $DriveItemId -InFile $ItemFullName
The command returns an error:
Set-MgDriveItemContent : Could not load file or assembly 'Microsoft.Win32.Registry, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. At line:220 char:76 + ... -DriveId $DriveId -DriveItemId $DriveItemId -InF ... + ~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Set-MgDriveItemContent_Set], FileNotFoundException + FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.SetMgDriveItemContent_Set
It last worked in 2.12.0 version.
Hi @mgajda83 thank you for logging this issue. Kindly confirm the SDK version you are using.
I have tried to reproduce the issue, but everything seems to work fine with the latest SDK version 2.15.0.
I use latest SDK. It works on PowerShell Core. Problem occurre on old PowerShell 5.1.