This is what I use:
#if TargetMacOS then
Dim sh as new Shell
dim request as String = "system_profiler SPHardwareDataType | grep -i ""Serial Number (system):"" | awk '{print $4}'"
sh.Execute(request)
// If there is an error
if sh.ErrorCode <> 0 then
// Handle your exception here, raising an Exception
end if