msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Cannot upload file to Sharepoint

Open mgajda83 opened this issue 1 year ago • 1 comments

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.

mgajda83 avatar Feb 19 '24 12:02 mgajda83

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. image

timayabi2020 avatar Mar 01 '24 08:03 timayabi2020

I use latest SDK. It works on PowerShell Core. Problem occurre on old PowerShell 5.1.

mgajda83 avatar Mar 22 '24 07:03 mgajda83