Hi everyone i ran this code :
""""$Space= Get-PSDrive | Where-object {$.Provider -like "FileSystem" -and $.Free -gt 0
$Capacity= $Space.used + $Space.free
$OccupationRate = $Space.used / $Capacity""""
and it returns me this error:
Method call failed. [System.Object []] does not contain a named method
'op_Division'.
In line: 11 characters: 1
+ $ OccupationRate = $ Space.Used / $ Capacity
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: InvalidOperation: (op_Division: String) [], RuntimeException
+ Fully Qualified Error ID: MethodNotFound
Method call failed. [System.Object []] does not contain a named method
'op_Division'.
In line: 11 characters: 1
+ $ OccupationRate = $ Space.Used / $ Capacity
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: InvalidOperation: (op_Division: String) [], RuntimeException
+ Fully Qualified Error ID: MethodNotFound
Method call failed. [System.Object []] does not contain a named method
'op_Division'.
What's the problem? I was following a video I checked all the syntax is correct.