Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Not updating drive listing?

Reply
 
Old 04-23-2007   #1 (permalink)
catfish


 
 

Not updating drive listing?

I'm tring to use TrueCrypt with powershell. TrueCrypt is an encryption
program which in my case is encrypting a whole drive/partition meaning
the drive lester only shows up after I run the program. I'm running it
inside powershell, but I can't seem to access the drive unless I restart
powershell. Get-PSDrive shows the drive (O but I can't access it. Is
there a way to get it to refresh or aworkaround without restarting
powershell? Thanks

PS C:\> Invoke-Expression $TCCmdLine | Out-Null
PS C:\> Sleep 5 #give it some time to mount the drive, just in case
PS C:\> Get-PSDrive | Format-Table -auto

Name Provider Root CurrentLocation
---- -------- ---- ---------------
A FileSystem A:\
Alias Alias
C FileSystem C:\
cert Certificate \
D FileSystem D:\
E FileSystem E:\
Env Environment
F FileSystem F:\
Function Function
G FileSystem G:\
H FileSystem H:\
HKCU Registry HKEY_CURRENT_USER
HKLM Registry HKEY_LOCAL_MACHINE
O FileSystem O:\
Variable Variable


PS C:\> dir o:
Get-ChildItem : Cannot find drive. A drive with name 'o' does not exist.
At line:1 char:4
+ dir <<<< o:

My System SpecsSystem Spec
Old 04-25-2007   #2 (permalink)
Marco Shaw


 
 

Re: Not updating drive listing?


> PS C:\> dir o:
> Get-ChildItem : Cannot find drive. A drive with name 'o' does not exist.
> At line:1 char:4
> + dir <<<< o:


What is "invoke-expression $tccmdline" doing?

I would do a remove-item, then re-add with new-item.

Marco
My System SpecsSystem Spec
Old 04-26-2007   #3 (permalink)
catfish


 
 

Re: Not updating drive listing?

>> PS C:\> dir o:
>> Get-ChildItem : Cannot find drive. A drive with name 'o' does not exist.
>> At line:1 char:4
>> + dir <<<< o:


> What is "invoke-expression $tccmdline" doing?
> I would do a remove-item, then re-add with new-item.


$tccmdline contains the cmdline for the truecrypt program, something
along the lines of "TrueCrypt.exe /v \Device\Harddisk2\Partition1 /l O:
/k keyfile /m /rm /a /s /q", this part of the script works fine (no
change if I put the direct program cmdline instead of using invoke).
This program ends up mounting drive O: in windows

I'm not sure what you mean by using remove-item/new-item, but I will try
using remove/new-psdrive and see if that helps.
My System SpecsSystem Spec
Old 04-26-2007   #4 (permalink)
Marco Shaw


 
 

Re: Not updating drive listing?

> I'm not sure what you mean by using remove-item/new-item, but I will try
> using remove/new-psdrive and see if that helps.


Yes, sorry, I really meant -psdrive and not -item... I should type what
I mean.

Marco
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
CD/DVD drive Volume not updating Vista General
CD/DVD drive Volume not updating in My Compuater/Explorer Window General Discussion
Hard disk displayed as removal drive after updating vista Vista hardware & devices
Listing all the SQL Servers PowerShell
Drive size listing PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46