1010using System . Text ;
1111using System . Runtime . ExceptionServices ;
1212using System . Management . Automation ;
13+ using System . Threading . Tasks ;
14+ using System . Collections . Concurrent ;
1315
1416namespace Microsoft . PowerShell . PSResourceGet . Cmdlets
1517{
@@ -81,6 +83,13 @@ public ServerApiCall(PSRepositoryInfo repository, NetworkCredential networkCrede
8183 /// </summary>
8284 public abstract FindResults FindName ( string packageName , bool includePrerelease , ResourceType type , out ErrorRecord errRecord ) ;
8385
86+ /// <summary>
87+ /// Find method which allows for async searching for package by single name and returns latest version.
88+ /// Name: no wildcard support
89+ /// Examples: Search "PowerShellGet"
90+ /// </summary>
91+ public abstract Task < FindResults > FindNameAsync ( string packageName , bool includePrerelease , ResourceType type , ConcurrentQueue < ErrorRecord > errorMsgs , ConcurrentQueue < string > warningMsgs , ConcurrentQueue < string > debugMsgs , ConcurrentQueue < string > verboseMsgs ) ;
92+
8493 /// <summary>
8594 /// Find method which allows for searching for package by single name and tag and returns latest version.
8695 /// Name: no wildcard support
@@ -95,6 +104,15 @@ public ServerApiCall(PSRepositoryInfo repository, NetworkCredential networkCrede
95104 /// </summary>
96105 public abstract FindResults FindNameGlobbing ( string packageName , bool includePrerelease , ResourceType type , out ErrorRecord errRecord ) ;
97106
107+ /// <summary>
108+ /// Find method which allows for async searching for single name with version range.
109+ /// Name: no wildcard support
110+ /// Version: supports wildcards
111+ /// Examples: Search "PowerShellGet" "[3.0.0.0, 5.0.0.0]"
112+ /// Search "PowerShellGet" "3.*"
113+ /// </summary>
114+ 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 ) ;
115+
98116 /// <summary>
99117 /// Find method which allows for searching for single name with wildcards and tag and returns latest version.
100118 /// Name: supports wildcards
@@ -118,6 +136,14 @@ public ServerApiCall(PSRepositoryInfo repository, NetworkCredential networkCrede
118136 /// </summary>
119137 public abstract FindResults FindVersion ( string packageName , string version , ResourceType type , out ErrorRecord errRecord ) ;
120138
139+ /// <summary>
140+ /// Find method which allows for async searching for single name with specific version.
141+ /// Name: no wildcard support
142+ /// Version: no wildcard support
143+ /// Examples: Search "PowerShellGet" "2.2.5"
144+ /// </summary>
145+ public abstract Task < FindResults > FindVersionAsync ( string packageName , string version , ResourceType type , ConcurrentQueue < ErrorRecord > errorMsgs , ConcurrentQueue < string > warningMsgs , ConcurrentQueue < string > debugMsgs , ConcurrentQueue < string > verboseMsgs ) ;
146+
121147 /// <summary>
122148 /// Find method which allows for searching for single name with specific version.
123149 /// Name: no wildcard support
@@ -140,6 +166,19 @@ public ServerApiCall(PSRepositoryInfo repository, NetworkCredential networkCrede
140166 /// </summary>
141167 public abstract Stream InstallPackage ( string packageName , string packageVersion , bool includePrerelease , out ErrorRecord errRecord ) ;
142168
169+ /// <summary>
170+ /// Installs specific package asynchronously.
171+ /// Name: no wildcard support.
172+ /// Examples: Install "PowerShellGet"
173+ /// Install "PowerShellGet" -Version "3.0.0"
174+ /// Install "PowerShellGet" -Version "3.0.0-beta24"
175+ /// Implementation Note: if not prerelease: https://www.powershellgallery.com/api/v2/package/powershellget (Returns latest stable)
176+ /// if prerelease, the calling method should first call IFindPSResource.FindName(),
177+ /// then find the exact version to install, then call into install version
178+ /// </summary>
179+ public abstract Task < Stream > InstallPackageAsync ( string packageName , string packageVersion , bool includePrerelease , ConcurrentQueue < ErrorRecord > errorMsgs , ConcurrentQueue < string > warningMsgs , ConcurrentQueue < string > debugMsgs , ConcurrentQueue < string > verboseMsgs ) ;
180+
181+
143182 #endregion
144183
145184 }
0 commit comments