Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function Open-Solution() {
  2. $solutions = gci -recurse -path *.sln
  3. if ($solutions.Count -eq 1) {
  4. & $solutions.FullName
  5. } elseif ($solutions.Count -eq 0) {
  6. write-host "I couldn't find any solution files here!"
  7. } elseif ($solutions.Count -gt 1) {
  8. write-host "I found more than solution. Which one do you want to open?"
  9. $solutions | % { write-host " - $($_.FullName)" }
  10. }
  11. }
  12.  
  13. New-Alias sln Open-Solution
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement