I am working in Azure DevOps, creating an automated build process.
Doing the PowerShell command:
$batchNodes = az batch node list --pool-id $poolId
...results in a json structure complete with all Nodes in my Pool, and all Node details. I am only looking for a list of node ids though, because I need to restart each Node in the Pool, which requires a Node id.
I expected this PowerShell command to work, but it doesn't. ($batchNodes is blank)
$batchNodes = az batch node list --pool-id $poolId | ConvertFrom-Json
Is there a fancier or simpler method I can use to get an array of Node id values from the 'az batch node list' command results?
I'm using PowerShell 7.2. If you know of some way to restart all of the Nodes in a Pool, please share this information.
Much thanks.