-
Notifications
You must be signed in to change notification settings - Fork 23
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
Task fails on self-hosted agent when PSRule and/or PSRule.Rules.Azure already installed #477
Comments
Also installed locally:
|
I threw in a task before - task: AzurePowerShell@5
displayName: "Import-Module PowerShellGet"
condition: succeeded()
inputs:
azureSubscription: ${{parameters.subscriptionId}}
scriptType: inlineScript
errorActionPreference: 'Stop'
targetAzurePs: latestVersion
pwsh: true
inline: |
Import-Module PowerShellGet -Verbose
Get-InstalledModule PowerShellGet The output:
|
@silverl Thanks for reporting the issue. The task currently ships with support for PSRule v2.1.0. And will try to install this version. To use PSRule v2.2.0. Set the We can probably do better to provide an additional switch to accept newer versions. Thanks for the feedback. If this doesn't solve the issue, let us know. Otherwise let's keep the issue open and I'll look at providing an addition option to avoid pinning the version. |
Description of the issue
My tasks were working fine in the Azure DevOps hosted agent.
I just installed the self-hosted agent locally on Windows 11 x64. I already have PSRule 2.2.0 and PSRule.Rules.Azure 1.17.1 installed.
The self-hosted agent runs as the NETWORK SERVICE user.
It looks like it might be trying to uninstall or reinstall the modules, and it's erroring out.
Configuration
Yaml configuration of the extension.
Expected behaviour
Expected it to work as it did in a hosted agent.
Error output
Task in use and version:
Additional context
I tried commenting out the
ps-rule-install
task, as I already have the modules installed locally.The next task,
ps-rule-assert
, failed in a similar manner as it too attempted to install the modules.I next attempted to uninstall the modules from my machine to see if I could progress. I was blocked again with a similar message that they were in use.
I closed all terminals and powershell sessions and stopped VSCode (in which I have the PSRule extension installed). This seemed to allow me to uninstall the modules and run the job again.
This time I'm getting the following:
The text was updated successfully, but these errors were encountered: