Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
read excel file
Last Post 17 Jan 2008 05:20 AM by
SAPIENScripter
. 30 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Page 2 of 2
<<
<
1
2
Author
Messages
SAPIENScripter
New Member
Posts:47
17 Jan 2008 05:20 AM
If you can get rid of the first line, can you now import the file as a csv with the earlier suggestions? That would be the best way to get to an object. Otherwise, you would need to create a new custom object and then define new properties using Add-Member. As to how that would all fit in your script would really depend. if you want to do this using PowerShell, then you need to stick to the PowerShell paradigm. And maybe instead of trying to get everything into one monolithic script, break things down into Powershell functions. Have one function take the Excel file and turn it into a CSV file. Then use PowerShell to import the csv. Pipe that output to another PowerShell expression using foreach-object to do something.
Jeffery Hicks
Microsoft PowerShell MVP
http://blog.sapien.com
http://www.scriptinganswers.com
"Those who forget to script are doomed to repeat their work."
You are not authorized to post a reply.
Page 2 of 2
<<
<
1
2
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2