Skip to content

Commit

Permalink
Merge pull request #73 from kayasax/Approval
Browse files Browse the repository at this point in the history
V1.7.2
  • Loading branch information
kayasax authored Dec 12, 2024
2 parents 60f60a5 + d6dd455 commit e120d62
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion EasyPIM/EasyPIM.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RootModule = 'EasyPIM.psm1'

# Version number of this module.
ModuleVersion = '1.7.1'
ModuleVersion = '1.7.2'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
2 changes: 1 addition & 1 deletion EasyPIM/functions/Get-PIMEntraRolePendingApproval.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Get-PIMEntraRolePendingApproval{

Write-Verbose "Get-PIMAzureResourcePendingApproval start with parameters: tenantID => $tenantID"

$endpoint="/roleManagement/directory/roleAssignmentScheduleRequests/filterByCurrentUser(on='approver')?$filter=status eq 'PendingApproval'"
$endpoint="/roleManagement/directory/roleAssignmentScheduleRequests/filterByCurrentUser(on='approver')?`$filter=status eq 'PendingApproval'"
$response = Invoke-Graph -Endpoint $endpoint -Method "GET"

$out = @()
Expand Down
14 changes: 9 additions & 5 deletions EasyPIM/internal/functions/Invoke-ARM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ function Invoke-ARM {
write-verbose "`n>> request body: $body"
write-verbose "requested URI : $restURI ; method : $method"

$script:subscriptionID=[regex]::Matches($restURI,".*\/subscriptions\/(.*)\/providers.*$").groups[1].Value
#TODO need better way to handle mangement group scope!!
if($restURI -notmatch "managementgroups"){
$script:subscriptionID=[regex]::Matches($restURI,".*\/subscriptions\/(.*)\/providers.*$").groups[1].Value


if ( $null -eq (get-azcontext) -or ( (get-azcontext).Tenant.Id -ne $script:tenantID ) ) {
Write-Verbose ">> Connecting to Azure with tenantID $script:tenantID"
Connect-AzAccount -Tenantid $script:tenantID -Subscription $script:subscriptionID
if ( $null -eq (get-azcontext) -or ( (get-azcontext).Tenant.Id -ne $script:tenantID ) ) {
Write-Verbose ">> Connecting to Azure with tenantID $script:tenantID"
Connect-AzAccount -Tenantid $script:tenantID -Subscription $script:subscriptionID
}
}


#todo replace with invoke-azrestmethod
#replaced with invoke-azrestmethod
<#
# Get access Token
Write-Verbose ">> Getting access token"
Expand Down

0 comments on commit e120d62

Please sign in to comment.