Hi, what would best way to to this kinda thing. I want to read txt files first line and save it to $ so I can use it later. After it had been read and saved it needs to be deleted.
At the moment I have done it like this and wondering how to delete row after this.
Learn something every day. I’ve never noticed the skip or skiplast parameters of select-object. Very cool, and definitely the better answer to his needs.
I personally would have done something more programatic like…
[pre]
$var = Get-Content test.txt
$var = $var[1…$var.length]
[/pre]
I’d have expected that the $var.length needed to be placed in parenthesis, but at least in my console it didn’t.