Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefajers authored Dec 2, 2024
1 parent e71d7a1 commit 1c65daa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
StartDateTime = $roleEligibilitySchedule.StartDateTime
}
}
$this.Id = $roleEligibilityScheduleRequest.Id
$this.Id = $roleEligibilitySchedule.RequestId
$this.Name = $roleEligibilitySchedule.Name
$this.ResourceType = $roleEligibilityScheduleRequest.Type
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
if ($roleEligibilitySchedules) {
foreach ($roleEligibilitySchedule in $roleEligibilitySchedules) {
# Process roleEligibilitySchedule together with RoleEligibilityScheduleRequest
$roleEligibilityScheduleRequest = $null
$roleEligibilityScheduleRequest = Get-AzRoleEligibilityScheduleRequest -Scope $ScopeObject.Scope -Name $roleEligibilitySchedule.Name -ErrorAction SilentlyContinue
if ($roleEligibilityScheduleRequest) {
Write-AzOpsMessage -LogLevel Debug -LogString 'Get-AzOpsRoleEligibilityScheduleRequest.Assignment' -LogStringValues $roleEligibilitySchedule.Name -Target $ScopeObject
# Construct AzOpsRoleEligibilityScheduleRequest by combining information from roleEligibilitySchedule and roleEligibilityScheduleRequest
[AzOpsRoleEligibilityScheduleRequest]::new($roleEligibilitySchedule, $roleEligibilityScheduleRequest)
}
else {
Write-AzOpsMessage -LogLevel Important -LogString 'Get-AzOpsRoleEligibilityScheduleRequest.Processing' -LogStringValues "No RoleEligibilityScheduleRequest found for RoleEligibilitySchedule in scope: $($ScopeObject.scope), creating template based on RoleEligibilitySchedule" -Target $ScopeObject
Write-AzOpsMessage -LogLevel Verbose -LogString 'Get-AzOpsRoleEligibilityScheduleRequest.Processing.NotFound' -LogStringValues $ScopeObject.Scope, $roleEligibilitySchedule.Name -Target $ScopeObject
# Construct AzOpsRoleEligibilityScheduleRequest from roleEligibilitySchedule since no AzRoleEligibilityScheduleRequest was found
[AzOpsRoleEligibilityScheduleRequest]::new($roleEligibilitySchedule)
}
}
Expand Down
1 change: 1 addition & 0 deletions src/localized/en-us/Strings.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
'Get-AzOpsRoleDefinition.Definition' = 'Processing object {0}' # $roleDefinition.id

'Get-AzOpsRoleEligibilityScheduleRequest.Processing' = 'Retrieving Privileged Identity Management RoleEligibilitySchedule at [{0}]' # $ScopeObject.Scope
'Get-AzOpsRoleEligibilityScheduleRequest.Processing.NotFound' = 'No RoleEligibilityScheduleRequest found at [{0}] for RoleEligibilitySchedule [{1}], creating template based on RoleEligibilitySchedule' # $ScopeObject.Scope, $roleEligibilitySchedule.Name
'Get-AzOpsRoleEligibilityScheduleRequest.Assignment' = 'Found Privileged Identity Management RoleEligibilityScheduleRequest assignment [{0}]' # $roleEligibilitySchedule.Name

'Get-AzOpsSubscription.Excluded.Offers' = 'Excluded subscription offers: {0}' # ($ExcludedOffers -join ',')
Expand Down

0 comments on commit 1c65daa

Please sign in to comment.