header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

read sharePoint output, a text file, into hashtable
Last Post 17 Jan 2008 06:31 PM by kctalbot. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
kctalbotUser is Offline
New Member
New Member
Posts:14
Avatar

--
17 Jan 2008 12:27 AM  

I've got a text file from Sharepoint that looks like a hashtable.  I ran get-content to load variable and of course got a string datatype.  I tried casting input [hashtable] and received error messages correctly indicating I don't know what I am doing.  $content = [[hashtable] get-content] output.txt.  How do I load flat file into a hashtable?  How can I then convert that to a useable csv file?  Input looks like StorageUsedMB="7.9" StorageWarningMB="130".  I have read through and copied the thread on Excel to figure out, but the information would be really useful once I get the url, owner, storage info etc. into spreadsheet or database.  Like start an instance of ie with the site URL, review site for errors, exit and on to next site. 

kct



SAPIENScripterUser is Offline
New Member
New Member
Posts:45

--
17 Jan 2008 02:51 PM  
Can you attach the file or at least a subset of it?


Jeffery Hicks
Microsoft PowerShell MVP
http://blog.sapien.com
http://www.scriptinganswers.com

"Those who forget to script are doomed to repeat their work."
kctalbotUser is Offline
New Member
New Member
Posts:14
Avatar

--
17 Jan 2008 05:46 PM  

Not claiming to understand hashtables, but when I got through the chapter in PS in Action the output looked like a hashtable.   Then it seemed easier to deal with just the values rather than all the string parsing I had been thinking of.


Attachment: 1117505348471.txt

kctalbotUser is Offline
New Member
New Member
Posts:14
Avatar

--
17 Jan 2008 06:31 PM  

get-content D:\data\Desktop\SharepointSites.txt | foreach-object {$_.split()}

 

First choice might be to not have "site url" broken up, but this does start getting me close. Another issue is that some of the records have a secondary owner which was one of the things that made pulling it directly into Excel be less than optimal.


You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer