Accessing a remote system and running
Get-WmiObject -ClassName Win32_LogicalDisk -ComputerName $computer
or
Get-CimInstance -ClassName Win32_LogicalDisk -ComputerName $computer
is a standard approach.
If you’re creating a function with that… Read the full text.