Skip to content

Commit

Permalink
Search-TssReportSchedule - Rename class, add format
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Jan 20, 2021
1 parent 2dd809f commit 77b2a6f
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 27 deletions.
53 changes: 53 additions & 0 deletions src/Thycotic.SecretServer.Format.ps1xml
Expand Up @@ -343,5 +343,58 @@
</TableControl>
</View>

<!-- Getting TssReportScheduleSummary -->
<View>
<Name>TssReportScheduleSummary</Name>
<ViewSelectedBy>
<TypeName>TssReportScheduleSummary</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
</TableColumnHeader>
<TableColumnHeader>
</TableColumnHeader>
<TableColumnHeader>
</TableColumnHeader>
<TableColumnHeader>
</TableColumnHeader>
<TableColumnHeader>
</TableColumnHeader>
<TableColumnHeader>
</TableColumnHeader>
<TableColumnHeader>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>ScheduleReportId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>LastRun</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ChangeType</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>StoredReportCount</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ReportId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ReportName</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>

</ViewDefinitions>
</Configuration>
@@ -1,4 +1,4 @@
class TssReportSchedule {
class TssReportScheduleSummary {
# Schedule change type
[ValidateSet('Daily','Weekly','Monthly')]
[string]$ChangeType
Expand Down
21 changes: 0 additions & 21 deletions src/en-us/about_tssreportschedule.help.txt

This file was deleted.

21 changes: 21 additions & 0 deletions src/en-us/about_tssreportschedulesummary.help.txt
@@ -0,0 +1,21 @@
TOPIC
This help topic describes the TssReportScheduleSummary class in the Thycotic.SecretServer module

CLASS
TssReportScheduleSummary

INHERITANCE
None

DESCRIPTION
The TssReportScheduleSummary class represents the ReportScheduleSummaryModel object returned by Secret Server endpoint /reports/schedules

CONSTRUCTORS
new()

PROPERTIES
Documented in the REST API doc for Secret Server, see ReportScheduleSummaryModel /reports/schedules
METHODS

RELATED LINKS:
Search-TssReportScheduleSummary
2 changes: 1 addition & 1 deletion src/functions/reports/Search-ReportSchedule.ps1
Expand Up @@ -67,7 +67,7 @@
Write-Warning "No report schedules found"
}
if ($restReponse.records) {
. $TssReportScheduleObject $restReponse.records
. $TssReportScheduleSummaryObject $restReponse.records
}
} else {
Write-Warning "No valid session found"
Expand Down
@@ -1,8 +1,8 @@
<#
.Synopsis
Creates a TssReportSchedule class in the Thycotic.SecretServer module.
Creates a TssReportScheduleSummary class in the Thycotic.SecretServer module.
.Description
Creates an instance of the TssReportSchedule class to output the ReportScheduleSummaryModel object
Creates an instance of the TssReportScheduleSummary class to output the ReportScheduleSummaryModel object
#>
param(
[pscustomobject]$Object
Expand All @@ -14,14 +14,14 @@ begin {

process {
foreach ($s in $Object) {
$outReportSched = [TssReportSchedule]::new()
$outReportSched = [TssReportScheduleSummary]::new()
foreach ($rsProp in $Properties) {
if ($rsProp -in $outReportSched.PSObject.Properties.Name) {
if ($s.$rsProp) {
$outReportSched.$rsProp = $s.$rsProp
}
} else {
Write-Warning "Property $rsProp does not exist in the TssReportSchedule class. Please create a bug report at https://github.com/thycotic-ps/thycotic.secretserver/issues/new/choose"
Write-Warning "Property $rsProp does not exist in the TssReportScheduleSummary class. Please create a bug report at https://github.com/thycotic-ps/thycotic.secretserver/issues/new/choose"
}
}
}
Expand Down

0 comments on commit 77b2a6f

Please sign in to comment.