I have the follow "powershell script"
Get-WMIObject -Query "SELECT * from win32_logicaldisk WHERE DriveType = '3'" | Measure-Object -Property Size -Sum | select -ExpandProperty SUm
And i want to use this to make it happen, but my var variable is empty. I think it's with the " or ' but i'm a newbie and my knowledge isn't that great with scripting. Can someone help me with this silly thing?
FOR /F "tokens=* USEBACKQ" %%F IN (`powershell -noprofile {Get-WMIObject -Query "SELECT * from win32_logicaldisk WHERE DriveType = '3'" | Measure-Object -Property Size -Sum | select -ExpandProperty SUm}`) DO (
SET var=%%F
^|.$size = (Get-CimInstance -Query "SELECT * from win32_logicaldisk WHERE DriveType = '3'" | Measure-Object -Property Size -Sum).Sumand then you can just refer to that elsewhere in the Powershell script?