Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
8ef85a9
Add concurrent find and install
alerickson Dec 24, 2025
4e4741f
Use threadsafe types and add better use of _knownLatestPkgVersion
alerickson Dec 24, 2025
cb925dc
save before changes
alerickson Dec 27, 2025
5bf4ceb
Add async find and install calls
alerickson Jan 2, 2026
329eb39
Add async calls
alerickson Jan 21, 2026
d65e232
Change packagesHash and updatedPackagesHash to be thread safe Concurr…
alerickson Jan 23, 2026
321a38e
add error handling & clean up code
alerickson Feb 18, 2026
26f5168
Remove out ref errorRecord from async method
alerickson Feb 18, 2026
f04925b
fix error handling
alerickson Feb 18, 2026
80c2368
Merge branch 'master' of https://github.com/powershell/PSResourceGet …
alerickson Feb 18, 2026
5bcf88c
clean up
alerickson Feb 18, 2026
f83d929
temp comment out find local tests to debug CI
alerickson Feb 19, 2026
7ea4451
try commenting out default runspace
alerickson Feb 19, 2026
3df00b6
Bug fix and test update
alerickson Feb 22, 2026
c8bedb4
add bug fix for prerelease versions
alerickson Feb 26, 2026
8051a23
fix exception handling
alerickson Feb 26, 2026
26cf187
add debug and verbose logging to some tests
alerickson Feb 26, 2026
f53c7e3
add debug messages
alerickson Feb 26, 2026
6df8a2b
add more logging
alerickson Feb 27, 2026
5231d68
Add more CI logging
alerickson Mar 1, 2026
513b9aa
Add more logging
alerickson Mar 1, 2026
e2d31bb
add more logging
alerickson Mar 2, 2026
133a22e
add a lot more logging
alerickson Mar 2, 2026
0fef51e
try removing shouldprocess condition in installhelper
alerickson Mar 2, 2026
e43e194
Add more debug logging
alerickson Mar 3, 2026
ce20d1d
Fix TryReadPSDataFile()
alerickson Mar 3, 2026
c5b49fe
Comment out GH pkgs tests
alerickson Mar 3, 2026
acdf110
Bug fix for null exception when writing error
alerickson Mar 3, 2026
9289198
Update tests
alerickson Mar 3, 2026
8f05b25
Fix update test suite
alerickson Mar 3, 2026
7f24c34
Add flaky tests to Release run only
alerickson Mar 3, 2026
44045df
fix authenticode and update
alerickson Mar 6, 2026
89510c5
change errors to type concurrentbag
alerickson Mar 9, 2026
72233ee
add logging to test
alerickson Mar 10, 2026
4827475
change debug preference to continue
alerickson Mar 10, 2026
b0c8a10
Fix authenticode signature write objects
alerickson Mar 10, 2026
29abcc3
add warning to installhelper
alerickson Mar 10, 2026
e1a6c96
debug authenticode test
alerickson Mar 11, 2026
121615e
fix authenticode test
alerickson Mar 11, 2026
a8419e8
add verbose, debug and write to authenticode test
alerickson Mar 11, 2026
5377d0c
update test
alerickson Mar 11, 2026
bd1cd4b
change test
alerickson Mar 11, 2026
e3d2379
more test debuging
alerickson Mar 11, 2026
cfdb01c
more debugging
alerickson Mar 11, 2026
e706be2
remove some logs
alerickson Mar 11, 2026
b4b0bae
add confirm false to test
alerickson Mar 11, 2026
39062a9
add more logging
alerickson Mar 11, 2026
05c966b
MORE LOGS
alerickson Mar 11, 2026
820b411
add more logs
alerickson Mar 11, 2026
5ce9bbb
remove debug statements in concurrency
alerickson Mar 12, 2026
d1dc105
change processor count, revert TryReadPSDataFaile
alerickson Mar 12, 2026
46d4b72
Remove debug lines
alerickson Mar 12, 2026
416b947
remove more debug statements
alerickson Mar 12, 2026
bcb3460
code and test clean ups
alerickson Mar 19, 2026
5b866f1
More clean up
alerickson Mar 19, 2026
28e2cb1
More clean up
alerickson Mar 19, 2026
80c47ae
fix typo
alerickson Mar 19, 2026
3df3e2a
test updates, code clean up
alerickson Mar 19, 2026
5cc9d8d
code clean up
alerickson Mar 19, 2026
16e9822
Add ConcurrentQueue for writing output
alerickson Mar 26, 2026
4a90f13
build fixes
alerickson Mar 26, 2026
536aed5
Few changes
alerickson Mar 30, 2026
2683add
add error, warning, debug, and verbose queues to appropriate methods
alerickson Apr 1, 2026
09a63bb
Finish adding ConcurrentQueues for logging
alerickson Apr 2, 2026
7448809
debug 'Install resource with a dependency (should install both parent…
alerickson Apr 2, 2026
1ffd2a5
add debug/verbose for failing test
alerickson Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/code/ContainerRegistryServerAPICalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
Expand Down Expand Up @@ -81,6 +82,16 @@ public ContainerRegistryServerAPICalls(PSRepositoryInfo repository, PSCmdlet cmd

#region Overridden Methods

public override Task<FindResults> FindVersionAsync(string packageName, string version, ResourceType type, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs)
{
throw new NotImplementedException("FindVersionAsync is not implemented for ContainerRegistryServerAPICalls.");
}

public override Task<FindResults> FindVersionGlobbingAsync(string packageName, VersionRange versionRange, bool includePrerelease, ResourceType type, bool getOnlyLatest, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs)
{
throw new NotImplementedException("FindVersionGlobbingAsync is not implemented for ContainerRegistryServerAPICalls.");
}

/// <summary>
/// Find method which allows for searching for all packages from a repository and returns latest version for each.
/// </summary>
Expand Down Expand Up @@ -146,6 +157,12 @@ public override FindResults FindName(string packageName, bool includePrerelease,
return new FindResults(stringResponse: new string[] { }, hashtableResponse: pkgResult.ToArray(), responseType: containerRegistryFindResponseType);
}


public override Task<FindResults> FindNameAsync(string packageName, bool includePrerelease, ResourceType type, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs)
{
throw new NotImplementedException("FindNameAsync is not implemented for ContainerRegistryServerAPICalls.");
}

/// <summary>
/// Find method which allows for searching for single name and tag and returns latest version.
/// Name: no wildcard support
Expand Down Expand Up @@ -302,6 +319,19 @@ public override Stream InstallPackage(string packageName, string packageVersion,
return results;
}

/// <summary>
/// Installs a specific package asynchronously.
/// User may request to install package with or without providing version (as seen in examples below), but prior to calling this method the package is located and package version determined.
/// Therefore, package version should not be null in this method.
/// Name: no wildcard support.
/// Examples: Install "PowerShellGet" -Version "3.5.0-alpha"
/// Install "PowerShellGet" -Version "3.0.0"
/// </summary>
public override Task<Stream> InstallPackageAsync(string packageName, string packageVersion, bool includePrerelease, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs)
{
throw new NotImplementedException("FindNameAsync is not implemented for ContainerRegistryServerAPICalls.");
}

/// <summary>
/// Installs a package with version specified.
/// Version can be prerelease or stable.
Expand Down
620 changes: 393 additions & 227 deletions src/code/FindHelper.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/code/GetHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.PowerShell.PSResourceGet.UtilClasses;
Expand Down
412 changes: 251 additions & 161 deletions src/code/InstallHelper.cs

Large diffs are not rendered by default.

107 changes: 68 additions & 39 deletions src/code/LocalServerApiCalls.cs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions src/code/NuGetServerAPICalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Net;
using System.Runtime.ExceptionServices;
using System.Management.Automation;
using System.Collections.Concurrent;

namespace Microsoft.PowerShell.PSResourceGet.Cmdlets
{
Expand Down Expand Up @@ -48,6 +49,15 @@ public NuGetServerAPICalls (PSRepositoryInfo repository, PSCmdlet cmdletPassedIn

#region Overridden Methods

public override Task<FindResults> FindVersionAsync(string packageName, string version, ResourceType type, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs)
{
throw new NotImplementedException("FindVersionAsync is not implemented for NuGetServerAPICalls.");
}

public override Task<FindResults> FindVersionGlobbingAsync(string packageName, VersionRange versionRange, bool includePrerelease, ResourceType type, bool getOnlyLatest, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs)
{
throw new NotImplementedException("FindVersionGlobbingAsync is not implemented for NuGetServerAPICalls.");
}
/// <summary>
/// Find method which allows for searching for all packages from a repository and returns latest version for each.
/// Examples: Search -Repository MyNuGetServer
Expand Down Expand Up @@ -183,6 +193,11 @@ public override FindResults FindName(string packageName, bool includePrerelease,
return new FindResults(stringResponse: new string[]{ response }, hashtableResponse: emptyHashResponses, responseType: FindResponseType);
}

public override Task<FindResults> FindNameAsync(string packageName, bool includePrerelease, ResourceType type, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs)
{
throw new NotImplementedException("FindNameAsync is not implemented for NuGetServerAPICalls.");
}

/// <summary>
/// Find method which allows for searching for single name and tag and returns latest version.
/// Name: no wildcard support
Expand Down Expand Up @@ -446,6 +461,19 @@ public override Stream InstallPackage(string packageName, string packageVersion,
return results;
}

/// <summary>
/// Installs a specific package asynchronously.
/// User may request to install package with or without providing version (as seen in examples below), but prior to calling this method the package is located and package version determined.
/// Therefore, package version should not be null in this method.
/// Name: no wildcard support.
/// Examples: Install "PowerShellGet" -Version "3.5.0-alpha"
/// Install "PowerShellGet" -Version "3.0.0"
/// </summary>
public override Task<Stream> InstallPackageAsync(string packageName, string packageVersion, bool includePrerelease, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs)
{
throw new NotImplementedException("InstallPackageAsync is not implemented for NuGetServerAPICalls.");
}

/// <summary>
/// Helper method that makes the HTTP request for the NuGet server protocol url passed in for find APIs.
/// </summary>
Expand Down
39 changes: 39 additions & 0 deletions src/code/ServerApiCall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using System.Text;
using System.Runtime.ExceptionServices;
using System.Management.Automation;
using System.Threading.Tasks;
using System.Collections.Concurrent;

namespace Microsoft.PowerShell.PSResourceGet.Cmdlets
{
Expand Down Expand Up @@ -81,6 +83,13 @@ public ServerApiCall(PSRepositoryInfo repository, NetworkCredential networkCrede
/// </summary>
public abstract FindResults FindName(string packageName, bool includePrerelease, ResourceType type, out ErrorRecord errRecord);

/// <summary>
/// Find method which allows for async searching for package by single name and returns latest version.
/// Name: no wildcard support
/// Examples: Search "PowerShellGet"
/// </summary>
public abstract Task<FindResults> FindNameAsync(string packageName, bool includePrerelease, ResourceType type, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs);

/// <summary>
/// Find method which allows for searching for package by single name and tag and returns latest version.
/// Name: no wildcard support
Expand All @@ -95,6 +104,15 @@ public ServerApiCall(PSRepositoryInfo repository, NetworkCredential networkCrede
/// </summary>
public abstract FindResults FindNameGlobbing(string packageName, bool includePrerelease, ResourceType type, out ErrorRecord errRecord);

/// <summary>
/// Find method which allows for async searching for single name with version range.
/// Name: no wildcard support
/// Version: supports wildcards
/// Examples: Search "PowerShellGet" "[3.0.0.0, 5.0.0.0]"
/// Search "PowerShellGet" "3.*"
/// </summary>
public abstract Task<FindResults> FindVersionGlobbingAsync(string packageName, VersionRange versionRange, bool includePrerelease, ResourceType type, bool getOnlyLatest, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs);

/// <summary>
/// Find method which allows for searching for single name with wildcards and tag and returns latest version.
/// Name: supports wildcards
Expand All @@ -118,6 +136,14 @@ public ServerApiCall(PSRepositoryInfo repository, NetworkCredential networkCrede
/// </summary>
public abstract FindResults FindVersion(string packageName, string version, ResourceType type, out ErrorRecord errRecord);

/// <summary>
/// Find method which allows for async searching for single name with specific version.
/// Name: no wildcard support
/// Version: no wildcard support
/// Examples: Search "PowerShellGet" "2.2.5"
/// </summary>
public abstract Task<FindResults> FindVersionAsync(string packageName, string version, ResourceType type, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs);

/// <summary>
/// Find method which allows for searching for single name with specific version.
/// Name: no wildcard support
Expand All @@ -140,6 +166,19 @@ public ServerApiCall(PSRepositoryInfo repository, NetworkCredential networkCrede
/// </summary>
public abstract Stream InstallPackage(string packageName, string packageVersion, bool includePrerelease, out ErrorRecord errRecord);

/// <summary>
/// Installs specific package asynchronously.
/// Name: no wildcard support.
/// Examples: Install "PowerShellGet"
/// Install "PowerShellGet" -Version "3.0.0"
/// Install "PowerShellGet" -Version "3.0.0-beta24"
/// Implementation Note: if not prerelease: https://www.powershellgallery.com/api/v2/package/powershellget (Returns latest stable)
/// if prerelease, the calling method should first call IFindPSResource.FindName(),
/// then find the exact version to install, then call into install version
/// </summary>
public abstract Task<Stream> InstallPackageAsync(string packageName, string packageVersion, bool includePrerelease, ConcurrentQueue<ErrorRecord> errorMsgs, ConcurrentQueue<string> warningMsgs, ConcurrentQueue<string> debugMsgs, ConcurrentQueue<string> verboseMsgs);


#endregion

}
Expand Down
Loading
Loading