Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

fix: use -Force with Get-Item to correctly handle hidden/system path segments#119

Open
yyhran wants to merge 1 commit intoirondash:mainfrom
yyhran:get-item
Open

fix: use -Force with Get-Item to correctly handle hidden/system path segments#119
yyhran wants to merge 1 commit intoirondash:mainfrom
yyhran:get-item

Conversation

@yyhran
Copy link
Copy Markdown

@yyhran yyhran commented Mar 17, 2026

Description

This PR addresses a robustnees issue in resolve_symlinks.ps1 where path resolution fails on Windows if any segment of the path has "Hidden" or "System" attributes.

In many Windows environments, folders such as AppData (common in PUB_CACHE paths) carry these attributes. By default, Get-Item ignores these items and throws an ObjectNotFound error, even though the directory physically exists. Adding the -Force parameter ensures that the script can inspect these segments to check for symbolic links/junctions without interruption.

Changes

  • Updated resolve_symlinks.ps1: Added -Force to the Get-Item call within the path segment loop.

Verification Results

  • Scenario: Building a Flutter project where dependencies are located in a PUB_CACHE path involving hidden system folders.
  • Before: Get-Item fails with ItemNotFoundException (ObjectNotFound) when hitting the AppData segment, causing confusing console errors and potential link resolution failure.
  • After: The script successfully traverses all segments regardless of their attributes, and the build completes cleanly.

Add `-Force` flag to `Get-Item` in `resolve_symlinks.ps1` to ensure hidden 
folders (like `AppData`) or system-protected junctions can be resolved 
without throwing ObjectNotFound errors.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant