The first step to any problem is getting said problem into PowerShell! We all know the usual players here WMI, ADSI, .NET, COM, etc… but what about good old text. I get the impression text has been ignored as legacy. When text does get a little attention it is almost always treated like the unix world. Get-Content | Select-String used in place of cat|grep… I offer a different approach, in my opinion you haven’t really ingested something until it’s in the form of an object. Ala, Import-ASUP, a PowerShell script to ingest a NetApp autosupport. Give it a try and look around at the object it spit’s out. You may be surprised just how much information we all beam back to the mother ship every week!
Paul Shannon | 22-Jun-10 at 8:02 pm | Permalink
Hi
I’m sure I’m being stupid, but what do i need to run this?
I have a mixture of asup files and single asup files and bundle zip files.
Also do I just pass the path to the asup data as a parameter from within the powershell command line interface, like:
import-asup.ps1 myASUP.txt?
Thanks
Paul
glnsize | 22-Jun-10 at 9:09 pm | Permalink
The script contains a Function so you need to dot source it to load the function into your current session.
#first dot source the script (Thats dot space dot slash)
PS> . .\Import-asup.ps1
#now our session has the function loaded feed it the asup.
PS>Import-Asup -Path C:\asup.txt
Alternatively, you can simply remove lines 1,2, and 686… this will enable the script to be called directly.
PS>.\import-asup.ps1 -Path “\\netapp1\etc$\log\autosupport\201006222008.0″
Hope that helps,
~Glenn
Paul Shannon | 25-Jun-10 at 11:20 am | Permalink
Brilliant thank you very much indeed.
Paul