You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PowerShell spam-comment deletion example passes multiple IDs as one argument #664
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.
Activity