From 22bd3560dfc64be6e763142be839fce4e5064577 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 11 Feb 2025 09:28:14 -0500 Subject: [PATCH] clean up comments --- .../Tools/GitHub/Invoke-ExecGitHubAction.ps1 | 2 +- .../Public/GitHub/Get-GitHubFileContents.ps1 | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tools/GitHub/Invoke-ExecGitHubAction.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tools/GitHub/Invoke-ExecGitHubAction.ps1 index c84bd7d91ab7..cf0d810d921a 100644 --- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tools/GitHub/Invoke-ExecGitHubAction.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tools/GitHub/Invoke-ExecGitHubAction.ps1 @@ -22,7 +22,7 @@ function Invoke-ExecGitHubAction { $SplatParams = $Parameters | Select-Object -ExcludeProperty Action, TenantFilter | ConvertTo-Json | ConvertFrom-Json -AsHashtable - Write-Information ($SplatParams | ConvertTo-Json) + #Write-Information ($SplatParams | ConvertTo-Json) switch ($Action) { 'Search' { diff --git a/Modules/CippExtensions/Public/GitHub/Get-GitHubFileContents.ps1 b/Modules/CippExtensions/Public/GitHub/Get-GitHubFileContents.ps1 index aee61b0c69f0..684bf99927ba 100644 --- a/Modules/CippExtensions/Public/GitHub/Get-GitHubFileContents.ps1 +++ b/Modules/CippExtensions/Public/GitHub/Get-GitHubFileContents.ps1 @@ -1,14 +1,20 @@ function Get-GitHubFileContents { [CmdletBinding()] param ( - [Parameter(ValueFromPipelineByPropertyName = $true)] - $Url + [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] + $FullName, + + [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] + $Path, + + [Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] + $Branch ) process { - [uri]$Uri = $Url - $Path = $Uri.PathAndQuery.TrimStart('/') - $File = Invoke-GitHubApiRequest -Path "$Path" -Method GET + $Path = "repos/$($FullName)/contents/$($Path)?ref=$($Branch)" + #Write-Information $Path + $File = Invoke-GitHubApiRequest -Path $Path -Method GET return [PSCustomObject]@{ name = $File.name