by KaiY at 2013-01-29 05:34:00
Hi guys,by DonJ at 2013-01-29 14:07:30
I have a quite big textfile which I want to read in:
$Path = "C:\temp\MyBigFile.txt"
$Lines = ${C:\temp\MyBigFile.txt} #this works fine
$Lines = ${$Path} #that produces an error
Can you help me how to use the variable $Path between {} ?
I know "get-content", but the code above is much faster for big files
Thanks
Kai
${} syntax is for defining variables - for example, ${this is a valid variable name}. It’s not actually reading your file into memory, it’s doing that at the time you access $lines.