I have a script of 6 lines as follows:
#Get-PSDrive | Where-Object Description -eq “RECOVERY”
wmic logicaldisk get caption,volumename
Get-WmiObject win32_logicaldisk | select-object -property DeviceID,VolumeName
Get-WmiObject win32_logicaldisk | Where-object VolumeName -eq “DDRIVE”
Get-PSDrive | Where-Object Description -eq “RECOVERY”
When I run it, the last line never gets executed (in the sense that I didn’t get anything on the console).
When I remove the ‘#’ in Line 2 – which is identical to the last line, I get the outputs,
but in a seemingly strange order: the output of Line 2 and Line 6 (the last) appear together
at the end. I must be missing something about how console output is generated and handled.
Any advice or tips or references to the right source of help will be highly appreciated.