Home Forums Programming Powershell SQL Server documentation using Powershell RE: SQL Server documentation using Powershell

  • Please forgive me going through each element as I am doing this for anyone who reads this post's thread.

    1) Return all the files and directories in the directory "C:\Source Directory\" that have an extension of "xml":

    Get-Items "C:\Source Directory\*.xml"

    2) Pipe the results from the previous operation to the next (these will be file and directory information objects in this example):

    |

    3) Perform an operation on each of the objects piped through:

    ForEach-Object {[Operation to perform]}

    4) Using $_ to refer to the current object, execute the script in the file named Convert-SqlServerInventoryClixmlToExcel.ps1 passing the value of the FullName property of the current object as the script parameter named FromPath:

    Convert-SqlServerInventoryClixmlToExcel.ps1 -FromPath $_.FullName

    Gaz

    -- Stop your grinnin' and drop your linen...they're everywhere!!!