Skip to content

Install-PSResource / Save-PSResource do not process scripts with ExternalModuleDependencies from local path repositories #1467

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
peetrike opened this issue Nov 1, 2023 · 2 comments

Comments

@peetrike
Copy link

peetrike commented Nov 1, 2023

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

When trying to install or save script with required module (like ActiveDirectory) which is also included in EXTERNALMODULEDEPENDENCIES metadata field, the cmdlet complains in verbose output about module not available in repository.

At the same time, when the same script ins in PSGallery, there is no problem installing/saving script.

Expected behavior

PS > find-psresource send-passwordnotification -Repository PSGallery | Install-PSResource
# installation succeeds

PS > find-psresource send-passwordnotification -Repository PSGallery | Save-PSResource -Path c:\downloads
# saving succeeds

Actual behavior

PS > find-psresource send-passwordnotification -Repository test | Install-PSResource
Install-PSResource: Package(s) 'Send-PasswordNotification' could not be installed from repository 'test'.

PS > find-psresource send-passwordnotification -Repository test | Save-PSResource -Path c:\downloads
Save-PSResource: Package(s) 'Send-PasswordNotification' could not be installed from repository 'test'.

PS ❯ Get-PSResourceRepository test

Name  Uri                                    Trusted Priority
----  ---                                    ------- --------
test  file:///C:/Projects/Repositories/test/ False   50

Required modules also mentioned in EXTERNALMODULEDEPENDENCIES metadata field should not be searched from local repository.

Error details

Verbose output for both commands has message:

VERBOSE: Package with name ActiveDirectory could not be found in repository 'test'.

Environment data

PSResourceGet: 1.0.0
PowerShell: 7.3.9, 5.1

Visuals

No response

@peetrike
Copy link
Author

peetrike commented Nov 1, 2023

Also, the error message could mention the actual reason why script was not processed.

@peetrike
Copy link
Author

peetrike commented Nov 1, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants