remove non-canonical cmdlets in tools/AzureRM.Example.psm1, use formal cmdlet instead

This commit is contained in:
Yabo Hu 2019-10-11 10:57:45 +08:00
Родитель 4c70ac849a
Коммит b147b659f6
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -13,7 +13,7 @@ function Test-DotNet
{
try
{
if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where { $_ -ge 461808 })))
if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where-Object { $_ -ge 461808 })))
{
throw ".NET Framework versions lower than 4.7.2 are not supported in Az. Please upgrade to .NET Framework 4.7.2 or higher."
}
@ -66,7 +66,7 @@ if($PSEdition -eq 'Core' -and (Test-Path $netCorePath -ErrorAction Ignore))
{
try
{
$loadedAssemblies = ([System.AppDomain]::CurrentDomain.GetAssemblies() | %{New-Object -TypeName System.Reflection.AssemblyName -ArgumentList $_.FullName} )
$loadedAssemblies = ([System.AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object {New-Object -TypeName System.Reflection.AssemblyName -ArgumentList $_.FullName} )
Get-ChildItem -ErrorAction Stop -Path $netCorePath -Filter "*.dll" | ForEach-Object {
$assemblyName = ([System.Reflection.AssemblyName]::GetAssemblyName($_.FullName))
$matches = ($loadedAssemblies | Where-Object {$_.Name -eq $assemblyName.Name})