View Single Post
Old 05-14-2007   #1 (permalink)
K Kong


 
 

Stumped by variable substitution

What did I do wrong here? Why does the "\microsoft[1].txt" gets ignored?

PS C:\>
$CookieFile=$env:UserProfile.ToString()+"\"+$Env:username.ToString()+"\microsoft[1].txt"
PS C:\> $CookieFile
C:\Documents and Settings\kingkong\kingkong\microsoft[1].txt
PS C:\> get-content $CookieFile
Get-Content : Cannot find path 'C:\Documents and Settings\kingkong\kingkong'
because it does not exist.
At line:1 char:12
+ get-content <<<< $CookieFile
PS C:\>

Thanks in advance.
My System SpecsSystem Spec