Skip to content

Commit

Permalink
Issue159 (#161)
Browse files Browse the repository at this point in the history
* Fixing issue 159.
Changed ExtendedInfo from hashtable to PSCustomObject.

* Added integration tests for Access control

* Updated version and change log
  • Loading branch information
DarqueWarrior authored May 16, 2019
1 parent bae1f60 commit d60854b
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .docs/Get-VSTeamAccessControlList.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

## EXAMPLES

### -------------------------- EXAMPLE 1 --------------------------

```PowerShell
Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList
```

## PARAMETERS

### -SecurityNamespace
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 6.2.3

Fixes issue [Get-VSTeamAccessControlList -IncludeExtendedInfo. Cannot convert value PSCustomObject to type Hashtable #159](https://github.com/DarqueWarrior/vsteam/issues/159)

## 6.2.2

Merged [Pull Request](https://github.com/DarqueWarrior/vsteam/pull/158) from [Ryan](https://github.com/RPhay) which included the following:
Expand Down
2 changes: 1 addition & 1 deletion Source/Classes/VSTeamAccessControlEntry.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class VSTeamAccessControlEntry : VSTeamLeaf {
[string]$Descriptor = $null
[int]$Allow = 0
[int]$Deny = 0
[hashtable]$ExtendedInfo = @{}
[PSCustomObject]$ExtendedInfo = @{}

VSTeamAccessControlEntry (
[object]$obj
Expand Down
3 changes: 2 additions & 1 deletion Source/Public/Get-VSTeamAccessControlList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ function Get-VSTeamAccessControlList {
[Parameter(ParameterSetName = 'ByNamespace', Mandatory = $true, ValueFromPipeline = $true)]
[VSTeamSecurityNamespace] $SecurityNamespace,

[Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true)]
[Parameter(ParameterSetName = 'ByNamespaceId', Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[Alias('ID')]
[ValidateScript({
try {
[System.Guid]::Parse($_) | Out-Null
Expand Down
2 changes: 1 addition & 1 deletion Source/VSTeam.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'VSTeam.psm1'

# Version number of this module.
ModuleVersion = '6.2.2'
ModuleVersion = '6.2.3'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
12 changes: 12 additions & 0 deletions integration/test/010_projects.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,18 @@ InModuleScope VSTeam {
}
}

# Not supported on TFS
if (-not ($acct -like "http://*")) {
Context 'Access control list' {
It 'Get-VSTeamAccessControlList should return without error' {
$(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList) | Should Not Be $null
}

It 'Get-VSTeamAccessControlList -IncludeExtendedInfo should return without error' {
$(Get-VSTeamSecurityNamespace | Select-Object -First 1 | Get-VSTeamAccessControlList -IncludeExtendedInfo) | Should Not Be $null
}
}
}

Context 'Teams full exercise' {
It 'Get-VSTeam ByName Should return Teams' {
Expand Down
4 changes: 2 additions & 2 deletions unit/test/accessControlList.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ InModuleScope VSTeam {
[VSTeamVersions]::Account = 'https://dev.azure.com/test'

$accessControlListResult =
@"
@"
{
"count": 5,
"value": [
Expand Down Expand Up @@ -96,7 +96,7 @@ InModuleScope VSTeam {
"@ | ConvertFrom-Json

$securityNamespace =
@"
@"
{
"count": 1,
"value": [
Expand Down

0 comments on commit d60854b

Please sign in to comment.