r/PowerShell • u/BroomIsWorking • Jan 28 '25
PS-based alternative to File Explorer?
In a nutshell, my work computer is massively locked down - except, strangely, for scripting.
I wasn't clear with my intiial post. I cannot install an EXE on my computer. That is why I am looking for a script-based solution.
I need the intervention of a team of IT, plus the sacrifice of a live Mountain Dew, to compile code from my company-installed Visual Studio, but I can grant myself permission to run PS scripts without any safety brakes (and Batch and VBS, for that matter).
Franky, I'm dying for a dual-window file explorer. That would be a serious upgrade to my life. Does such a thing exist?
A file-search functionality that doesn't suck as much as File Explorer's version would be nice, too. If I search for "May" in my Documents folder, I probably do not want every single file containing the verb "may" in it - but FE will return just that.
Does such a thing exist?
5
u/ImperialKilo Jan 28 '25
I mean, if you're very industrious you can duplicate File Explorer entirely using WPF, XAML and powershell. I've done something similar so end users can manage permissions groups with a GUI instead of using ADU&C.
From a conceptual level, this should be super easy. (Learning the tools would be most of the effort)
Use Get-ChildItem to list a folder's contents, then use a foreach block with Get-Item to grab specifc item properties (if needed) and display them in an -OutGridView or a custom WPF ListBox (then program functionality for clicking and selection).
Runspaces would allow a silky-smooth UI with multithreading and a custom WPF form could easily do dual-pane stuff, or even a view like Linux's Ranger (my beloved).
Try it out if you have time. You'll learn a lot, I'm sure.
2
u/BroomIsWorking Jan 28 '25
Yes, I could probably do so, but if I can find a script already written that allows dual-pane navigation of folders, I'd be saving myself loads of hours of work.
2
u/prog-no-sys Jan 28 '25
1
u/BroomIsWorking Jan 29 '25
Interesting... They seem to have blocked commands like Install-PSResource:
Install-PSResource : The term 'Install-PSResource' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
and the same happens for similar commands.
2
u/ImperialKilo Jan 29 '25 edited Jan 29 '25
Are you using Windows Powershell? The module isn't installed by default. Run this:
Install-Module Microsoft.Powershell.PsResourceGetOr use Powershell 7. It's installed by default.
Edit: if there's a cmdlet that someone references but your session doesn't recognize, look up the Microsoft doc for it and install the module it's from.
1
u/_Buldozzer Jan 28 '25
Have you ever tried to run Totalcomander?
1
u/BroomIsWorking Jan 28 '25
Sorry, I wasn't clear enough. EXEs are forbidden.
1
u/_Buldozzer Jan 28 '25
Try renaming Totalcomander to sc.exe, cmd.exe or powershell.exe. That could work, since you are able to run scripts. Those executables need to be excluded, otherwise you can't run scrips.
1
u/Djust270 Jan 29 '25
Any good security software should be looking at the file hash and not just the file name, but its worth a try.
1
u/_Buldozzer Jan 29 '25
More often than not it's just the old GPO "Don't run specified programs" this one can easily be fooled by renaming the exe.
2
1
1
u/Owlstorm Jan 28 '25
It sounds like you want GUI tools rather than CLI - Everything/TotalCommander/WinSCP etc.
That said, I think File Explorer is good enough to tolerate given the locked down work environment.
-7
u/BroomIsWorking Jan 28 '25
I obviously don't share your opinion, so I'm not sure what that serves.
1
u/IAmBroom Jan 29 '25
Typical. His post was "I don't believe your opinion is valid", and that's somehow worth upvoting.
2
u/mdgrs-mei Jan 29 '25
PowerShellRun is a terminal based launcher and has File Manager utility. It navigates the folder hierarchy with fuzzy search. It doesn't have a file content search feature though.
3
1
u/purplemonkeymad Jan 29 '25
I need the intervention of a team of IT, plus the sacrifice of a live Mountain Dew, to compile code from my company-installed Visual Studio
You know you can compile code right in powershell. As long as your target is a library, and i don't think you can add resources but:
$files = Get-childitem *.cs
Add-type -LiteralPath $files.fullname -OutputAssembly .\mylibrary.dllYou can add the library later in a new session by just giving add-type the path to the library:
Add-Type -path .\mylibrary.dllI would still stick to msbuild if you can though.
1
u/IAmBroom Feb 01 '25
OK, so far it looks like *.dll files aren't forbidden, just *.exe. This might be useful.
1
u/Djust270 Jan 29 '25
This may suite your needs https://github.com/djust270/Misc.-Tools/blob/main/Dual%20Window%20File%20Explorer.ps1 I made this with the help of Claude. For searching Im using the Everything PS module so you would need that as well but feel free to do with it as you please.
-4
u/Jainith Jan 28 '25
Sounds like a case for Windows Terminal?
https://learn.microsoft.com/en-us/windows/terminal/panes
There's a bunch of ways of installing it, maybe one of them isn't blocked in your environment.
https://github.com/microsoft/terminal
2
u/IAmBroom Feb 01 '25
WOW! Why are users in this forum so toxic? All you did was offer a suggestion, and you've been downvoted as much as I have for the sin of having an opinion.
9
u/chadbaldwin Jan 28 '25
Not sure exactly what you're looking for...but here's some tools I use:
VoidTools Everything - file indexer and search tool. Indexes every file on the computer in near realtime. Has excellent search features, including a CLI interface (installed separately). However it only searches paths and some metadata, not content.
Ripgrep (
rg) - a rust based supercharged CLI grep/search tool. Let's you search the contents of files using regex incredibly fastfd- another rust based CLI tool, great way to list and search filenames, doesn't require an indexer, but also means it wouldn't be as capable searching system wide. It's better for searching specific directoriesfzf- similar tofd, but interactive in the CLI. It does fuzzy search matching to all files recursively, and has support for things like multi select. It then can output the results to other commandsPowerShell module - ZLocation - a better
cd, it keeps track of all the directories you visit, applies weights to them and allows you to quickly and easily jump around in PowerShell likez deskwould jump to your desktop (once it learns it)I use all of these every day and at this point I rarely even use explorer anymore. Or if I do, I'm often opening it from PowerShell after using one or more of those tools.