This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ConvertTo-CentralPackageManagement() { | |
Write-Host 'Searching for package references' | |
$packages = @{} | |
$conditionalPackages = @{} | |
foreach ($csproj in (Get-ChildItem -Include *.csproj, *.props -Recurse)) { | |
$root = [xml]($csproj | Get-Content -Raw) | |
foreach ($itemGroup in $root.Project.ItemGroup) { | |
foreach ($packageReference in $itemGroup.PackageReference) { | |
if ($packageReference.Include -and $packageReference.Version) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Logging; | |
using Moq; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
// More detailed samples here: | |
// https://github.com/MelbourneDeveloper/RestClient.Net/blob/79cca66e02f83a1043c44f215d374139f40f8c12/src/RestClient.Net.UnitTests/UnitTests.cs#L758 |