Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. hwood125

    Compare-object to a text file

    I am trying to compare files between two different folders and then if there are differences I would like to output it to a txt file. Right now I can show the differences but I am unable to write the results in the txt file. Here is what I have so far: foreach($file in dir) { $fileName =...
  2. hwood125

    How to create a new text file per stored procedure

    That did the trick! The only thing that I changed was commenting out the first foreach ($folder in get-childitem) because it made an endless loop. So I removed that and it worked great. Thank You for all of your hard work!!!
  3. hwood125

    How to create a new text file per stored procedure

    There is a name property and there is a script method. As far as I know they are all objects. Not that I am an expert by any means but what I have so far will create a single text file with a static name. Inside the file it has the script of all of the stored procedures in the directory. So...
  4. hwood125

    How to create a new text file per stored procedure

    You are exactly right up to the point about naming the files. I want to name each file with the name of the stored procedure that it is scripting out. So if there are 10 procs in the dir then there will be 10 txt files each with the name of the proc that is in the directory. Does that make...
  5. hwood125

    How to create a new text file per stored procedure

    I'm still a newbie here. When you say preceding loop and you talking about putting it inside the {} directly following the $_.script() and would I still have to pipe it to the out-file? Is this what you mean: foreach ($Name in Dir) { gci | % {$_.script() | out-file "c:\$Name.txt"} ? Thanks!
  6. hwood125

    How to create a new text file per stored procedure

    When I write that it gives me an error mentioning: + for each ($name in dir){gci | % {$_.script()} | out-file <<<< "c:\$name.txt"} Out-File : Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index I have no idea where to go from there?
  7. hwood125

    How to create a new text file per stored procedure

    In powershell through sqlServer:\sql\servername\default\databases\databasename\storedprocedures> I am able to create a text or .sql file with all of the stored procs in the directory into one text file. I am wondering how I can script each stored proc into it's own .sql or txt file. Here is...

Part and Inventory Search

Back
Top