KAFKA-19890: Fix stop command failure after wmic removal in newer Windows. #20896
+6
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Team:
Refer to https://issues.apache.org/jira/browse/KAFKA-19890
In windows 11. It failed to start/stop the kafka due to the WMIC tool is superseded by Windows PowerShell.

WMIC is used only in two places (start + stop)
More background information:
https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242
Proposing a new PR to fix this issue. Since I found that PR #20257 already covers the startup side, So I removed my startup changes and kept only the stop fix. Thanks.
Attach part of the tests of result (verify the command) for this PR except the basic tests:

Thanks a lot!