The issue you are having is not due to a max length situation. First, please note that powershell commands need to be executed with syntax like this:
powershell.exe -command "your command here"
However, in this case for the complex command that you are trying to execute, using the above-mentioned syntax still won’t work. I think this is because the command contains all sorts of characters, and most likely something is causing BP to unsuccessfully interpret the input. BP is not able to execute 100% of commands that can be executed at a cmd prompt. It can handle most but not all.
That said, I would suggest two possible alternatives:
1. The following built-in menu item produces a very similar output to your command: ‘Actions > Get info > Get disk space (available MB) > All disks’
2. Your command can be saved in a FreeDiskSpace.ps1 file and then run in BatchPatch using the BatchPatch ‘Deployment’ feature. Just make sure to check the box in the ‘Deployment’ window to ‘Retrieve console output’. Then when you execute the deployment BP will copy the FreeDiskSpace.ps1 file to the target computer for execution. This avoids any interpretation/parsing problems. You can save the deployment for future use so that it’s available as a single click of a menu item.