From 471e6ba4ffd51756b53790e6fbc2f4e46bb196ee Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Mon, 2 Aug 2021 11:02:22 -0700 Subject: [PATCH] Temporarily remove unimplemented DestintationPath parameter --- src/code/PublishPSResource.cs | 32 ++++++++------------------------ test/PublishPSResource.Tests.ps1 | 10 ---------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/src/code/PublishPSResource.cs b/src/code/PublishPSResource.cs index 5afc9ed62..0fb371bff 100644 --- a/src/code/PublishPSResource.cs +++ b/src/code/PublishPSResource.cs @@ -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; @@ -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 { @@ -45,21 +44,6 @@ public sealed class PublishPSResource : PSCmdlet [ArgumentCompleter(typeof(RepositoryNameCompleter))] public string Repository { get; set; } - /// - /// Can be used to publish a nupkg locally. - /// - [Parameter()] - [ValidateNotNullOrEmpty] - public string DestinationPath - { - get - { return _destinationPath; } - - set - { _destinationPath = SessionState.Path.GetResolvedPSPathFromPSPath(value).First().Path; } - } - private string _destinationPath; - /// /// 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 (.). diff --git a/test/PublishPSResource.Tests.ps1 b/test/PublishPSResource.Tests.ps1 index 0ed7016cb..2a49a1799 100644 --- a/test/PublishPSResource.Tests.ps1 +++ b/test/PublishPSResource.Tests.ps1 @@ -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"