Skip to content

Bug report: Exporting a flow with reserved character '>' throws exception #3404

@martinlingstuyl

Description

@martinlingstuyl

Description

When exporting a flow (in json format mode) with the reserved character > (on windows), the command throws an exception.

Background:
The > character can easily be included in a flow name when a Flow is created without giving it a name in the first place. Power Automate will determine its name, and will include a > character.

Steps to reproduce

Create a flow with a > character in a name.
Export it using:

m365 flow export --id xxxx --environment "Default-xxxx" --packageDisplayName "some-name" --format json

Expected results

The json file is saved on the device.

Actual results

The following error is thrown:

node:fs:585
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open './Button -> Start and wait for an approval.json'
    at Object.openSync (node:fs:585:3)
    at Object.writeFileSync (node:fs:2170:35)
    at C:\Users\MartinLingstuyl\AppData\Roaming\npm\node_modules\@pnp\cli-microsoft365\dist\m365\flow\commands\flow-export.js:123:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: './Button -> Start and wait for an approval.json'

Diagnostics

No response

CLI for Microsoft 365 version

5.4.0 (next)

nodejs version

16.15.0

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions