Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -0,0 +1,50 @@
function Get-EntraAuthorizationPolicy {
[CmdletBinding(DefaultParameterSetName = '')]
param (
[Parameter(Mandatory = $false, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[System.String] $Id,
[Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)]
[System.String[]] $Property
)

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

if($null -ne $PSBoundParameters["Id"])
{
$Id = $Id.Substring(0, 1).ToLower() + $Id.Substring(1)
$Filter = "Id eq '$Id'"
$f = '$' + 'Filter'
$params["Uri"] += "&$f=$Filter"
}
if($null -ne $PSBoundParameters["Property"])
{
$selectProperties = $PSBoundParameters["Property"]
$selectProperties = $selectProperties -Join ','
$properties = "`$select=$($selectProperties)"
$params["Uri"] += "&$properties"
}

Write-Debug("============================ TRANSFORMATIONS ============================")
$params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug
Write-Debug("=========================================================================`n")

$response = Invoke-GraphRequest @params -Headers $customHeaders | ConvertTo-Json | ConvertFrom-Json
if($response){
$policyList = @()
foreach ($data in $response) {
$policyType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphAuthorizationPolicy
$data.PSObject.Properties | ForEach-Object {
$propertyName = $_.Name
$propertyValue = $_.Value
$policyType | Add-Member -MemberType NoteProperty -Name $propertyName -Value $propertyValue -Force
}
$policyList += $policyType
}
$policyList
}
}
}# ------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
function Restore-EntraDeletedDirectoryObject {
[CmdletBinding(DefaultParameterSetName = '')]
param (
[Alias('ObjectId')]
[Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[System.String] $Id,
[Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[switch] $AutoReconcileProxyConflict
)

PROCESS {
$params = @{}
$customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand
$params["Uri"] = 'https://graph.microsoft.com/v1.0/directory/deletedItems/'
$params["Method"] = "POST"
if($null -ne $PSBoundParameters["Id"])
{
$params["Uri"] += $Id+"/microsoft.graph.restore"
}
if($PSBoundParameters.ContainsKey("AutoReconcileProxyConflict"))
{
$params["Body"] = @{
autoReconcileProxyConflict = $true
}
}

Write-Debug("============================ TRANSFORMATIONS ============================")
$params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug
Write-Debug("=========================================================================`n")

$response = Invoke-GraphRequest @params -Headers $customHeaders
$data = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json
$data | ForEach-Object {
if($null -ne $_) {
Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id

}
}
$userList = @()
foreach ($res in $data) {
$userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject
$res.PSObject.Properties | ForEach-Object {
$propertyName = $_.Name.Substring(0,1).ToUpper() + $_.Name.Substring(1)
$propertyValue = $_.Value
$userType | Add-Member -MemberType NoteProperty -Name $propertyName -Value $propertyValue -Force
}
$userList += $userType
}
$userList
}
}# ------------------------------------------------------------------------------

5 changes: 5 additions & 0 deletions src/EntraModuleBuilder.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ $($requiredModulesEntries -join ",`n")
}

}


#Create the Root Module Manifest

# $this.CreateRootModuleManifest($module)
}


Expand Down

This file was deleted.

This file was deleted.

Loading