Skip to content

[BUG] Set-PnPFileCheckedIn fails when file path contains "%20" #5270

@NizarGrindi

Description

@NizarGrindi

Reporting an Issue or Missing Feature

Set-PnPFileCheckedIn cmdlet fails to check in files when the file path contains %20

Problem

The Set-PnPFileCheckedIn cmdlet fails to check in files when the file path contains "%20". Instead of processing the file, it returns the message:

The file /sites/test/Shared Documents/Test 1231/test (version 1).xlsx does not exist.

  • Actual file path: /sites/test/Shared Documents/Test %20 1231/test (version 1).xlsx
  • The intended path contains %20.
  • When the file path is specified with "%20" encoded for spaces, the cmdlet throws a file not found error.
  • This makes it impossible to check in files with spaces in their names using encoded URLs.

Expected behavior

  • Set-PnPFileCheckedIn should handle file paths that include "%20" and successfully check in such files.

Steps to reproduce behavior

  1. Attempt to check in a file with a path containing %20 :
    Set-PnPFileCheckedIn -Url "/sites/test/Shared Documents/Test %20 1231/test (version 1).xlsx"
  2. Observe the error message:

    The file /sites/test/Shared Documents/Test 1231/test (version 1).xlsx does not exist.

What is the version of the Cmdlet module you are running?

3.1.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions