Skip to content

PowerShell spam-comment deletion example passes multiple IDs as one argument #664

Open

Description

@qorud02

In guides/common-tasks.md, the “Delete spam comments” example recommends this command for PowerShell:

wp comment delete $(wp comment list --status=spam --format=ids)

When the inner command outputs one line containing 11 22, PowerShell passes "11 22" as one argument to wp comment delete. It does not split that line into two ID arguments as Bash does.

I reproduced the shell behavior on Windows 11 with Windows PowerShell 5.1.26100.9549, PowerShell 7.6.5, WP-CLI 2.12.0 and PHP 8.4.26. A non-destructive before_wp_load WP-CLI command fixture emitted space-separated IDs and reported the received arguments. The original example produced ["11 22"]; splitting the output with -split '\s+' produced ["11","22"]. A guard also avoids invoking deletion when there are no spam IDs.

The guide should keep its Bash example and provide a PowerShell version that splits the output into separate arguments.

AI assistance: OpenAI Codex helped reproduce the shell behavior and prepare this report and the proposed documentation change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions