Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Thank you so much for the review! I'll get back to fix the tests tomorrow morning.

Co-Authored-By: Howard Wolosky <HowardWolosky@users.noreply.github.com>
  • Loading branch information
jpomfret and HowardWolosky authored Apr 28, 2020
1 parent 9ad026b commit cd52756
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions GitHubProjects.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ function Get-GitHubProject
[ValidateSet('Open', 'Closed', 'All')]
[string] $State,

[Parameter()]
[string] $AccessToken,

[Parameter()]
[switch] $NoStatus
)

Expand All @@ -131,7 +129,6 @@ function Get-GitHubProject
$description = [String]::Empty
if ($PSCmdlet.ParameterSetName -eq 'Project')
{

$telemetryProperties['Project'] = $Project

$uriFragment = "/projects/$Project"
Expand All @@ -153,15 +150,13 @@ function Get-GitHubProject
}
elseif ($PSCmdlet.ParameterSetName -eq 'Organization')
{

$telemetryProperties['OrganizationName'] = Get-PiiSafeString -PlainText $OrganizationName

$uriFragment = "/orgs/$OrganizationName/projects"
$description = "Getting projects for $OrganizationName"
}
elseif ($PSCmdlet.ParameterSetName -eq 'User')
{

$telemetryProperties['UserName'] = Get-PiiSafeString -PlainText $UserName

$uriFragment = "/users/$UserName/projects"
Expand Down Expand Up @@ -195,7 +190,7 @@ function Get-GitHubProject
'AcceptHeader' = 'application/vnd.github.inertia-preview+json'
}

$results = Invoke-GHRestMethod @params
$results = Invoke-GHRestMethodMultipleResult @params

if ($PSBoundParameters.ContainsKey('Name'))
{
Expand Down Expand Up @@ -266,7 +261,7 @@ function New-GitHubProject
Create a project for the Microsoft\PowerShellForGitHub repository using the Uri called 'TestProject'.
.EXAMPLE
New-GitHubProject -UserProject -Name TestProject'
New-GitHubProject -UserProject -Name 'TestProject'
Creates a project for the signed in user called 'TestProject'.
Expand Down Expand Up @@ -326,15 +321,13 @@ function New-GitHubProject
}
elseif ($PSCmdlet.ParameterSetName -eq 'Organization')
{

$telemetryProperties['OrganizationName'] = Get-PiiSafeString -PlainText $OrganizationName

$uriFragment = "/orgs/$OrganizationName/projects"
$apiDescription = "Creating project for $OrganizationName"
}
elseif ($PSCmdlet.ParameterSetName -eq 'User')
{

$telemetryProperties['User'] = $true

$uriFragment = "/user/projects"
Expand Down Expand Up @@ -448,8 +441,7 @@ function Set-GitHubProject
#>
[CmdletBinding(
SupportsShouldProcess,
DefaultParameterSetName = 'Elements'
)]
DefaultParameterSetName = 'Elements')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", "", Justification = "Methods called within here make use of PSShouldProcess, and the switch is passed on to them inherently.")]
param(
[Parameter(Mandatory, ParameterSetName = 'Elements')]
Expand Down Expand Up @@ -493,6 +485,7 @@ function Set-GitHubProject
[Parameter()]
[switch] $NoStatus
)

Write-InvocationLog

$telemetryProperties = @{}
Expand Down

0 comments on commit cd52756

Please sign in to comment.