Skip to content

Temporarily remove unimplemented DestintationPath parameter #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 8 additions & 24 deletions src/code/PublishPSResource.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.PowerShell.PowerShellGet.UtilClasses;
using MoreLinq;
using MoreLinq.Extensions;
using NuGet.Commands;
using NuGet.Common;
using NuGet.Configuration;
using NuGet.Packaging;
using NuGet.Versioning;
using System;
using System.Collections;
using System.Collections.Generic;
Expand All @@ -10,15 +18,6 @@
using System.Management.Automation.Language;
using System.Net.Http;
using System.Xml;
using Microsoft.PowerShell.PowerShellGet.UtilClasses;
using MoreLinq;
using MoreLinq.Extensions;
using NuGet.Commands;
using NuGet.Common;
using NuGet.Configuration;
using NuGet.Packaging;
using NuGet.Versioning;


namespace Microsoft.PowerShell.PowerShellGet.Cmdlets
{
Expand All @@ -45,21 +44,6 @@ public sealed class PublishPSResource : PSCmdlet
[ArgumentCompleter(typeof(RepositoryNameCompleter))]
public string Repository { get; set; }

/// <summary>
/// Can be used to publish a nupkg locally.
/// </summary>
[Parameter()]
[ValidateNotNullOrEmpty]
public string DestinationPath
{
get
{ return _destinationPath; }

set
{ _destinationPath = SessionState.Path.GetResolvedPSPathFromPSPath(value).First().Path; }
}
private string _destinationPath;

/// <summary>
/// Specifies the path to the resource that you want to publish. This parameter accepts the path to the folder that contains the resource.
/// Specifies a path to one or more locations. Wildcards are permitted. The default location is the current directory (.).
Expand Down
10 changes: 0 additions & 10 deletions test/PublishPSResource.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,6 @@ Describe "Test Publish-PSResource" {
(Get-ChildItem $script:repositoryPath2).FullName | Should -Be $expectedPath
}

It "Publish a module with -Path and -DestinationPath" {
$version = "1.0.0"
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module"

Publish-PSResource -Path $script:PublishModuleBase -DestinationPath $script:destinationPath

$expectedPath = Join-Path -Path $script:repositoryPath -ChildPath "$script:PublishModuleName.$version.nupkg"
(Get-ChildItem $script:repositoryPath).FullName | Should -Be $expectedPath
}

It "Publish a module with -LiteralPath" {
$version = "1.0.0"
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module"
Expand Down