|
Re: Stumped by variable substitution On May 14, 9:21 am, K Kong <K...@discussions.microsoft.com> 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.
try that:
$env:UserProfile.ToString()+"\"+$Env:username.ToString()+"\" +
$microsoft[1].txt |