View Single Post
Old 05-14-2007   #5 (permalink)
Marco Shaw


 
 

Re: Stumped by variable substitution

K Kong wrote:
> 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.


Seems Keith Hill mentions an issue with "[" and "]" in this thread
"Scripting / Logging Gripe Summary" from May 12th. (I did not read it
in detail though.)

Marco
My System SpecsSystem Spec