Skip to content

Commit

Permalink
Add changes for 1.0.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
alerickson committed Mar 12, 2024
1 parent 9606c51 commit 1b2e0cc
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# CHANGELOG
## 1.0.3

### Bug Fixes
- Bug fix for null package version in `Install-PSResource`

## 1.0.2

### Bug Fixes
Expand Down
7 changes: 6 additions & 1 deletion src/Microsoft.PowerShell.PSResourceGet.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@{
RootModule = './Microsoft.PowerShell.PSResourceGet.dll'
NestedModules = @('./Microsoft.PowerShell.PSResourceGet.psm1')
ModuleVersion = '1.0.2'
ModuleVersion = '1.0.3'
CompatiblePSEditions = @('Core', 'Desktop')
GUID = 'e4e0bda1-0703-44a5-b70d-8fe704cd0643'
Author = 'Microsoft Corporation'
Expand Down Expand Up @@ -55,6 +55,11 @@
ProjectUri = 'https://go.microsoft.com/fwlink/?LinkId=828955'
LicenseUri = 'https://go.microsoft.com/fwlink/?LinkId=829061'
ReleaseNotes = @'
## 1.0.3
### Bug Fixes
- Bug fix for null package version in `Install-PSResource`
## 1.0.2
### Bug Fixes
Expand Down
4 changes: 4 additions & 0 deletions src/code/InstallHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,10 @@ private Hashtable BeginPackageInstall(

pkgToInstall.RepositorySourceLocation = repository.Uri.ToString();
pkgToInstall.AdditionalMetadata.TryGetValue("NormalizedVersion", out string pkgVersion);
if (pkgVersion == null)
{
pkgVersion = pkgToInstall.Version.ToString();
}

// Check to see if the pkg is already installed (ie the pkg is installed and the version satisfies the version range provided via param)
if (!_reinstall)
Expand Down
6 changes: 3 additions & 3 deletions src/code/Microsoft.PowerShell.PSResourceGet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.PowerShell.PSResourceGet</RootNamespace>
<AssemblyName>Microsoft.PowerShell.PSResourceGet</AssemblyName>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2</FileVersion>
<InformationalVersion>1.0.2</InformationalVersion>
<AssemblyVersion>1.0.3.0</AssemblyVersion>
<FileVersion>1.0.3</FileVersion>
<InformationalVersion>1.0.3</InformationalVersion>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
Expand Down
13 changes: 8 additions & 5 deletions src/code/V2ServerAPICalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,16 @@ public override Stream InstallPackage(string packageName, string packageVersion,
Stream results = new MemoryStream();
if (string.IsNullOrEmpty(packageVersion))
{
results = InstallName(packageName, out errRecord);
}
else
{
results = InstallVersion(packageName, packageVersion, out errRecord);
errRecord = new ErrorRecord(
exception: new ArgumentNullException($"Package version could not be found for {packageName}"),
"PackageVersionNullOrEmptyError",
ErrorCategory.InvalidArgument,
_cmdletPassedIn);

return results;
}

results = InstallVersion(packageName, packageVersion, out errRecord);
return results;
}

Expand Down
16 changes: 11 additions & 5 deletions src/code/V3ServerAPICalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ public override FindResults FindVersionWithTag(string packageName, string versio

/// <summary>
/// Installs a specific package.
/// 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"
/// Install "PowerShellGet" -Version "3.0.0"
Expand All @@ -295,13 +297,17 @@ public override Stream InstallPackage(string packageName, string packageVersion,
Stream results = new MemoryStream();
if (string.IsNullOrEmpty(packageVersion))
{
results = InstallName(packageName, out errRecord);
}
else
{
results = InstallVersion(packageName, packageVersion, out errRecord);
errRecord = new ErrorRecord(
exception: new ArgumentNullException($"Package version could not be found for {packageName}"),
"PackageVersionNullOrEmptyError",
ErrorCategory.InvalidArgument,
_cmdletPassedIn);

return results;
}

results = InstallVersion(packageName, packageVersion, out errRecord);

return results;
}

Expand Down

0 comments on commit 1b2e0cc

Please sign in to comment.