diff --git a/assets/icon.png b/assets/icon.png index e8a8a00..c2aec7b 100644 Binary files a/assets/icon.png and b/assets/icon.png differ diff --git a/src/GitlabCli/GitlabCli.psd1 b/src/GitlabCli/GitlabCli.psd1 index 3e46731..cb31a69 100644 --- a/src/GitlabCli/GitlabCli.psd1 +++ b/src/GitlabCli/GitlabCli.psd1 @@ -1,5 +1,5 @@ @{ - ModuleVersion = '1.115.1' + ModuleVersion = '1.116.0' RequiredModules = @('powershell-yaml') @@ -27,8 +27,7 @@ ExternalModuleDependencies = @('powershell-yaml') ReleaseNotes = @' -* https://github.com/chris-peterson/pwsh-gitlab/pull/91 -* https://github.com/chris-peterson/pwsh-gitlab/pull/92 +https://github.com/chris-peterson/pwsh-gitlab/issues/82 '@ } } @@ -138,6 +137,7 @@ 'Move-GitlabProject' 'New-GitlabProject' 'New-GitlabProjectHook' + 'Remove-GitlabProject' 'Remove-GitlabProjectHook' 'Remove-GitlabProjectVariable' 'Rename-GitlabProject' diff --git a/src/GitlabCli/Projects.psm1 b/src/GitlabCli/Projects.psm1 index 484715a..8fdf5f3 100644 --- a/src/GitlabCli/Projects.psm1 +++ b/src/GitlabCli/Projects.psm1 @@ -794,3 +794,24 @@ function Add-GitlabGroupToProject { } } } + +function Remove-GitlabProject { + [CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] + param ( + [Parameter(Position=0, Mandatory, ValueFromPipelineByPropertyName)] + [string] + $ProjectId, + + [Parameter()] + [string] + $SiteUrl + ) + + $Project = Get-GitlabProject -ProjectId $ProjectId + + if ($PSCmdlet.ShouldProcess("$($Project.PathWithNamespace)", "remove project")) { + # https://docs.gitlab.com/ee/api/projects.html#delete-project + Invoke-GitlabApi DELETE "projects/$($ProjectId)" -SiteUrl $SiteUrl | Out-Null + Write-Host "Removed $($Project.PathWithNamespace)" + } +}