I made some changes to the PERFCOUNTERS module and they were:
Work as background Job
Now we can work with asynchronous data collection, without locking the Powershell session
A new parameter (RunAsJob) was included in the function, allowing the collection is made in the background.
The job created will be the name of the XML file and the time now (YYYYMMDDHHMMSS)
In this case, a job called testes_20100530091224 (XML Name_yyyyMMddhhmmss)
and to see the Jobs Running :
To get the correspondent Job, use ID or Name (you have this information with the command above)
To see if the job is running without errors [updated] using -keep switch parameter as Marco Shaw explain in comments below :
If no error message returns because it’s all correct
To stop the Job
If an error occurs, it will generate a log file with the function name corresponding to the error and extension .Log in the folder $home. Find out what your home folder, type $home in some Powershell Session.
Also The error message is displayed on the screen.
To see the function help
Inserting TXT into SQL Server Table
For this is not much secret we can use the TSQL bulk insert.
But Now it has a function that already upload the txt for the table and creating it with the header fields.
You can choose whether to create the table, insert an already created, pass the name to be created or the function generates a name for you.
For use this function, you have to install SQLPSX
Upload the TXT and create a new table (function generate for you)
Upload the txt into a existing Table
Upload the TXT and create a new table with name chosen by you
I would appreciate usage feedback , bugs reports, suggestions.. 🙂