Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

[Az.Tools.Installer] Update-AzModule has blocking 'prompt' on the jobs even with -Force -Confirm:$False #13131

Closed brwilkinson closed 3 years ago

brwilkinson commented 4 years ago

Description

When runing the following, it appears a prompt is still showing for Trusted gallery ?

Steps to reproduce

Install-AzModule -Repository PSGallery -AllowPrerelease -Force -Confirm:$False

Environment data

Appears the same on PS 5.1 or &.0.3.

$PSVersionTable  

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Microsoft Windows 10.0.20211
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

0.1.0 Az.Tools.Installer 2.2.4.1 PowerShellGet

Error output

image

image

image

Debug output

Tested with just a single module AZ.Resources . . . found this other issue #13130

Install-AzModule -Name Resources -Repository PSGallery -AllowPrerelease -Force -Confirm:$False                                                                
DEBUG: 00:00:00.0000001 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0000177 Name: PSGallery
DEBUG: 00:00:00.0031828 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0085491 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0094965 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.0150365 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0243870 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0244038 Name: PSGallery
DEBUG: 00:00:00.0277074 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0329542 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0387231 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0479183 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0479349 Name: PSGallery
DEBUG: 00:00:00.0510428 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0566689 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0627124 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0818270 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0828182 ProviderName: PowerShellGet
DEBUG: 00:00:00.0836307 Name: PSGallery
DEBUG: 00:00:00.0844084 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0877373 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0931632 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0945194 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.1004718 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.1099992 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.1109941 ProviderName: PowerShellGet
DEBUG: 00:00:00.1115289 Name: PSGallery
DEBUG: 00:00:00.1120774 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1155108 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.1211321 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.1222527 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.1286964 Done calling powershell «Resolve-PackageSource» «PSModule»
WARNING: This cmdlet will not install preview version for Az.Accounts.
DEBUG: 00:00:00.0000001 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0000177 Name: PSGallery
DEBUG: 00:00:00.0000284 Verbose: False
DEBUG: 00:00:00.0000382 ErrorVariable: ev
DEBUG: 00:00:00.0033193 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0118474 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0127505 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.0179540 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0278607 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0278770 Name: PSGallery
DEBUG: 00:00:00.0278873 Verbose: False
DEBUG: 00:00:00.0278970 ErrorVariable: ev
DEBUG: 00:00:00.0310103 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0361679 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0415864 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0524892 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0525043 Name: PSGallery
DEBUG: 00:00:00.0525143 Verbose: False
DEBUG: 00:00:00.0525232 ErrorVariable: ev
DEBUG: 00:00:00.0556434 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0611029 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0669346 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0854592 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0864875 ProviderName: PowerShellGet
DEBUG: 00:00:00.0869121 Name: PSGallery
DEBUG: 00:00:00.0874271 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0879617 Verbose: False
DEBUG: 00:00:00.0884316 ErrorVariable: ev
DEBUG: 00:00:00.0918531 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0971318 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0982518 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.1045031 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.1166196 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.1174332 ProviderName: PowerShellGet
DEBUG: 00:00:00.1178831 Name: PSGallery
DEBUG: 00:00:00.1183362 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1188073 Verbose: False
DEBUG: 00:00:00.1191830 ErrorVariable: ev
DEBUG: 00:00:00.1224495 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.1282188 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.1295900 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.1353676 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0000269 Source: PSGallery
DEBUG: 00:00:00.0000372 Name: Az.*
DEBUG: 00:00:00.0031635 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0086275 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0094634 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.0151120 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0276625 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0276790 Source: PSGallery
DEBUG: 00:00:00.0276895 Name: Az.*
DEBUG: 00:00:00.0308183 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0362565 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0418172 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0506768 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0506922 Source: PSGallery
DEBUG: 00:00:00.0507022 Name: Az.*
DEBUG: 00:00:00.0537274 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0589251 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0649634 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0738417 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0738582 Source: PSGallery
DEBUG: 00:00:00.0738681 Name: Az.*
DEBUG: 00:00:00.0768543 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1
DEBUG: 00:00:00.0823111 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0923371 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.1150285 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.1159472 Source: PSGallery
DEBUG: 00:00:00.1167592 Name: Az.*
DEBUG: 00:00:00.1171371 ProviderName: PowerShellGet
DEBUG: 00:00:00.1175187 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1179970 Type: Module
DEBUG: 00:00:00.1213376 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.1271248 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.1286076 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.1358306 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.1360047 Calling SearchForPackages. Name='Az.*'
DEBUG: 00:00:00.1375216 PackageProvider::FindPackage with name Az.*
DEBUG: 00:00:00.1455262 Calling SearchForPackages After Select 1
DEBUG: 00:00:00.1473203 Calling New() : MethodName = 'FindPackage'
DEBUG: 00:00:00.1481467 Source: PSGallery
DEBUG: 00:00:00.1485019 Name: Az.*
DEBUG: 00:00:00.1488620 ProviderName: PowerShellGet
DEBUG: 00:00:00.1492479 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1495840 Type: Module
DEBUG: 00:00:00.1528290 INVOKING PowerShell Fn Find-Package with args System.String[], , ,  that has length 4
DEBUG: 00:00:00.1581754 In PowerShellGet Provider - 'Find-Package'.
DEBUG: 00:00:00.1608420 OPTION: Source => PSGallery
DEBUG: 00:00:00.1617162 OPTION: Name => Az.*
DEBUG: 00:00:00.1622067 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:00.1627009 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1632613 OPTION: Type => Module
DEBUG: 00:00:00.1660194 PackageProvider::FindPackage with name Az.*
DEBUG: 00:00:00.1713797 Calling 'NuGet'::'FindPackage' - name='Az.*', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:00.1726411 Iterating 'Az.*'.
DEBUG: 00:00:00.1732610 There are '4' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.1739048 Source 'https://www.powershellgallery.com/api/v2' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.1743882 Source 'https://www.powershellgallery.com/api/v2' is validated.
DEBUG: 00:00:00.1749062 Calling 'NuGetRequest'::'GetPackageById', 'Az.*'.
DEBUG: 00:00:00.1755297 Calling 'NuGetPackageRepository'::'FindPackagesById', 'Az.*'.
DEBUG: 00:00:00.1760849 Calling 'NuGetPackageFeed2'::'FindPackage', 'Az.*'.
DEBUG: 00:00:00.1767591 Calling 'NuGetClient'::'FindPackage'.
DEBUG: 00:00:00.1776101 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Az.*'&$skip=0&$top=40'.
DEBUG: 00:00:00.5105946 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Az.*'&$skip=0&$top=40'.
DEBUG: 00:00:00.5124299 '0' packages received in the last request.
DEBUG: 00:00:00.5141622 System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at Microsoft.PackageManagement.NuGetProvider.NuGetRequest.GetPackageById(PackageSource source, String name, NuGetRequest request, String requiredVersion, String minimumVersion, String maximumVersion, Boolean minInclusive, Boolean maxInclusive, Boolean isDependency)
DEBUG: 00:00:00.5166162 Completed iterating for 'Az.*'.
DEBUG: 00:00:00.5183250 Iterating 'Az.*'.
DEBUG: 00:00:00.5200584 There are '4' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.5217908 Source 'https://www.powershellgallery.com/api/v2' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.5230871 Source 'https://www.powershellgallery.com/api/v2' is validated.
DEBUG: 00:00:00.5243304 Calling 'NuGetRequest'::'SearchForPackages', 'Az.*'.
DEBUG: 00:00:00.5262016 Calling 'NuGetPackageRepository'::'Search'.
DEBUG: 00:00:00.5274759 Calling 'NuGetSearchFeed2'::'Search'.
DEBUG: 00:00:00.5288304 Calling 'NuGetSearchFeed2'::'Search'.
DEBUG: 00:00:00.5302224 Calling 'NuGetSearchFeed2'::'Search', 'Az.*'.
DEBUG: 00:00:00.5313112 Downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=0&$top=40'.
DEBUG: 00:00:00.8505686 Completed downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=0&$top=40'.
DEBUG: 00:00:00.8803556 Downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=160&$top=40'.
DEBUG: 00:00:00.8804744 Downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=40&$top=40'.
DEBUG: 00:00:00.8806299 Downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=120&$top=40'.
DEBUG: 00:00:00.8807951 Downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=80&$top=40'.
DEBUG: 00:00:01.1540687 Completed downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=160&$top=40'.
DEBUG: 00:00:01.1905291 '0' packages received in the last request.
DEBUG: 00:00:01.2550320 Completed downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=120&$top=40'.
DEBUG: 00:00:01.2559254 '1' packages received in the last request.
DEBUG: 00:00:01.4524235 Completed downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=80&$top=40'.
DEBUG: 00:00:01.4583674 Completed downloading 'https://www.powershellgallery.com/api/v2/Search()?$filter=IsLatestVersion&searchTerm='Az.*'&targetFramework=''&includePrerelease=false&$skip=40&$top=40'.
DEBUG: 00:00:02.0101105 Completed iterating for 'Az.*'.
DEBUG: 00:00:02.0338586 Done calling powershell «Find-Package» «PSModule»
DEBUG: 00:00:00 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0000186 Name: PSGallery
DEBUG: 00:00:00.0000294 Verbose: False
DEBUG: 00:00:00.0000398 ErrorVariable: ev
DEBUG: 00:00:00.0033158 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0087298 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0096904 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.0151047 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0240401 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0240552 Name: PSGallery
DEBUG: 00:00:00.0240655 Verbose: False
DEBUG: 00:00:00.0240750 ErrorVariable: ev
DEBUG: 00:00:00.0270060 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0322386 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0386956 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0504611 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0504779 Name: PSGallery
DEBUG: 00:00:00.0504886 Verbose: False
DEBUG: 00:00:00.0504982 ErrorVariable: ev
DEBUG: 00:00:00.0536824 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0590610 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0651679 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0826841 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0833825 ProviderName: PowerShellGet
DEBUG: 00:00:00.0839980 Name: PSGallery
DEBUG: 00:00:00.0847322 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.0857226 Verbose: False
DEBUG: 00:00:00.0862325 ErrorVariable: ev
DEBUG: 00:00:00.0896230 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0952791 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0964098 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.1023886 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.1117349 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.1126596 ProviderName: PowerShellGet
DEBUG: 00:00:00.1131916 Name: PSGallery
DEBUG: 00:00:00.1136836 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1142256 Verbose: False
DEBUG: 00:00:00.1165524 ErrorVariable: ev
DEBUG: 00:00:00.1201711 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.1256268 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.1269950 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.1344969 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0000001 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.0000168 Source: PSGallery
DEBUG: 00:00:00.0000270 Name: Az.Accounts
DEBUG: 00:00:00.0032082 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.0084277 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.0092523 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.0147021 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.0236875 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0237021 Source: PSGallery
DEBUG: 00:00:00.0237122 Name: Az.Accounts
DEBUG: 00:00:00.0266227 INVOKING PowerShell Fn Get-DynamicOptions with args Provider that has length 1
DEBUG: 00:00:00.0318846 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0398756 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0491445 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0491592 Source: PSGallery
DEBUG: 00:00:00.0491696 Name: Az.Accounts
DEBUG: 00:00:00.0521008 INVOKING PowerShell Fn Get-DynamicOptions with args Source that has length 1
DEBUG: 00:00:00.0573166 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0633451 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0722918 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0723067 Source: PSGallery
DEBUG: 00:00:00.0723168 Name: Az.Accounts
DEBUG: 00:00:00.0752738 INVOKING PowerShell Fn Get-DynamicOptions with args Package that has length 1
DEBUG: 00:00:00.0807523 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.0875206 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.0967078 Calling New() : MethodName = 'GetDynamicOptions'
DEBUG: 00:00:00.0967234 Source: PSGallery
DEBUG: 00:00:00.0967335 Name: Az.Accounts
DEBUG: 00:00:00.0997232 INVOKING PowerShell Fn Get-DynamicOptions with args Install that has length 1
DEBUG: 00:00:00.1048935 In PowerShellGet Provider - 'Get-DynamicOptions'.
DEBUG: 00:00:00.1118400 Done calling powershell «Get-DynamicOptions» «PSModule»
DEBUG: 00:00:00.1372132 Calling New() : MethodName = 'ResolvePackageSources'
DEBUG: 00:00:00.1380024 AllowClobber: True
DEBUG: 00:00:00.1384674 Scope: CurrentUser
DEBUG: 00:00:00.1389443 Name: Az.Accounts
DEBUG: 00:00:00.1394294 Source: PSGallery
DEBUG: 00:00:00.1399241 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1405992 Type: Module
DEBUG: 00:00:00.1410711 ProviderName: PowerShellGet
DEBUG: 00:00:00.1415516 SkipPublisherCheck: False
DEBUG: 00:00:00.1453478 INVOKING PowerShell Fn Resolve-PackageSource with args  that has length 0
DEBUG: 00:00:00.1505197 In PowerShellGet Provider - 'Resolve-PackageSource'.
DEBUG: 00:00:00.1517654 Yielding package source for PSGallery at location https://www.powershellgallery.com/api/v2
DEBUG: 00:00:00.1580173 Done calling powershell «Resolve-PackageSource» «PSModule»
DEBUG: 00:00:00.1581924 Calling SearchForPackages. Name='Az.Accounts'
DEBUG: 00:00:00.1615080 PackageProvider::FindPackage with name Az.Accounts
DEBUG: 00:00:00.1670746 Calling SearchForPackages After Select 1
DEBUG: 00:00:00.1687752 Calling New() : MethodName = 'FindPackage'
DEBUG: 00:00:00.1694341 AllowClobber: True
DEBUG: 00:00:00.1699202 Scope: CurrentUser
DEBUG: 00:00:00.1704212 Name: Az.Accounts
DEBUG: 00:00:00.1709518 Source: PSGallery
DEBUG: 00:00:00.1714109 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1719053 Type: Module
DEBUG: 00:00:00.1724149 ProviderName: PowerShellGet
DEBUG: 00:00:00.1733734 SkipPublisherCheck: False
DEBUG: 00:00:00.1771278 INVOKING PowerShell Fn Find-Package with args System.String[], , ,  that has length 4
DEBUG: 00:00:00.1824519 In PowerShellGet Provider - 'Find-Package'.
DEBUG: 00:00:00.1833099 OPTION: AllowClobber => True
DEBUG: 00:00:00.1837916 OPTION: Scope => CurrentUser
DEBUG: 00:00:00.1843336 OPTION: Name => Az.Accounts
DEBUG: 00:00:00.1848662 OPTION: Source => PSGallery
DEBUG: 00:00:00.1854186 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:00.1859386 OPTION: Type => Module
DEBUG: 00:00:00.1867228 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:00.1874814 OPTION: SkipPublisherCheck => False
DEBUG: 00:00:00.1905114 PackageProvider::FindPackage with name Az.Accounts
DEBUG: 00:00:00.1981062 Calling 'NuGet'::'FindPackage' - name='Az.Accounts', requiredVersion='',minimumVersion='', maximumVersion='''.
DEBUG: 00:00:00.1990128 Iterating 'Az.Accounts'.
DEBUG: 00:00:00.1997031 There are '4' registered sources in 'NuGet' provider.
DEBUG: 00:00:00.2002224 Source 'https://www.powershellgallery.com/api/v2' is not one of the registered sources in 'NuGet' provider.
DEBUG: 00:00:00.2007766 Source 'https://www.powershellgallery.com/api/v2' is validated.
DEBUG: 00:00:00.2013369 Calling 'NuGetRequest'::'GetPackageById', 'Az.Accounts'.
DEBUG: 00:00:00.2019892 Calling 'NuGetPackageRepository'::'FindPackagesById', 'Az.Accounts'.
DEBUG: 00:00:00.2025573 Calling 'NuGetPackageFeed2'::'FindPackage', 'Az.Accounts'.
DEBUG: 00:00:00.2031471 Calling 'NuGetClient'::'FindPackage'.
DEBUG: 00:00:00.2042327 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Az.Accounts'&$skip=0&$top=40'.
DEBUG: 00:00:00.9178437 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Az.Accounts'&$skip=0&$top=40'.
DEBUG: 00:00:00.9202051 '34' packages received in the last request.
DEBUG: 00:00:00.9211463 Downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Az.Accounts'&$skip=0&$top=40'.
DEBUG: 00:00:01.1640068 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Az.Accounts'&$skip=0&$top=40'.
DEBUG: 00:00:01.1739279 '34' packages received in the last request.
DEBUG: 00:00:01.1821015 Completed iterating for 'Az.Accounts'.
DEBUG: 00:00:01.2180486 Done calling powershell «Find-Package» «PSModule»
DEBUG: 00:00:01.2494584 Calling New() : MethodName = 'GetInstalledPackages'
DEBUG: 00:00:01.2505269 AllowClobber: True
DEBUG: 00:00:01.2511903 Scope: CurrentUser
DEBUG: 00:00:01.2521291 Name: Az.Accounts
DEBUG: 00:00:01.2528369 Source: PSGallery
DEBUG: 00:00:01.2533463 MessageResolver: Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:01.2538614 Type: Module
DEBUG: 00:00:01.2543840 ProviderName: PowerShellGet
DEBUG: 00:00:01.2548647 SkipPublisherCheck: False
DEBUG: 00:00:01.2590190 INVOKING PowerShell Fn Get-InstalledPackage with args Az.Accounts, 1.9.4, ,  that has length 4
DEBUG: 00:00:01.2655510 In PowerShellGet Provider - 'Get-InstalledPackage'.
DEBUG: 00:00:01.2662277 OPTION: AllowClobber => True
DEBUG: 00:00:01.2666511 OPTION: Scope => CurrentUser
DEBUG: 00:00:01.2670622 OPTION: Name => Az.Accounts
DEBUG: 00:00:01.2676595 OPTION: Source => PSGallery
DEBUG: 00:00:01.2681895 OPTION: MessageResolver => Microsoft.PowerShell.PackageManagement.Cmdlets.GetMessageString
DEBUG: 00:00:01.2686815 OPTION: Type => Module
DEBUG: 00:00:01.2694584 OPTION: ProviderName => PowerShellGet
DEBUG: 00:00:01.2699697 OPTION: SkipPublisherCheck => False
DEBUG: 00:00:03.2644640 Done calling powershell «Get-InstalledPackage» «PSModule»
DEBUG: Install Az.Resources 4.0.2-preview
Wait-Job: D:\OneDrive\Documents\PowerShell\Modules\Az.Tools.Installer\0.1.0\exports\Install-AzModule.ps1:288
Line |
 288 |          $null = Get-Job | Wait-Job
     |                            ~~~~~~~~
     | The Wait-Job cmdlet cannot finish working, because one or more jobs are blocked waiting for user interaction.  Process interactive job output by using the Receive-Job
     | cmdlet, and then try again.

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you
want to install the modules from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "N"):
markcowl commented 4 years ago

@brwilkinson Looks like we need to suppress the prompt when calling the underlying Install-Modulle cmdlet.

brwilkinson commented 4 years ago

@markcowl yes hopefully -force can be passes straight through.

brwilkinson commented 4 years ago

@markcowl One other question, is the module using start-job for the background jobs or start-threadjob ?

I might be worth leveraging the threadjobs since it's move efficient overall.

dcaro commented 4 years ago

@msJinLei @VeryEarly can you have a look?

VeryEarly commented 4 years ago

Hi @brwilkinson ,

This tool is built on top of PowershellGet (Packagemanagement), applying "-Force" parameter to them while running multi-task makes the performance terrible.

There is a certain bug though this cmdlet should not execute when the given repository was not trusted. Will do the fix in later release.

brwilkinson commented 4 years ago

@VeryEarly okay, what do you recommend to perform the install then ?

i.e. the public psgallery is untrusted for a reason, I am not going to just trust it .. so I would like to just override the default when I explicitly want to install a particular module.

So was the expectation that I should Trust PSGallery for these to work (without -Force) ?

VeryEarly commented 4 years ago

I'll say make PSGallery trusted is the solution.

The purpose of this module is to provide easy way to manage Az module, for particular module you can always use Install-Module (Install-AzModule also works though).

brwilkinson commented 4 years ago

@VeryEarly

I think we will need to come up with a better solution than making the public gallery trusted.

No one in the PowerShell community is going to buy into that (I don't believe).

I can ask on twitter, however I don't have many followers . . . however I am sure people would agree they are not going to make it trusted.

dcaro commented 4 years ago

@brwilkinson thanks for the feedback, the module is in preview and we will evaluate the options how to address this scenario in the best possible way. Unfortunately, for the time being, we do not have a better solution than trusting the PSGallery.

brwilkinson commented 4 years ago

quick question, if you evaluate the requirement to update any specific module, then run that update within a child job, can't you just pass the -Force in, since it's only targeting a single module ?

I think I understand why you prefer not to use force when install a suite of modules, since it would cause them all to install, however with just a single call for each, I don't think it would make any difference on efficiency ?

Sure @dcaro I understand, I am just offering some early feedback... I may test trusting the psgallery as a temporary (workaround) measure to find some more product issues with az.tools.installer, however I would switch it back when I am not testing.

brwilkinson commented 4 years ago

Here is the thread on Trusting the gallery, I don't have many followers, however Steve does... so quite a few replies

https://twitter.com/Steve_MSFT/status/1314448479851167746

VeryEarly commented 3 years ago

quick question, if you evaluate the requirement to update any specific module, then run that update within a child job, can't you just pass the -Force in, since it's only targeting a single module ?

I think I understand why you prefer not to use force when install a suite of modules, since it would cause them all to install, however with just a single call for each, I don't think it would make any difference on efficiency ?

Sure @dcaro I understand, I am just offering some early feedback... I may test trusting the psgallery as a temporary (workaround) measure to find some more product issues with az.tools.installer, however I would switch it back when I am not testing.

Hi @brwilkinson

Pass '-Force' to a single module should be OK, however the behavior could be inconsistent between install multiple/single. We are still working on a better design.

brwilkinson commented 3 years ago

@veryearly I think it was mentioned earlier in the thread, however just to add again. There are some changes with how -Force in implemented in PowerShellGet 3.0.0 <-- so it's likely worth aligning this toolset with new version of the module that is currently in preview. e.g. powershellget\Install-PSResource

brwilkinson commented 3 years ago

Not sure what happened with this functionality, I assume moving download to zip package, then extract was the fix for improving install efficiency.

Closing due to age.