Windows Vista Forums

Not updating drive listing?

  1. #1


    catfish Guest

    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

  2. #2


    Marco Shaw Guest

    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

  3. #3


    catfish Guest

    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

  4. #4


    Marco Shaw Guest

    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

Not updating drive listing?

Similar Threads
Thread Thread Starter Forum Replies Last Post
CD/DVD drive Volume not updating BJH Vista General 1 30 Mar 2009
CD/DVD drive Volume not updating in My Compuater/Explorer Window artoo General Discussion 0 30 Mar 2009
Hard disk displayed as removal drive after updating vista Mervyn Vista hardware & devices 8 15 Jan 2008
DVD/CD not listing files Dave Vista General 1 01 Nov 2007
Drive size listing Brandon Shell PowerShell 7 20 Aug 2007