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

Can't create sharepoint folder with non ascii character in the name #1757

Closed
pvagner opened this issue Jan 21, 2023 · 2 comments · Fixed by #1768
Closed

Can't create sharepoint folder with non ascii character in the name #1757

pvagner opened this issue Jan 21, 2023 · 2 comments · Fixed by #1768
Assignees

Comments

@pvagner
Copy link

pvagner commented Jan 21, 2023

I am on linux with Powershel 7.3 and Microsoft Graph SDK 1.20.

When creating folder the non accented letters get changed to something else and I am unable to figure it out.

$params = @{
    "name" = "Foldér"
    "folder" = @{}
    "@microsoft.graph.conflictBehavior" = "rename"
}
$NewFolder = Invoke-MgGraphRequest -Uri "https://graph.microsoft.com/v1.0/groups/$($newGroup.id)/drive/items/root/children" -Method POST -Body $params
$params.name
Foldér
$newFolder.name
Fold�r
@peombwa
Copy link
Member

peombwa commented Jan 24, 2023

is the same behavior reproducible when calling the API directly through Graph Explorer? If so, please open a question/ticket at https://developer.microsoft.com/en-us/graph/support as this is a service issue. Otherwise, please share the -Debug output of the command.

@peombwa
Copy link
Member

peombwa commented Jan 24, 2023

The issue is due to how Invoke-MgGraphRequest serializes the request body. We will review and provide a patch in our upcoming releases. See -DeBug output:

$NewFolder = Invoke-MgGraphRequest -Uri "https://graph.microsoft.com/v1.0/groups/003565e9-11d7-4c35-a5cc-c6d0a2c90a2d/drive/items/root/children" -Method POST -Body $params -Debug
VERBOSE: POST https://graph.microsoft.com/v1.0/groups/003565e9-11d7-4c35-a5cc-c6d0a2c90a2d/drive/items/root/children with 74-byte payload

Confirm
Continue with this operation?
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): A
DEBUG: POST /v1.0/groups/003565e9-11d7-4c35-a5cc-c6d0a2c90a2d/drive/items/root/children HTTP/1.1
HTTP: graph.microsoft.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Microsoft Windows 10.0.22621; en-US) PowerShell/7.3.1 Invoke-MgGraphRequest
Content-Length: 74
Content-Type: application/json

{"folder":{},"name":"Fold�r","@microsoft.graph.conflictBehavior":"rename"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants