Jim Mezo
asked on
Get-PSDrive results
Hello,
I'm creating a script my clients can run that will give them some quick information when they call our helpdesk. One of the things I want listed out is their mapped drives. More specifically the shares that the drives are mapped to.
First I make a variable and pass it the value from this: $MD = Get-PSDrive | ?{$_.Name -ne "C"} | ?{$_.used -gt 1}. This does great for getting rid of the C: drive and the other values I don't want. If I run that command alone, the output under the Root parameter will list out the share of the mapped drives. But when I pass this output to a variable ($MD) and then try to Write-Host $MD.Root, it only list out the drive letters and not the share name.
Does anyone know how I can get it to list out the share, instead of the drive letters?
Thanks!
I'm creating a script my clients can run that will give them some quick information when they call our helpdesk. One of the things I want listed out is their mapped drives. More specifically the shares that the drives are mapped to.
First I make a variable and pass it the value from this: $MD = Get-PSDrive | ?{$_.Name -ne "C"} | ?{$_.used -gt 1}. This does great for getting rid of the C: drive and the other values I don't want. If I run that command alone, the output under the Root parameter will list out the share of the mapped drives. But when I pass this output to a variable ($MD) and then try to Write-Host $MD.Root, it only list out the drive letters and not the share name.
Does anyone know how I can get it to list out the share, instead of the drive letters?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER