If you inside of a script mount a disk or do other operation that add another disk into system (unlock TrueCrypt protected volume) then you will not be able immediately access it. For example Get-ChildItem -Path X: will not work and you will get an error like you want to access a partition that does not exists.
The issue is related to Windows PowerShell Drives (PSDrive) that were not refreshed yet. You can wait (a bad idea in the script) or you can refresh them immediately after command that mounted drive:
Get-PSDrive | Out-Null« Previous Next »