Opening multiple files in ISE
Q: Is there a way to open a bunch of files in ISE quickly?
A: Yes.
Get-ChildItem -Path C:\MyWork -Filter My*.ps1 | ForEach-Object {ise $_.FullName}
In this case, any files that start with ‘My’, under the ‘c:\MyWork’ folder, will run through the foreach-object loop and open those files.
You can change the path or change the filter options to different queries. Say you’ve named a group of files with ‘ProjectA‘, under a mapped network drive:
Get-ChildItem -Path H:\MyFolder\MyWork\ -Filter ProjectA*.ps1 | ForEach-Object {ise $_.FullName}
or dated several files for a month of work under a UNC share:
Get-ChildItem -Path \\Someserver\SomeshareMyFolder\MyWork\ -Filter July*.ps1 | ForEach-Object {ise $_.FullName}
You could also function this up and add a couple of parameters:
Function Get-MyFiles {
Param ($PathLocation,$PrefixOfFiles)
Get-ChildItem -Path $PathLocation -Filter $PrefixOfFiles*.ps1 | ForEach-Object {ise $_.FullName}
}
Hope that helps in re-opening a bunch of files quickly to make your life easier.
Mike