Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get-TssFolderPermission - adding part script
- Loading branch information
Showing
3 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class TssFolderPermission { | ||
[int]$FolderAccessRoleId | ||
[int]$GroupId | ||
[int]$SecretAccessRole | ||
[int]$SecretAccessRoleId | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<# | ||
.Synopsis | ||
Creates a TssFolderPermission object | ||
#> | ||
param( | ||
[pscustomobject]$Object | ||
) | ||
|
||
begin { | ||
$Properties = $Object[0].PSObject.Properties.Name | ||
} | ||
|
||
process { | ||
$outObject = @() | ||
foreach ($f in $Object) { | ||
$currentObject = [TssFolderPermission]::new() | ||
foreach ($sProp in $Properties) { | ||
# until bug is fixed in endpoint | ||
if ($sProp -in 'Id','folderId','folderAccessRoleName','SecretAccessRoleName','groupName','userId','userName','knownAs') { | ||
continue | ||
} | ||
if ($sProp -in $currentObject.PSObject.Properties.Name) { | ||
$currentObject.$sProp = $f.$sProp | ||
} else { | ||
Write-Warning "Property $sProp does not exist in the TssFolderPermission class.bug report at https://github.com/thycotic-ps/thycotic.secretserver/issues/new/choose" | ||
} | ||
} | ||
$outObject += $currentObject | ||
} | ||
return $outObject | ||
} |