Hello everyone!! Hoping someone may be able to help me out with a strange annoyance. I have a couple scripts that rely on set-location (I use CD .... same thing). Anyway, my scripts are using this for AD tasks or DFSR primarily. Often times my script will crash and while debugging I find that the Set-location command is not working anymore. Let me rephrase, I think its working but it complains that it can't find the directory.
exact error:
PS C:\Windows> CD AD:
CD : Cannot find drive. A drive with the name 'AD' does not exist.
At line:1 char:1
+ CD AD:
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (AD:String) [Set-Location], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
Like I mentioned, this command works 9 times out of 10. Its just every now and then it bombs. Unfortunately its used heavily in one of my automation scripts and the failure of this "automation" job is not really acceptable. If I open a new PS session the command still doesn't work. The only way to get the functionality back seems to be to reboot the server where the script is running from....yuck!!
If anyone has seen this before or has any suggestions it would be greatly appreciated!!!
oh, if you're wondering.....
PSVersion4.0
WSManStackVersion3.0
SerializationVersion1.1.0.1
CLRVersion4.0.30319.17929
BuildVersion6.3.9600.16406
PSCompatibleVersions{1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion2.2