Skip to content

Enganga/bulk url update #1439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
May 5, 2025
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1853c09
test
emmanuel-karanja Mar 13, 2025
927d205
Merge branch 'main' of https://github.com/microsoftgraph/entra-powers…
emmanuel-karanja Mar 14, 2025
8b924ee
Merge branch 'main' of https://github.com/microsoftgraph/entra-powers…
emmanuel-karanja Mar 14, 2025
91f27e0
Merge branch 'main' of https://github.com/microsoftgraph/entra-powers…
emmanuel-karanja Mar 21, 2025
673ed07
Merge branch 'main' of https://github.com/microsoftgraph/entra-powers…
emmanuel-karanja Mar 27, 2025
a018358
Merge branch 'main' of https://github.com/microsoftgraph/entra-powers…
emmanuel-karanja Apr 1, 2025
db71e80
Merge branch 'main' of https://github.com/microsoftgraph/entra-powers…
emmanuel-karanja Apr 3, 2025
261112e
bulk root url update
emmanuel-karanja Apr 3, 2025
a8c91af
odatalink
emmanuel-karanja Apr 3, 2025
4f5bec0
odatalink completion
emmanuel-karanja Apr 3, 2025
bfa26d5
odatalink completion
emmanuel-karanja Apr 3, 2025
7034cc2
odatalink completion
emmanuel-karanja Apr 3, 2025
66f535f
test fix
emmanuel-karanja Apr 3, 2025
32bcb8e
test fix
emmanuel-karanja Apr 3, 2025
921d6ce
test fix
emmanuel-karanja Apr 3, 2025
45acdef
casing fixing
emmanuel-karanja Apr 3, 2025
eb932c2
consistent spacing
emmanuel-karanja Apr 3, 2025
aefad9a
consistent casing
emmanuel-karanja Apr 3, 2025
c438155
rootUri
emmanuel-karanja Apr 3, 2025
dc805e5
rootUri updates
emmanuel-karanja Apr 3, 2025
9283270
tests mocks fixs
emmanuel-karanja Apr 3, 2025
b30bc9d
tests mocks fixs
emmanuel-karanja Apr 3, 2025
354e134
tests mocks fixs
emmanuel-karanja Apr 3, 2025
e746fdb
user manager test
emmanuel-karanja Apr 3, 2025
3d6d252
Update Set-EntraBetaUserSponsor.ps1
emmanuel-karanja Apr 14, 2025
4e9bdf0
change to oneliner
emmanuel-karanja Apr 14, 2025
68569f6
Update Set-EntraBetaUserManager.ps1
emmanuel-karanja Apr 14, 2025
701650a
Merge branch 'main' into enganga/bulk-url-update
emmanuel-karanja Apr 15, 2025
d0a021f
Replace v1 with beta endpoints in beta module
KenitoInc May 2, 2025
32e5f9b
Handle null
KenitoInc May 2, 2025
2602c5a
Handle null
KenitoInc May 2, 2025
a86cc2f
Merge branch 'main' into enganga/bulk-url-update
KenitoInc May 2, 2025
bbd9d4d
space around equals sign
KenitoInc May 2, 2025
16fe2cb
Merge branch 'enganga/bulk-url-update' of https://github.com/microsof…
KenitoInc May 2, 2025
ee88cb8
Update endpoints
KenitoInc May 2, 2025
0722e48
Fixing Graph endpoint (#1460)
SteveMutungi254 May 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -22,8 +22,18 @@ function Add-EntraApplicationOwner {

$newOwner = @{}

$rootUri = (Get-EntraEnvironment -Name (Get-EntraContext).Environment).GraphEndpoint

if (-not $rootUri) {
$rootUri = "https://graph.microsoft.com"
Write-Verbose "Using default Graph endpoint: $rootUri"
}
else {
Write-Verbose "Using environment-specific Graph endpoint: $rootUri"
}

if ($null -ne $PSBoundParameters["OwnerId"]) {
$newOwner["@odata.id"] = "https://graph.microsoft.com/v1.0/directoryObjects/" + $PSBoundParameters["OwnerId"]
$newOwner["@odata.id"] = "$rootUri/v1.0/directoryObjects/" + $PSBoundParameters["OwnerId"]
$params["BodyParameter"] = $newOwner
}
if ($null -ne $PSBoundParameters["WarningVariable"]) {
Original file line number Diff line number Diff line change
@@ -18,6 +18,12 @@ function Add-EntraServicePrincipalOwner {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand

$rootUri = (Get-EntraEnvironment -Name (Get-EntraContext).Environment).GraphEndpoint

if (-not $rootUri) {
$rootUri = "https://graph.microsoft.com"
Write-Verbose "Using default Graph endpoint: $rootUri"
}
if ($null -ne $PSBoundParameters["OutVariable"]) {
$params["OutVariable"] = $PSBoundParameters["OutVariable"]
}
@@ -59,7 +65,7 @@ function Add-EntraServicePrincipalOwner {
}
if ($null -ne $PSBoundParameters["OwnerId"]) {
$TmpValue = $PSBoundParameters["OwnerId"]
$Value = @{ "@odata.id" = "https://graph.microsoft.com/v1.0/directoryObjects/$TmpValue" }
$Value = @{ "@odata.id" = "$rootUri/v1.0/directoryObjects/$TmpValue" }
$params["BodyParameter"] = $Value
}

Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ function Get-EntraApplicationLogo {
PROCESS {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$baseUri = 'https://graph.microsoft.com/v1.0/applications'
$baseUri = '/v1.0/applications'
$Method = "GET"
if($null -ne $PSBoundParameters["ApplicationId"])
{
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ function Get-EntraApplicationOwner {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$topCount = $null
$baseUri = 'https://graph.microsoft.com/v1.0/applications'
$baseUri = '/v1.0/applications'
$properties = '$select=*'
$Method = "GET"
if ($null -ne $PSBoundParameters["Property"]) {
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ function Get-EntraApplicationTemplate {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$topCount = $null
$uri = "https://graph.microsoft.com/v1.0/applicationTemplates"
$uri = "/v1.0/applicationTemplates"
$params["Method"] = "GET"
$params["Uri"] = $uri + '?$select=*'

Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ function New-EntraApplicationFromApplicationTemplate {
displayName = $DisplayName
}

$uri = "https://graph.microsoft.com/v1.0/applicationTemplates/$ApplicationTemplateId/instantiate"
$uri = "/v1.0/applicationTemplates/$ApplicationTemplateId/instantiate"
$response = Invoke-GraphRequest -uri $uri -Headers $customHeaders -Body $body -Method POST | ConvertTo-Json -Depth 5 | ConvertFrom-Json
$memberList = @()
foreach ($data in $response) {
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ function New-EntraServicePrincipalPasswordCredential {
DisplayName = $DisplayName
}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$baseUri = 'https://graph.microsoft.com/v1.0/servicePrincipals'
$baseUri = '/v1.0/servicePrincipals'
$URI = "$baseUri/$ServicePrincipalId/addPassword"
$body = @{
passwordCredential = @{
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ function Remove-EntraDeletedDirectoryObject {
Write-Debug("============================ TRANSFORMATIONS ============================")
$params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug
Write-Debug("=========================================================================`n")
$URI = "https://graph.microsoft.com/v1.0/directory/deletedItems/$DirectoryObjectId"
$URI = "/v1.0/directory/deletedItems/$DirectoryObjectId"
$response = Invoke-GraphRequest -Headers $customHeaders -Uri $uri -Method $Method
$response
}
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ function Set-EntraApplicationLogo {
try{
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$baseUri = 'https://graph.microsoft.com/v1.0/applications'
$baseUri = '/v1.0/applications'
$Method = "PUT"
if($null -ne $PSBoundParameters["ApplicationId"])
{
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ function Set-EntraServicePrincipal {

PROCESS {
$params = @{}
$params["Uri"] = "https://graph.microsoft.com/v1.0/servicePrincipals"
$params["Uri"] = "/v1.0/servicePrincipals"
$params["Method"] = "PATCH"
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$body = @{}
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ function Revoke-EntraSignedInUserAllRefreshToken {
Write-Debug("============================ TRANSFORMATIONS ============================")
$params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug
Write-Debug("=========================================================================`n")
$response = (Invoke-GraphRequest -Headers $customHeaders -Uri 'https://graph.microsoft.com/v1.0/me/revokeSignInSessions' -Method POST).value
$response = (Invoke-GraphRequest -Headers $customHeaders -Uri '/v1.0/me/revokeSignInSessions' -Method POST).value
if ($response) {
$responseType = New-Object Microsoft.Graph.PowerShell.Models.ComponentsMwc6EoResponsesRevokesigninsessionsresponseContentApplicationJsonSchema
$responseType.Value = $response
Original file line number Diff line number Diff line change
@@ -21,9 +21,15 @@ function Add-EntraAdministrativeUnitMember {
$params["AdministrativeUnitId"] = $PSBoundParameters["AdministrativeUnitId"]
$Uri = "/v1.0/directory/administrativeUnits/$($params.AdministrativeUnitId)/members/" + '$ref'
}
$rootUri = (Get-EntraEnvironment -Name (Get-EntraContext).Environment).GraphEndpoint

if (-not $rootUri) {
$rootUri = "https://graph.microsoft.com"
Write-Verbose "Using default Graph endpoint: $rootUri"
}
if ($null -ne $PSBoundParameters["MemberId"]) {
$TmpValue = $PSBoundParameters["MemberId"]
$Value = @{ "@odata.id" = "https://graph.microsoft.com/v1.0/directoryObjects/$TmpValue" }
$Value = @{ "@odata.id" = "$rootUri/v1.0/directoryObjects/$TmpValue" }
$params["BodyParameter"] = $Value
}

Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ function Add-EntraCustomSecurityAttributeDefinitionAllowedValue {
$params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug
Write-Debug("=========================================================================`n")

$Uri = "https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions/$CustomSecurityAttributeDefinitionId/allowedValues"
$Uri = "/v1.0/directory/customSecurityAttributeDefinitions/$CustomSecurityAttributeDefinitionId/allowedValues"
$Method = "POST"
$response = Invoke-GraphRequest -Uri $Uri -Method $Method -Body $body -Headers $customHeaders | ConvertTo-Json | ConvertFrom-Json
if($response)
Original file line number Diff line number Diff line change
@@ -18,6 +18,12 @@ function Add-EntraDeviceRegisteredOwner {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand

$rootUri = (Get-EntraEnvironment -Name (Get-EntraContext).Environment).GraphEndpoint

if (-not $rootUri) {
$rootUri = "https://graph.microsoft.com"
Write-Verbose "Using default Graph endpoint: $rootUri"
}
if ($null -ne $PSBoundParameters["OutVariable"]) {
$params["OutVariable"] = $PSBoundParameters["OutVariable"]
}
@@ -59,7 +65,7 @@ function Add-EntraDeviceRegisteredOwner {
}
if ($null -ne $PSBoundParameters["OwnerId"]) {
$TmpValue = $PSBoundParameters["OwnerId"]
$Value = @{ "@odata.id" = "https://graph.microsoft.com/v1.0/directoryObjects/$TmpValue" }
$Value = @{ "@odata.id" = "$rootUri/v1.0/directoryObjects/$TmpValue" }
$params["BodyParameter"] = $Value
}

Original file line number Diff line number Diff line change
@@ -17,7 +17,13 @@ function Add-EntraDeviceRegisteredUser {
PROCESS {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand


$rootUri = (Get-EntraEnvironment -Name (Get-EntraContext).Environment).GraphEndpoint

if (-not $rootUri) {
$rootUri = "https://graph.microsoft.com"
Write-Verbose "Using default Graph endpoint: $rootUri"
}
if ($null -ne $PSBoundParameters["OutVariable"]) {
$params["OutVariable"] = $PSBoundParameters["OutVariable"]
}
@@ -59,7 +65,7 @@ function Add-EntraDeviceRegisteredUser {
}
if ($null -ne $PSBoundParameters["UserId"]) {
$TmpValue = $PSBoundParameters["UserId"]
$Value = @{ "@odata.id" = "https://graph.microsoft.com/v1.0/directoryObjects/$TmpValue" }
$Value = @{ "@odata.id" = "$rootUri/v1.0/directoryObjects/$TmpValue" }
$params["BodyParameter"] = $Value
}

Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ function Add-EntraDirectoryRoleMember {
}
if ($null -ne $PSBoundParameters["MemberId"]) {
$TmpValue = $PSBoundParameters["MemberId"]
$Value = "https://graph.microsoft.com/v1.0/directoryObjects/$TmpValue"
$Value = "/v1.0/directoryObjects/$TmpValue"
$params["OdataId"] = $Value
}

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ function Get-EntraAttributeSet {
PROCESS {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$params["Uri"] = "https://graph.microsoft.com/v1.0/directory/attributeSets/"
$params["Uri"] = "/v1.0/directory/attributeSets/"
$params["Method"] = "GET"
if ($null -ne $PSBoundParameters["AttributeSetId"]) {
$params["Uri"] += $AttributeSetId
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ function Get-EntraCustomSecurityAttributeDefinition {
PROCESS {
$params = @{}
$Method = "GET"
$Uri = "https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions/"
$Uri = "/v1.0/directory/customSecurityAttributeDefinitions/"
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand

if ($null -ne $PSBoundParameters["Id"]) {
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ function Get-EntraCustomSecurityAttributeDefinitionAllowedValue {

PROCESS {
$params = @{}
$params["Uri"] = "https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions/$CustomSecurityAttributeDefinitionId/allowedValues/"
$params["Uri"] = "/v1.0/directory/customSecurityAttributeDefinitions/$CustomSecurityAttributeDefinitionId/allowedValues/"
$params["Method"] = "GET"
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand

Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ function Get-EntraDeviceRegisteredOwner {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$topCount = $null
$baseUri = 'https://graph.microsoft.com/v1.0/devices'
$baseUri = '/v1.0/devices'
$properties = '$select=*'
$Method = "GET"
if ($null -ne $PSBoundParameters["Property"]) {
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ function Get-EntraDeviceRegisteredUser {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$topCount = $null
$baseUri = 'https://graph.microsoft.com/v1.0/devices'
$baseUri = '/v1.0/devices'
$properties = '$select=*'
$Method = "GET"
if ($null -ne $PSBoundParameters["Property"]) {
Original file line number Diff line number Diff line change
@@ -23,12 +23,12 @@ function Get-EntraDirectoryObject {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$body = @{}
$URI = 'https://graph.microsoft.com/v1.0/directoryObjects/microsoft.graph.getByIds?$select=*'
$URI = '/v1.0/directoryObjects/microsoft.graph.getByIds?$select=*'
if ($null -ne $PSBoundParameters["Property"]) {
$selectProperties = $PSBoundParameters["Property"]
$selectProperties = $selectProperties -Join ','
$properties = "`$select=$($selectProperties)"
$URI = "https://graph.microsoft.com/v1.0/directoryObjects/microsoft.graph.getByIds?$properties"
$URI = "/v1.0/directoryObjects/microsoft.graph.getByIds?$properties"
}
if ($null -ne $PSBoundParameters["ObjectTypes"]) {
$body["Types"] = $PSBoundParameters["ObjectTypes"]
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ function Get-EntraDirectoryObjectOnPremisesProvisioningError {

try {
foreach ($obj in $Object) {
$uri = "https://graph.microsoft.com/v1.0/" + $obj + "?`$filter=onPremisesProvisioningErrors/any(o:o/category ne null)&`$select=Id,UserPrincipalName,DisplayName,Mail,ProxyAddresses,onPremisesProvisioningErrors,onPremisesSyncEnabled&`$top=999"
$uri = "/v1.0/" + $obj + "?`$filter=onPremisesProvisioningErrors/any(o:o/category ne null)&`$select=Id,UserPrincipalName,DisplayName,Mail,ProxyAddresses,onPremisesProvisioningErrors,onPremisesSyncEnabled&`$top=999"
$response = Invoke-GraphRequest -Headers $customHeaders -Uri $uri -Method GET
$response.value | ForEach-Object {
$_ | Add-Member -MemberType NoteProperty -Name ObjectType -Value $obj -Force
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ function Get-EntraDirectoryRoleMember {
PROCESS {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$baseUri = 'https://graph.microsoft.com/v1.0/directoryRoles'
$baseUri = '/v1.0/directoryRoles'
$properties = '$select=*'
$Method = "GET"
if ($null -ne $PSBoundParameters["Property"]) {
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ function Get-EntraDomainNameReference {
PROCESS {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$baseUri = 'https://graph.microsoft.com/v1.0/domains'
$baseUri = '/v1.0/domains'
$properties = '$select=*'
$Method = "GET"
$keysChanged = @{ObjectId = "Id" }
Original file line number Diff line number Diff line change
@@ -22,8 +22,9 @@ function Get-EntraPartnerInformation {
Write-Debug("=========================================================================`n")
if ([string]::IsNullOrWhiteSpace($TenantId)) {
$TenantID = (Get-EntraContext).TenantId

}
$response = Invoke-MgGraphRequest -Headers $customHeaders -Method GET -Uri "https://graph.microsoft.com/v1.0/organization/$TenantID/partnerInformation"
$response = Invoke-MgGraphRequest -Headers $customHeaders -Method GET -Uri "/v1.0/organization/$TenantID/partnerInformation"
# Create a custom table
$customTable = [PSCustomObject]@{
"PartnerCompanyName" = $response.companyName
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ function Get-EntraScopedRoleMembership {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$isList = $false
$baseUri = "https://graph.microsoft.com/v1.0/directory/administrativeUnits"
$baseUri = "/v1.0/directory/administrativeUnits"
if($null -ne $PSBoundParameters["AdministrativeUnitId"])
{
$params["AdministrativeUnitId"] = $PSBoundParameters["AdministrativeUnitId"]
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ function Get-EntraSubscription {
$params = @{}
$topCount = 0
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$baseUri = "https://graph.microsoft.com/v1.0/directory/subscriptions"
$baseUri = "/v1.0/directory/subscriptions"
$properties = "`$select=*"

if ($PSBoundParameters.ContainsKey("Property")) {
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ function New-EntraAttributeSet {
$params = @{}
$body = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$params["Uri"] = "https://graph.microsoft.com/v1.0/directory/attributeSets"
$params["Uri"] = "/v1.0/directory/attributeSets"
$params["Method"] = "POST"

if ($null -ne $PSBoundParameters["AttributeSetId"]) {
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ function New-EntraCustomSecurityAttributeDefinition {
$params = @{}
$body = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$Uri = "https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions"
$Uri = "/v1.0/directory/customSecurityAttributeDefinitions"
$Method = "POST"

if($null -ne $PSBoundParameters["AttributeSet"])
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ function Restore-EntraDeletedDirectoryObject {
PROCESS {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$params["Uri"] = 'https://graph.microsoft.com/v1.0/directory/deletedItems/'
$params["Uri"] = '/v1.0/directory/deletedItems/'
$params["Method"] = "POST"
if ($null -ne $PSBoundParameters["Id"]) {
$params["Uri"] += $Id + "/microsoft.graph.restore"
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ function Set-EntraAttributeSet {
$params = @{}
$body = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$params["Uri"] = "https://graph.microsoft.com/v1.0/directory/attributeSets/"
$params["Uri"] = "/v1.0/directory/attributeSets/"
$params["Method"] = "PATCH"
if($null -ne $PSBoundParameters["AttributeSetId"])
{
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ function Set-EntraCustomSecurityAttributeDefinition {
$params = @{}
$body = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$Uri = "https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions/$Id"
$Uri = "/v1.0/directory/customSecurityAttributeDefinitions/$Id"
$Method = "PATCH"

if($null -ne $PSBoundParameters["Id"])
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ function Set-EntraCustomSecurityAttributeDefinitionAllowedValue {
$body = @{}

$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$Uri = "https://graph.microsoft.com/v1.0/directory/customSecurityAttributeDefinitions/$CustomSecurityAttributeDefinitionId/allowedValues/$Id"
$Uri = "/v1.0/directory/customSecurityAttributeDefinitions/$CustomSecurityAttributeDefinitionId/allowedValues/$Id"
$Method = "PATCH"

if($null -ne $PSBoundParameters["CustomSecurityAttributeDefinitionId"])
Original file line number Diff line number Diff line change
@@ -19,14 +19,15 @@ function Set-EntraDirSyncEnabled {
$params = @{}
$body = @{}
$params["Method"] = "PATCH"
$URL = "https://graph.microsoft.com/v1.0/organization/" + $TenantId
$URL = "/v1.0/organization/" + $TenantId
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
if ($EnableDirsync -or (-not($EnableDirsync))) {
$body["OnPremisesSyncEnabled"] = $PSBoundParameters["EnableDirsync"]
}
if ([string]::IsNullOrWhiteSpace($TenantId)) {

$TenantId = (Get-EntraContext).TenantId
$URL = "https://graph.microsoft.com/v1.0/organization/" + $TenantId
$URL = "/v1.0/organization/" + $TenantId
}

$params["Uri"] = $URL
Loading