-
Notifications
You must be signed in to change notification settings - Fork 87
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
Azure Automation errors #361
Comments
I hit the same issue and found that it is related to what PowerShell runtime version is used for the runbook. The issue is present when using PowerShell 7.2, but not in 5.1. I think this could be resolved by using Find-PSResource instead of Find-Module to avoid having to install the Nuget provider on the sandbox workers in Azure Automation. The PSResourceGet module would need to be added as a prerequisite for this to work (it will be included by default in PowerShell 7.4, but as of now Azure Automation supports 7.2). |
It should be fixed if you add the following packages to the Runtime Environment:
|
Also managed to get everything to work after installing both NuGet and PackageManagement as modules in the Azure Automation Account. So this should at least be added to the documentation. One solution for this is using a HybridVM to run the Azure Automation with saved custom-tests. But it would be nice to have a good way of doing this out of the box |
Created a pull request to add this to the documentation #479 |
I followed the instructions for configuring Maester in Azure Automation and these are the 3 errors I got.
1.
MethodInvocationException: Exception calling "ShouldContinue" with "2" argument(s): "A command that prompts the user failed because the host program or the command type does not support user interaction. The host was attempting to request confirmation with the following message: PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or 'C:\Users\ContainerUser\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the NuGet provider now?"
Find-Module: C:\usr\src\PSModules\Maester\internal\ConvertTo-MtMaesterResults.ps1:44 Line | 44 | $latestVersion = (Find-Module -Name Maester).Version | ~~~~~~~~~~~~~~~~~~~~~~~~~ | NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201' or newer version of NuGet provider is installed.
Invoke-MgGraphRequest: C:\usr\src\PSModules\Maester\public\Send-MtMail.ps1:150 Line | 150 | Invoke-MgGraphRequest -Method POST -Uri $sendMailUri -Body $mailR …
The text was updated successfully, but these errors were encountered: