Skip to content

Bug report: m365 spo folder add doesn't support folders with numerical names ending with ".0" #5789

@AndrewCarvalho

Description

@AndrewCarvalho

Priority

(Urgent) I can't use the CLI

Description

When trying to create a new folder with a numerical name that ends with a ".0" the folder will be created without the ".0" and only the preceding digits. It seems that the path sent in the request is causing the issue as the request itself already has the characters stripped out of the path.

Steps to reproduce

Attempt to create a new folder with the name "1.0" using the command
m365 spo folder add --webUrl $siteUrl --parentFolderUrl $sPFolderPath --name 1.0

Expected results

A new folder should be created with the name 1.0

Actual results

A folder named 1 is created instead

Diagnostics

Executing command spo folder add with options {"options":{"debug":true,"u":"xxxxxx","p":"Shared Documents\\xxxxxxxx","parentFolderUrl":"Shared Documents\\xxxxxxxx","n":1,"name":1,"output":"json"}}
Request:
{
  "url": "https://xxxxxxx(decodedUrl='%2Fsites%2Fxxxxxx%2F1')",
  "method": "post",
  "headers": {
    "Accept": "application/json;odata=nometadata",
    "user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/7.3.0",
    "accept-encoding": "gzip, deflate",
    "X-ClientService-ClientTag": "M365CLI:7.3.0",
    "authorization": "xxxxxx"
  },
  "responseType": "json",
  "decompress": true
}

folder creation response after requesting a folder named 2.0:

{   
"Exists": true,   
"ExistsAllowThrowForPolicyFailures": true,   
"IsWOPIEnabled": false,   
"ItemCount": 0,   
"Name": "2",   
"ProgID": null,   
"ServerRelativeUrl": "/xxxxxxxx/1",   
"TimeCreated": "2024-01-23T01:30:24Z",   
"TimeLastModified": "2024-01-23T01:30:24Z",   
"UniqueId": xxxxxxxxxx",   
"WelcomePage": "" 
}

CLI for Microsoft 365 version

v7.3.0

nodejs version

v20.11.0

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

{
  "os": {
    "platform": "win32",
    "version": "Windows 10 Pro",
    "release": "10.0.19045"
  },
  "cliVersion": "7.3.0",
  "nodeVersion": "v20.11.0",
  "cliAadAppId": "31359c7f-bd7e-475c-86db-fdb8c937548e",
  "cliAadAppTenant": "common",
  "authMode": "Browser",
  "cliEnvironment": "",
  "cliConfig": {},
  "roles": [],
  "scopes": {
    "https://graph.microsoft.com": [
      "AllSites.FullControl",
      "AppCatalog.ReadWrite.All",
      "AuditLog.Read.All",
      "Bookings.Read.All",
      "Calendars.Read",
      "ChannelMember.ReadWrite.All",
      "ChannelMessage.Read.All",
      "ChannelMessage.Send",
      "ChannelSettings.ReadWrite.All",
      "Chat.Read",
      "Chat.ReadWrite",
      "Directory.AccessAsUser.All",
      "Directory.ReadWrite.All",
      "ExternalConnection.ReadWrite.All",
      "ExternalItem.ReadWrite.All",
      "Group.ReadWrite.All",
      "IdentityProvider.ReadWrite.All",
      "InformationProtectionPolicy.Read",
      "Mail.Read.Shared",
      "Mail.ReadWrite",
      "Mail.Send",
      "Notes.Read.All",
      "OnlineMeetings.ReadWrite",
      "OnlineMeetingTranscript.Read.All",
      "PeopleSettings.ReadWrite.All",
      "Place.Read.All",
      "Policy.Read.All",
      "RecordsManagement.ReadWrite.All",
      "Reports.Read.All",
      "SecurityEvents.Read.All",
      "ServiceHealth.Read.All",
      "ServiceMessage.Read.All",
      "ServiceMessageViewpoint.Write",
      "Tasks.ReadWrite",
      "Team.Create",
      "TeamMember.ReadWrite.All",
      "TeamsAppInstallation.ReadWriteForUser",
      "TeamSettings.ReadWrite.All",
      "TeamsTab.ReadWrite.All",
      "TermStore.ReadWrite.All",
      "User.Invite.All",
      "User.ReadWrite.All",
      "profile",
      "openid",
      "email"
    ],
    "https://laundrybearcom.sharepoint.com": [
      "AllSites.FullControl",
      "AppCatalog.ReadWrite.All",
      "AuditLog.Read.All",
      "Bookings.Read.All",
      "Calendars.Read",
      "ChannelMember.ReadWrite.All",
      "ChannelMessage.Read.All",
      "ChannelMessage.Send",
      "ChannelSettings.ReadWrite.All",
      "Chat.Read",
      "Chat.ReadWrite",
      "Directory.AccessAsUser.All",
      "Directory.ReadWrite.All",
      "ExternalConnection.ReadWrite.All",
      "ExternalItem.ReadWrite.All",
      "Group.ReadWrite.All",
      "IdentityProvider.ReadWrite.All",
      "InformationProtectionPolicy.Read",
      "Mail.Read.Shared",
      "Mail.ReadWrite",
      "Mail.Send",
      "Notes.Read.All",
      "OnlineMeetings.ReadWrite",
      "OnlineMeetingTranscript.Read.All",
      "PeopleSettings.ReadWrite.All",
      "Place.Read.All",
      "Policy.Read.All",
      "RecordsManagement.ReadWrite.All",
      "Reports.Read.All",
      "SecurityEvents.Read.All",
      "ServiceHealth.Read.All",
      "ServiceMessage.Read.All",
      "ServiceMessageViewpoint.Write",
      "Tasks.ReadWrite",
      "Team.Create",
      "TeamMember.ReadWrite.All",
      "TeamsAppInstallation.ReadWriteForUser",
      "TeamSettings.ReadWrite.All",
      "TeamsTab.ReadWrite.All",
      "TermStore.ReadWrite.All",
      "User.Invite.All",
      "User.ReadWrite.All"
    ]
  }
}```

### Additional Info

I am using m365 for automated builds and distribution via SharePoint and don't have control over the folder naming conventions generated by the build tools. This is preventing successful sharing of builds which is a blocker from using the CLI as part of our CI setup.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions