I'm trying to come up with a percent column by dividing two columns in a select-object. This is what I'm using:
Get-DbaDbLogSpace -SqlInstance serverName |
Select-Object ComputerName, InstanceName, SqlInstance, Database, LogSize,
LogSpaceUsed, LogSpaceUsedPercent,
@{Name="PercentFree"; Expression={($_.LogSpaceUsed / $_.LogSize)}} |
Format-Table
This returns an 'OB' on the expression column (see pic below). How do I do math with two columns in a Select-Object expression please?
If doing this a different way outside of a Select-Object would be better, I'm open to it.
This is what the data looks like for the above code:
Thanks for the help.