Skip to content

Get-InstalledPSResource -ErrorAction Ignore -Path throws if path contains no directories #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
o-l-a-v opened this issue Apr 10, 2025 · 0 comments
Open
3 tasks done
Labels
Area-GetPSResource Issue-Bug Something isn't working

Comments

@o-l-a-v
Copy link
Contributor

o-l-a-v commented Apr 10, 2025

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Get-InstalledPSResource -ErrorAction Ignore -Path throws if path contains no directories.

Reproduce:

# Make up a temp path
$TempPath = [string] [System.IO.Path]::Combine($env:TEMP,[datetime]::Now.ToString('yyyyMMddHHmmss'))

# Create said temp path
$null = [System.IO.Directory]::CreateDirectory($TempPath)

# Get installed modules from it
Get-InstalledPSResource -ErrorAction Ignore -Path $TempPath

Expected behavior

-ErrorAction Ignore should not throw

Actual behavior

It throws

Error details

Error cannot find expected subdirectories in provided path: <some_path>

Environment data

* Windows 11 24H2 x64
* PowerShell v7.5.0
* PSResourceGet v1.1.1

Visuals

No response

@anamnavi anamnavi added Issue-Bug Something isn't working Area-GetPSResource and removed Needs-Triage labels Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-GetPSResource Issue-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants