Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


get-content to variable

 
Logged in as: Guest
arrSession:exec spGetSession 2,5,51440
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Windows PowerShell >> get-content to variable
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 get-content to variable - 9/1/2007 9:23:26 PM   
  termor

 

Posts: 1
Score: 0
Joined: 9/1/2007
Status: offline
hello

      

I want write file content to $rez but this line give me error:

      
 
 
Post #: 1
 
 RE: get-content to variable - 9/3/2007 11:39:12 PM   
  SAPIENScripter


Posts: 261
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
You need to do something like this:

foreach ($file in $obj) {
$rez=get-content $file
$rez.length
}

_____________________________

Jeffery Hicks
Windows PowerShell MVP
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

(in reply to termor)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Windows PowerShell >> get-content to variable Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts