Quickie: opening all powershell scripts in a repo

At my workplace, I sometimes have to switch rapidly from working on one repository to another – for instance if I’m working on Robot Army and I get a request to change something in Sleepytime or Grapnel.

Well, I got sick of hunting down the specific files I needed in a given repo, and instead wrote a quick throwaway function in my $profile

Function Open-AllPowerShell
{
    gci *.ps*1 -Recurse -File | % { ise $_.FullName }
}

Dead simple. Finds all powershell scripts and modules in the current working path, recursively, and opens them in the ISE.

Much easier than messing around hunting the right file in the right subdirectory.

Of course, if you have hundreds of powershell files, YMMV. But it works for me.

Leave a Reply

Your email address will not be published. Required fields are marked *