termor
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 9/1/2007
-
Status: offline
|
get-content to variable
Saturday, September 01, 2007 10:23 PM
( permalink)
hello
$obj = Get-ChildItem *.html
foreach($file in $obj)
{
[string]$rez;
get-content $file | $rez
#do somethings with #rez
}
I want write file content to $rez but this line give me error:
Expressions are only permitted as the first element of a pipeline.
At line:2 char:17
+ get-content $file | $rez
<<<< }
|
|
|
|
SAPIENScripter
-
Total Posts
:
283
- Scores: 2
-
Reward points
:
0
- Joined: 11/1/2006
- Location: SAPIEN Technologies
-
Status: offline
|
RE: get-content to variable
Tuesday, September 04, 2007 12:39 AM
( permalink)
You need to do something like this: foreach ($file in $obj) { $rez=get-content $file $rez.length }
|
|
|
|