Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. $colProducts | sort-object ProductName | `
  2. Select-object ProductName PartName | `
  3. Format-Table -autosize ProductName, PartName | `
  4. Out-File myProducts.txt
  5.  
  6. Add-Content myProducts.txt "`nParts in more than one Product`n"
  7.  
  8. $colProducts | Group-object PartName | sort-object PartName | `
  9. Where-Object {$_.Count -gt 1 } | `
  10. Select-object ProductName PartName | `
  11. Format-Table -autosize ProductName, PartName | `
  12. Out-File myProducts.txt
  13.  
  14. $colProducts | Group-object PartName | sort-object PartName | `
  15. Where-Object {$_.Count -gt 1 } | `
  16. Select-object ProductName PartName | `
  17. Format-Table -autosize ProductName, PartName | `
  18. Out-File -Append myProducts.txt
  19.  
  20. $colProducts | Group-object PartName | sort-object PartName | `
  21. Where-Object {$_.Count -gt 1 } | `
  22. Select-object ProductName PartName | `
  23. Format-Table -autosize ProductName, PartName | `
  24. Out-File -Append myProducts.txt
  25.  
  26. $colProducts | sort-object ProductName | `
  27. Select-object ProductName PartName | `
  28. Format-Table -autosize ProductName, PartName | `
  29. Out-String | Add-Content myProducts.txt
  30.  
  31. Add-Content myProducts.txt "`nParts in more than one Product`n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement