Anyone happen to have a sample script for recursing a given directory in a filesystem with Powershell? Ultimately what I’m wanting to do is create a script that will generate NSIS file lists for me given a directory. Something very similar to what was done here with a BASH script.
Share
As halr9000 demonstrated, you can use the
-recurseswitch parameter of theGet-ChildItemcmdlet to retrieve all files and directories under a specified path.It looks like the bash script you linked to in your question saves out the directories as well, so here is a simple function to return both the files and directories in a single result object:
Here is how you could use it to create the same install/uninstall text files from halr9000’s example, including uninstall directories: