Getting Error while calculation on variable
<p>I want to calculate the percentage of utilized space for specific folder and display the value compared to a threshold value i.e. 85% but when I write below code, I get error:</p>

<blockquote>
  <p>Cannot convert the "Microsoft.PowerShell.Commands.GenericMeasureInfo" value of type "Microsoft.PowerShell.Commands.GenericMeasureInfo" to type "System.Double".</p>
</blockquote>

<p>Code:</p>

<pre><code>$Path = "C:\Nikhil"
$Workspace = (Get-ChildItem $Path -recurse | Measure-Object -property length -sum)
"{0:N2}" -f ($Workspace.sum / 1GB)
$Workspace1 = $Workspace -as [double]
$Percentage = ($Workspace1/6143.87)*100
if($Percentage -le 85)
{
    $body += "`t" + $Path + " is $Percentage percent utilized. "
}
</code></pre>

<p>Could you please correct me where I am doing wrong? Thanks in advance.</p>