Skip to content

Removing 1 of 2 named connections all connections are removed. #27

Description

@Showkilr

When removing 1 connection and there are only 2 connections within the configuration file the config file is removed.

Expected Behavior

The last remaining connections should be re-written to the config file

Current Behavior

when the connections count is 2 the file is just removed. if the connections count is > 2 then the removal works as expected

Possible Solution

Change the Line 73 in Remove-FreshServiceConnection.ps1

Current

if ($environments.Count -gt 0) {

NEW

if (($environment) -or ($environment.count -gt 0)) {

Steps to Reproduce (for bugs)

  1. New-FreshServiceConnection -Name "acme1" -ApiKey "acme1" -Tenant 'acme1' -Environment Sandbox
  2. New-FreshServiceConnection -Name "acme2" -ApiKey "acme2" -Tenant 'acme2' -Environment Sandbox
  3. Remove-FreshServiceConnection -Name "acme2"

Context

when preforming removal of the sandbox API connection you have to redefine the production connection. More of an Annoyance.

Your Environment

  • Module version used: 0.1.6
  • Operating System and PowerShell version:
    Windows 11 23H2
    PS Version 5.1.22621.4111

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions