Skip to content

Commit

Permalink
Sync tools folder from main branch to generation branch (#25326)
Browse files Browse the repository at this point in the history
Co-authored-by: azurepowershell <[email protected]>
  • Loading branch information
azure-powershell-bot and azurepowershell authored Jun 25, 2024
1 parent 78bf4a8 commit 10b4466
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/live-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ parameters:
- name: os_linux
displayName: Linux Image Version
type: string
default: ubuntu-20.04
default: ubuntu-latest
- name: os_macos
displayName: MacOS Image Version
type: string
default: macOS-11
default: macOS-latest
- name: win_ps_5_1
displayName: Windows PowerShell 5.1 Version
type: string
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/powershell-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ variables:
LinuxAgentPoolVMImage: ''
MacOSName: macOS
MacOSAgentPoolName: 'Azure Pipelines'
MacOSAgentPoolVMImage: macOS-11
MacOSAgentPoolVMImage: macOS-latest
TestFramework: net6.0
TestTarget: Test
Configuration: Debug
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ variables:
linuxAgentPoolName: pool-ubuntu-2004
linuxAgentPoolVMImage: ''
macOsAgentPoolName: Azure Pipelines
macOsAgentPoolVMImage: macOS-11
macOsAgentPoolVMImage: macOS-latest

pr: none
trigger: none
Expand Down
Binary file modified src/lib/netstandard2.0/Azure.Core.dll
Binary file not shown.
Binary file modified src/lib/netstandard2.0/Azure.Identity.dll
Binary file not shown.
Binary file modified src/lib/netstandard2.0/Microsoft.Identity.Client.Broker.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified src/lib/netstandard2.0/Microsoft.Identity.Client.dll
Binary file not shown.
Binary file modified src/lib/netstandard2.0/msalruntime.dll
Binary file not shown.
Binary file modified src/lib/netstandard2.0/msalruntime_arm64.dll
Binary file not shown.
Binary file modified src/lib/netstandard2.0/msalruntime_x86.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/Common.Netcore.Dependencies.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.Core" Version="1.38.0"/>
<PackageReference Include="Azure.Core" Version="1.40.0"/>
</ItemGroup>
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.18.0">
Expand Down
11 changes: 8 additions & 3 deletions tools/TestFx/EnvironmentSetupHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,14 @@ public virtual Collection<PSObject> RunPowerShellTest(params string[] scripts)
output = powershell.Invoke();
watch.Stop();

var resultFormatting = watch.ElapsedMilliseconds < 5000 ? "##[section]" : "##[warning]";

Console.WriteLine($"{resultFormatting}Test {testName} completed in {watch.ElapsedMilliseconds}ms");
if (watch.ElapsedMilliseconds < 5000)
{
Console.WriteLine($"INFO : Test {testName} completed in {watch.ElapsedMilliseconds}ms");
}
else
{
Console.WriteLine($"##[warning]WARNING : Test {testName} completed in {watch.ElapsedMilliseconds}ms");
}

if (powershell.Streams.Error.Count > 0)
{
Expand Down
48 changes: 39 additions & 9 deletions tools/TestFx/Utilities/CommonUtility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,49 @@ function RemovePreInstalledModule {
[CmdletBinding()]
param(
[Parameter(Mandatory, Position = 0)]
[Alias("ModuleName")]
[ValidateNotNullOrEmpty()]
[string] $Name
[hashtable] $ModuleToRemove
)

# Remove Az modules
Get-Module -Name $Name* -ListAvailable | ForEach-Object {
$moduleDirectory = $_.Path | Split-Path | Split-Path
if (Test-Path -LiteralPath $moduleDirectory) {
Remove-Item -LiteralPath $moduleDirectory -Recurse -Force
$ModuleToRemove.Keys | ForEach-Object {
$moduleName = $_
$moduleVersion = $ModuleToRemove[$moduleName]

Write-Host "##[group]Processing module $moduleName"

Write-Host "All installed modules with name $moduleName :"
Get-Module -Name $moduleName -ListAvailable
Write-Host

$modules = Get-Module -Name $moduleName -ListAvailable | Where-Object Version -gt ([Version]$moduleVersion)
$modules | ForEach-Object {
$installedModule = $_
$installedModuleName = $installedModule.Name

Write-Host "##[section]Unqualified pre-installed module is $installedModuleName with version $($installedModule.Version)."
$installedModule | Format-List

$moduleDirectory = $installedModule.Path | Split-Path | Split-Path
if (Test-Path -Path $moduleDirectory) {
Write-Host "##[section]Start to remove module located in $moduleDirectory."
Remove-Item -Path $moduleDirectory -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "##[section]Module $installedModuleName has been removed."
Write-Host
}
}

Write-Host "##[endgroup]"
Write-Host
}
}

RemovePreInstalledModule -Name Az
RemovePreInstalledModule -Name AzureRM
$modulesToRemove = @{
"Az" = "0.0.0.0";
"Az.*" = "0.0.0.0";
"Azure" = "0.0.0.0";
"Azure.*" = "0.0.0.0";
"AzureRM" = "0.0.0.0";
"AzureRM.*" = "0.0.0.0";
"Pester" = "4.10.1.0"
}
RemovePreInstalledModule -ModuleToRemove $modulesToRemove

0 comments on commit 10b4466

Please sign in to comment.