You can try the below piece of script (Customize the values according to your needs)
# Get the nodes
$nodes = (Get-NcNode).Node
# Clear the contents of CSV Files
If(Test-Path C:\node.csv) {Clear-Content C:\node.csv}
If(Test-Path C:\shelf.csv) {Clear-Content C:\shelf.csv}
# Get the Node info in a CSV file
(Get-NcNode) | Select-Object Node, NodeModel, NodeSerialNumber, NodeSystemId, ProductVersion | Export-Csv C:\node.csv
# Get the shelf info for all the nodes in a CSV file
for ($i=0; $i -lt (Get-NcNode).count; $i++)
{
Get-NcShelf -NodeName $nodes[$i] | Select-Object NcController, NodeName, ShelfId, ShelfName, ShelfState, ShelfType, ShelfBayCount | Export-Csv C:\shelf.csv -Append
}