Does jq return any exit error code on Windows Powershell?
Hi, all, I am configuring rancher desktop on my Windows 11 and one of the steps https://docs.rancherdesktop.io/how-to-guides/generating-deployment-profiles/#windows suggests to use below command
jq -e . working-defaults.txt >/dev/null 2>&1
According to the documentation , the command will have a 0 status if the file is valid (True on Powershell), 1 or False otherwise.
I tried to run it on my machine but the command does not print anything on the command line when json file is correct.
Even when I try to invalidate the structure of the file nothing gets displayed.
It is my understanding that the correct syntax on PowerShell would be the below, where $null should instruct jq to be executed on the background, so theoretically nothing will be ever printed on the screen
jq -e . working-defaults.txt >$null 2>&1
If I remove the background option , I receive the jq parse error but still no False
jq -rb . working-defaults.txt
jq: parse error: Expected separator between values at line 78, column 14
Any idea what am I missing?
I assume the documentation implies as target someone more advanced than myself on jq and shell script
Posted Aug 12, 2026, 8:24 PM UTC