Windows file management

Inventory hidden and large files in Windows before archiving a project folder

Create a read-only Windows folder inventory with relative paths, sizes, timestamps, and attributes, then preview the CSV before defining what an archive must contain.

By: ToolboxHub Editorial Team Sources checked: 7 min read 1372 words

Define the archive boundary before scanning

Start with one named project folder and a separate destination for the report. An inventory can show which files exist under that boundary; it cannot decide whether a linked dependency, database, secret, build cache, cloud-only item, or external asset also belongs in the archive.

Consider a web project that contains source code, a hidden configuration file, generated output, and several large raw videos. The source folder may look small in File Explorer when hidden items are not visible, while the media folder dominates the archive size. Write down the intended scope first: for example, “everything under C:\Projects\Website, including hidden files, but not dependencies stored elsewhere.”

Keep the source unchanged during discovery. Create an audit folder outside the project, give the report a new dated name, and make sure the previous report remains available for comparison. The report can reveal candidates for a decision, but file size or a hidden attribute is not permission to remove anything.

Export a read-only inventory in PowerShell 5.1 or 7.5

Use Get-ChildItem to enumerate files and Export-Csv to create a separate report. The workflow below is scoped to Windows PowerShell 5.1 and PowerShell 7.5 because those are the official Microsoft documentation versions checked on 2026-08-23; it does not promise identical behavior in earlier shells, another operating system, or a restricted organization-managed environment.

First create C:\Audit in File Explorer and confirm that it is outside the project. Then enter these commands in the PowerShell version you identified:

  • Set the source: $source = (Resolve-Path -LiteralPath 'C:\Projects\Website').Path
  • Set a new report name: $report = 'C:\Audit\website-inventory-20260823.csv'
  • Enumerate and export: Get-ChildItem -LiteralPath $source -Force -File -Recurse | Sort-Object Length -Descending | Select-Object @{Name='RelativePath';Expression={$_.FullName.Substring($source.Length).TrimStart('\')}}, Length, LastWriteTime, Attributes | Export-Csv -LiteralPath $report -NoTypeInformation -Encoding UTF8 -NoClobber

Microsoft's Get-ChildItem documentation says that -Recurse traverses child containers, -Force exposes hidden items, and the file-system provider supports -File. The command selects a relative path, byte length, last-write time, and attributes, then orders larger files first. It reads the listed source files' properties; it does not open their contents, rename them, move them, or delete them.

The Export-Csv documentation explains that objects become CSV rows and recommends selecting properties instead of formatting objects before export. -NoClobber makes an existing report a blocking error instead of silently replacing it. If that happens, choose a genuinely new report name rather than removing the protection.

Treat errors and unusual attributes as part of the result

A CSV file can exist even when the inventory is incomplete. Read the PowerShell output for access-denied messages, missing paths, files that changed during enumeration, and other errors before trusting the report.

Hidden configuration files deserve review because they may be required to reproduce the project, but they can also contain credentials that should not be placed in a broadly shared archive. Record the file's purpose and use the project's approved secret-management process; do not paste secret contents into the report. Attributes is a clue, not a security classification.

Reparse points, junctions, synchronized folders, long paths, and files held by applications can also complicate scope. A report row does not prove that bytes were captured in a later ZIP, and a missing row does not prove that the file was unnecessary. If the command reports a location you cannot access, stop and ask the project owner or administrator how that location should be handled rather than rerunning everything with elevated privileges by default.

No rename operation is needed here. If a separate future job must rename files, work on a backup or isolated test copy and preview the exact rename with -WhatIf before execution; changing a suffix still would not convert file contents.

Preview the exported CSV without claiming it edits anything

Open the report in the CSV / Excel Online Preview and confirm the four headers, the row count, a hidden configuration entry, a known large media file, and a file near the bottom of the expected directory tree. This is a review of the exported table, not a second scan of Windows.

The current ToolboxHub component reads selected CSV, TSV, XLSX, or XLS data in the browser with SheetJS. It can select a workbook sheet, search loaded rows, show matching row and column counts, and render up to 500 matching data rows at once. The parser library is loaded from a CDN, so the page can show a loader error when that network dependency is unavailable.

The viewer cannot scan the project folder, follow Windows permissions, edit the source CSV or XLSX, change attributes, move files, or decide what belongs in an archive. Its Export CSV button creates another CSV from all rows in the currently opened sheet; typing in the search box does not make that download a filtered export. Keep the original PowerShell report as the audit record.

For a large inventory, search for distinctive relative paths and extensions rather than treating the first 500 rendered rows as the entire dataset. Because the PowerShell command sorts by Length descending, the first rows are useful for size review, but the status count and targeted searches are still needed to sample the full report.

Verify the archive against the inventory

After an authorized person creates the archive with the project's approved method, generate or obtain a second inventory for the extracted archive and compare the same normalized fields. A matching row count alone is weak evidence: one missing file and one unexpected file can cancel each other numerically.

For small, non-sensitive manifests, Text Diff can highlight line-level additions and removals after both lists use the same ordering and field layout. It compares pasted text only; it does not read file bytes, prove that two files with the same name are identical, or validate the archive format.

Use a short acceptance pass:

  • Confirm that both inventories refer to the intended source and extracted destination, not two similarly named folders.
  • Review every access or enumeration error instead of suppressing it.
  • Check hidden configuration files separately for necessity and secrets.
  • Compare relative paths and sizes, then investigate every difference.
  • Open a representative source file, large media file, and nested file from the extracted archive in their appropriate applications.
  • Keep the source, first report, and backup until the project owner accepts the archive.

The result is an auditable list of what Windows exposed under a defined boundary. It improves an archive review, but it cannot replace application-specific backups, database exports, source-control checks, secret handling, or a restore test.

Frequently asked questions

Does this PowerShell command change any project files?

No. It reads file-system properties and writes a new CSV outside the project. -NoClobber prevents an existing report from being overwritten. The command contains no move, delete, or rename action.

Why use -Force when creating the inventory?

In the file-system provider, -Force includes hidden items that a default listing may omit. Hidden does not mean safe, unsafe, required, or disposable; each such file still needs an owner and purpose review.

Is the workflow compatible with every PowerShell version?

No. The documented scope is Windows PowerShell 5.1 and PowerShell 7.5, using parameters present in the checked Microsoft pages. Earlier versions, other platforms, permissions, and provider behavior need separate verification.

Can ToolboxHub edit the CSV or the project folder?

No. CSV / Excel Online Preview parses a selected table for viewing and can create a separate CSV download. It does not edit the workbook, write back to the report, scan Windows, or change any project file.

Are the first 500 preview rows the complete inventory?

Not necessarily. The component renders at most 500 matching data rows while its count can represent more loaded rows. Use targeted searches and a full-data review process instead of equating the visible slice with the whole report.

Does a matching inventory prove the archive can be restored?

No. Paths and sizes are useful checks, but applications may need databases, external services, permissions, links, encryption keys, or files outside the selected boundary. Extract and open representative files, then perform the project's actual restore test.

References