SimonS
SimonS

Reputation: 1973

Why is Get-PSDrive so slow?

I'm trying to get the RemoteAdress for a Networkdrive. I'm doing it like this:

Get-PSDrive -name K -PSProvider FileSystem

I'm not joking, this command takes more than 120 seconds to complete in ISE and Terminal.

but if I run this inside measure-command it gives me the following output:

PS Z:\Powershell-Scripts\_DVLP> measure-command {get-psdrive -name K -PSProvider FileSystem}


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 5
Ticks             : 53547
TotalDays         : 6.19756944444444E-08
TotalHours        : 1.48741666666667E-06
TotalMinutes      : 8.9245E-05
TotalSeconds      : 0.0053547
TotalMilliseconds : 5.3547

why does this take such a long time when run outside of measure-command?

I'm on PSVersion 5.1.14393.0, Windows 10 Anniversary Update

however, I just need the RemoteAdress somehow so I could also use net use K:, but then I can't access the RemoteAdress Property.

How can I get my RemoteAdress?

Upvotes: 3

Views: 795

Answers (1)

AdamL
AdamL

Reputation: 13191

The problem was already identified and fixed in recent WMF 5.1 release. If upgrading is not an option you can found workaround in comments here.

Upvotes: 1

Related Questions