-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Get-AzContainerRegistry cmdlet throws error when $PSModuleAutoLoadingPreference is set to None #27014
Comments
Hi, does "path to onedrive" contain special char? Such as quotes? If yes, could you try installing the modules in a local directory? |
The path does not contain any special characters. I tested on two machines, one with a path containing a space and the other where no spaces are included in the path. pwsh -NoProfile
Import-Module Az.ContainerRegistry
Get-AzContainerRegistry # works
$PSModuleAutoloadingPreference='None'
Get-AzContainerRegistry # fails
$PSModuleAutoloadingPreference='All'
Get-AzContainerRegistry # works again Other cmdlets, like pwsh -NoProfile
Import-Module Az.ContainerInstance
Get-AzContainerGroup # works
$PSModuleAutoloadingPreference='None'
Get-AzContainerGroup # Still works The issue seems to be in the azure-powershell/src/ContainerRegistry/ContainerRegistry.Autorest/exports/ProxyCmdletDefinitions.ps1 Line 7218 in bd6445f
|
Thanks for the research. It sure seems |
The issue happens in azure-powershell/src/ContainerRegistry/ContainerRegistry.Autorest/exports/ProxyCmdletDefinitions.ps1 Line 7224 in bd6445f
The weird thing here it works with We should try to getcommand for both |
autorest-powershell fix PR |
Description
I want to explicitly load the modules I use and have disabled autoloading by setting $PSModuleAutoloadingPreference='None' in my profile. Most Az cmdlets works as expected but Az.ContainerRegistry doesn't play well with this approach.
When I run Get-AzContainerRegistry cmdlet it fails with error
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: