Skip to content
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

Rewrite Get-ChocolateyPath cmdlet #3646

Open
wants to merge 2 commits into
base: feature/cmdlets
Choose a base branch
from

Conversation

vexx32
Copy link
Member

@vexx32 vexx32 commented Mar 3, 2025

Description Of Changes

  • Replace Get-ChocolateyPath function with C# cmdlet
  • Add tests to verify the expected behaviour of the function

Motivation and Context

See #3477

Testing

  • Run Invoke-Tests.ps1 -Tag GetChocolateyPath

Operating Systems Testing

Windows 11

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation. - see (#1074) Add docs for Get-ChocolateyPath docs#1152
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

Part of #3477

Docs PR: chocolatey/docs#1152

@vexx32 vexx32 requested review from gep13 and corbob March 3, 2025 21:05
vexx32 added 2 commits March 10, 2025 16:27
Rewrite of the Get-ChocolateyPath into C# cmdlet, and associated
changes to helper methods.
@vexx32 vexx32 force-pushed the get-chocolateypath branch from 557de2c to 69703d8 Compare March 10, 2025 20:27
@vexx32 vexx32 marked this pull request as ready for review March 10, 2025 21:51
Copy link
Member

@corbob corbob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor things.

@@ -0,0 +1,12 @@
using System;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
using System;
// Copyright © 2017 - 2025 Chocolatey Software, Inc
// Copyright © 2011 - 2017 RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using System;

Comment on lines +7 to +11
public enum ChocolateyPathType
{
PackagePath,
InstallPath,
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have the xml help comments?

@@ -0,0 +1,73 @@
using Chocolatey.PowerShell;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
using Chocolatey.PowerShell;
// Copyright © 2017 - 2025 Chocolatey Software, Inc
// Copyright © 2011 - 2017 RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using Chocolatey.PowerShell;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants