diff --git a/module/Entra/AdditionalFunctions/Get-EntraAdministrativeUnit.ps1 b/module/Entra/AdditionalFunctions/Get-EntraAdministrativeUnit.ps1 index 849b52436..3ca88d74b 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraAdministrativeUnit.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraAdministrativeUnit.ps1 @@ -1,51 +1,57 @@ # ------------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +# Copyright (c) Microsoft Corporation. All Rights Reserved. +# Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Get-EntraAdministrativeUnit { [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias("ObjectId")] - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $AdministrativeUnitId, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter + [Alias("ObjectId")] + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $AdministrativeUnitId, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter ) - PROCESS { - $params = @{} - $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand - $baseUri = "/v1.0/directory/administrativeUnits" - $properties = '$select=*' - $params["Uri"] = "$baseUri/?$properties" - if($null -ne $PSBoundParameters["AdministrativeUnitId"]) - { - $params["AdministrativeUnitId"] = $PSBoundParameters["AdministrativeUnitId"] - $params["Uri"] = "$baseUri/$($params.AdministrativeUnitId)?$properties" - } - if ($PSBoundParameters.ContainsKey("Top")) { - $topCount = $PSBoundParameters["Top"] - if ($topCount -gt 999) { - $params["Uri"] += "&`$top=999" + PROCESS { + $params = @{} + $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand + $baseUri = "/v1.0/directory/administrativeUnits" + $properties = '$select=*' + $params["Uri"] = "$baseUri/?$properties" + + if ($null -ne $PSBoundParameters["AdministrativeUnitId"]) { + $params["AdministrativeUnitId"] = $PSBoundParameters["AdministrativeUnitId"] + $params["Uri"] = "$baseUri/$($params.AdministrativeUnitId)?$properties" } - else { - $params["Uri"] += "&`$top=$topCount" + + if ($PSBoundParameters.ContainsKey("Top")) { + $topCount = $PSBoundParameters["Top"] + if ($topCount -gt 999) { + $params["Uri"] += "&`$top=999" + } else { + $params["Uri"] += "&`$top=$topCount" + } + } + + if ($null -ne $PSBoundParameters["Filter"]) { + $Filter = $PSBoundParameters["Filter"] + $f = '$' + 'Filter' + $params["Uri"] += "&$f=$Filter" } - } - if ($null -ne $PSBoundParameters["Filter"]) { - $Filter = $PSBoundParameters["Filter"] - $f = '$' + 'Filter' - $params["Uri"] += "&$f=$Filter" - } Write-Debug("============================ TRANSFORMATIONS ============================") $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - - $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $($params.Uri) -Method GET) + + $response = Invoke-GraphRequest -Headers $customHeaders -Uri $($params.Uri) -Method GET $data = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json try { @@ -59,18 +65,18 @@ function Get-EntraAdministrativeUnit { $params["Uri"] = $params["Uri"].Replace('$top=999', "`$top=$topValue") $increment -= $topValue } - $response = Invoke-GraphRequest @params + $response = Invoke-GraphRequest @params $data += $response.value | ConvertTo-Json -Depth 10 | ConvertFrom-Json } - } - catch {} + } catch {} + $data | ForEach-Object { if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id Add-Member -InputObject $_ -MemberType AliasProperty -Name DeletionTimeStamp -Value deletedDateTime } } - + if ($data) { $aulist = @() foreach ($item in $data) { diff --git a/module/Entra/AdditionalFunctions/Get-EntraAdministrativeUnitMember.ps1 b/module/Entra/AdditionalFunctions/Get-EntraAdministrativeUnitMember.ps1 index 7bb91f323..63bd336d7 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraAdministrativeUnitMember.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraAdministrativeUnitMember.ps1 @@ -1,16 +1,20 @@ # ------------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +# Copyright (c) Microsoft Corporation. All Rights Reserved. +# Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Get-EntraAdministrativeUnitMember { [CmdletBinding(DefaultParameterSetName = 'GetQuery')] - param ( - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Alias("ObjectId")] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $AdministrativeUnitId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All + param ( + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias("ObjectId")] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $AdministrativeUnitId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All ) PROCESS { @@ -19,17 +23,17 @@ function Get-EntraAdministrativeUnitMember { $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $baseUri = "/v1.0/directory/administrativeUnits/$AdministrativeUnitId/members?`$select=*" $params["Uri"] = "$baseUri" - if($null -ne $PSBoundParameters["AdministrativeUnitId"]) - { + + if ($null -ne $PSBoundParameters["AdministrativeUnitId"]) { $params["AdministrativeUnitId"] = $PSBoundParameters["AdministrativeUnitId"] } + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] if ($topCount -gt 999) { $minTop = 999 $params["Uri"] += "&`$top=999" - } - else { + } else { $params["Uri"] += "&`$top=$topCount" } } @@ -38,7 +42,7 @@ function Get-EntraAdministrativeUnitMember { $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $($params.Uri) -Method GET) + $response = Invoke-GraphRequest -Headers $customHeaders -Uri $($params.Uri) -Method GET $data = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json try { @@ -51,22 +55,22 @@ function Get-EntraAdministrativeUnitMember { $topValue = [Math]::Min($increment, 999) if ($minTop) { $params["Uri"] = $params["Uri"].Replace("`$top=$minTop", "`$top=$topValue") - } - else { + } else { $params["Uri"] = $params["Uri"].Replace("`$top=$topCount", "`$top=$topValue") } $increment -= $topValue } - $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $($params.Uri) -Method GET) + $response = Invoke-GraphRequest -Headers $customHeaders -Uri $($params.Uri) -Method GET $data += $response.value | ConvertTo-Json -Depth 10 | ConvertFrom-Json } - } - catch {} + } catch {} + $data | ForEach-Object { if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id } } + if ($data) { $memberList = @() foreach ($response in $data) { diff --git a/module/Entra/AdditionalFunctions/Get-EntraApplicationTemplate.ps1 b/module/Entra/AdditionalFunctions/Get-EntraApplicationTemplate.ps1 index 851b890fa..4da6c0b86 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraApplicationTemplate.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraApplicationTemplate.ps1 @@ -1,19 +1,26 @@ # ------------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +# Copyright (c) Microsoft Corporation. All Rights Reserved. +# Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Get-EntraApplicationTemplate { [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Id, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Int32] $Top, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Id, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Int32] $Top, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) PROCESS { @@ -22,48 +29,42 @@ function Get-EntraApplicationTemplate { $topCount = $null $uri = "https://graph.microsoft.com/v1.0/applicationTemplates" $params["Method"] = "GET" - $params["Uri"] = $uri+'?$select=*' + $params["Uri"] = $uri + '?$select=*' - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' - $params["Uri"] = $uri+"?`$select=$($selectProperties)" + $params["Uri"] = $uri + "?`$select=$($selectProperties)" } - if(($PSBoundParameters.ContainsKey("Top") -and (-not $PSBoundParameters.ContainsKey("All"))) -or ($PSBoundParameters.ContainsKey("Top") -and $null -ne $PSBoundParameters["All"])) - { - $topCount = $PSBoundParameters["Top"] + if (($PSBoundParameters.ContainsKey("Top") -and (-not $PSBoundParameters.ContainsKey("All"))) -or ($PSBoundParameters.ContainsKey("Top") -and $null -ne $PSBoundParameters["All"])) { + $topCount = $PSBoundParameters["Top"] $params["Uri"] += "&`$top=$topCount" } - if($null -ne $PSBoundParameters["Filter"]) - { + if ($null -ne $PSBoundParameters["Filter"]) { $Filter = $PSBoundParameters["Filter"] $f = '$' + 'Filter' $params["Uri"] += "&$f=$Filter" } - if((-not $PSBoundParameters.ContainsKey("Top")) -and (-not $PSBoundParameters.ContainsKey("All"))) - { + if ((-not $PSBoundParameters.ContainsKey("Top")) -and (-not $PSBoundParameters.ContainsKey("All"))) { $params["Uri"] += "&`$top=100" } - if($null -ne $PSBoundParameters["Id"]) - { + if ($null -ne $PSBoundParameters["Id"]) { $params["ApplicationTemplateId"] = $PSBoundParameters["Id"] $params["Uri"] = $uri + "/$Id" } $response = Invoke-GraphRequest -Uri $($params.Uri) -Method GET -Headers $customHeaders - if($response.ContainsKey('value')){ + if ($response.ContainsKey('value')) { $response = $response.value } $data = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json - $userList = @() foreach ($res in $data) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphApplicationTemplate $res.PSObject.Properties | ForEach-Object { - $propertyName = $_.Name.Substring(0,1).ToUpper() + $_.Name.Substring(1) + $propertyName = $_.Name.Substring(0, 1).ToUpper() + $_.Name.Substring(1) $propertyValue = $_.Value $userType | Add-Member -MemberType NoteProperty -Name $propertyName -Value $propertyValue -Force } diff --git a/module/Entra/AdditionalFunctions/Get-EntraAuditDirectoryLog.ps1 b/module/Entra/AdditionalFunctions/Get-EntraAuditDirectoryLog.ps1 index 2b6b69b3c..0dc7dc0c1 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraAuditDirectoryLog.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraAuditDirectoryLog.ps1 @@ -1,18 +1,22 @@ # ------------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +# Copyright (c) Microsoft Corporation. All Rights Reserved. +# Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ - function Get-EntraAuditDirectoryLog { [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetById", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Id, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Int32] $Top, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter + [Parameter(ParameterSetName = "GetById", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Id, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Int32] $Top, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter ) PROCESS { @@ -21,32 +25,28 @@ function Get-EntraAuditDirectoryLog { $topCount = $null $baseUri = 'https://graph.microsoft.com/v1.0/auditLogs/directoryAudits' $params["Method"] = "GET" - $params["Uri"] = "$baseUri"+"?" + $params["Uri"] = "$baseUri" + "?" - if($PSBoundParameters.ContainsKey("Top")) - { + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] if ($topCount -gt 999) { $params["Uri"] += "&`$top=999" - } - else{ + } else { $params["Uri"] += "&`$top=$topCount" } } - if($null -ne $PSBoundParameters["Id"]) - { + if ($null -ne $PSBoundParameters["Id"]) { $LogId = $PSBoundParameters["Id"] $params["Uri"] = "$baseUri/$($LogId)" } - if($null -ne $PSBoundParameters["Filter"]) - { + if ($null -ne $PSBoundParameters["Filter"]) { $Filter = $PSBoundParameters["Filter"] $f = '$Filter' $params["Uri"] += "&$f=$Filter" } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $response = Invoke-GraphRequest @params -Headers $customHeaders diff --git a/module/Entra/AdditionalFunctions/Get-EntraAuditSignInLog.ps1 b/module/Entra/AdditionalFunctions/Get-EntraAuditSignInLog.ps1 index 5686e768d..f600f1aca 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraAuditSignInLog.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraAuditSignInLog.ps1 @@ -1,19 +1,24 @@ # ------------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +# Copyright (c) Microsoft Corporation. All Rights Reserved. +# Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Get-EntraAuditSignInLog { [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetById", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias("Id")] - [System.String] $SignInId, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Int32] $Top, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter + [Parameter(ParameterSetName = "GetById", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias("Id")] + [System.String] $SignInId, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Int32] $Top, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter ) PROCESS { @@ -25,37 +30,32 @@ function Get-EntraAuditSignInLog { $params["Uri"] = "$baseUri" $query = $null - if($PSBoundParameters.ContainsKey("Top")) - { + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] if ($topCount -gt 999) { $query += "&`$top=999" - } - else{ + } else { $query += "&`$top=$topCount" } } - if($null -ne $PSBoundParameters["SignInId"]) - { + if ($null -ne $PSBoundParameters["SignInId"]) { $logId = $PSBoundParameters["SignInId"] $params["Uri"] = "$baseUri/$($logId)" } - if($null -ne $PSBoundParameters["Filter"]) - { + if ($null -ne $PSBoundParameters["Filter"]) { $Filter = $PSBoundParameters["Filter"] $f = '$filter' $query += "&$f=$Filter" } - if($null -ne $query) - { + if ($null -ne $query) { $query = "?" + $query.TrimStart("&") $params["Uri"] += $query } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $response = Invoke-GraphRequest @params -Headers $customHeaders diff --git a/module/Entra/AdditionalFunctions/Get-EntraAuthorizationPolicy.ps1 b/module/Entra/AdditionalFunctions/Get-EntraAuthorizationPolicy.ps1 index 90b12fe0e..0a03a049f 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraAuthorizationPolicy.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraAuthorizationPolicy.ps1 @@ -1,8 +1,14 @@ +# ------------------------------------------------------------------------------ +# Copyright (c) Microsoft Corporation. All Rights Reserved. +# Licensed under the MIT License. See License in the project root for license information. +# ------------------------------------------------------------------------------ function Get-EntraAuthorizationPolicy { [CmdletBinding(DefaultParameterSetName = '')] param ( [Parameter(Mandatory = $false, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [System.String] $Id, + + [Alias("Select")] [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] [System.String[]] $Property ) @@ -13,15 +19,13 @@ function Get-EntraAuthorizationPolicy { $params["Uri"] = "https://graph.microsoft.com/v1.0/policies/authorizationPolicy?" $params["Method"] = "GET" - if($null -ne $PSBoundParameters["Id"]) - { + 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"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" @@ -29,11 +33,11 @@ function Get-EntraAuthorizationPolicy { } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $response = Invoke-GraphRequest @params -Headers $customHeaders | ConvertTo-Json | ConvertFrom-Json - if($response){ + if ($response) { $policyList = @() foreach ($data in $response) { $policyType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphAuthorizationPolicy diff --git a/module/Entra/AdditionalFunctions/Get-EntraContext.ps1 b/module/Entra/AdditionalFunctions/Get-EntraContext.ps1 index adbf0f323..ec675dde9 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraContext.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraContext.ps1 @@ -8,64 +8,63 @@ function Get-EntraContext { PROCESS { $params = @{} - if($null -ne $PSBoundParameters["ErrorAction"]) - { + if ($null -ne $PSBoundParameters["ErrorAction"]) { $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] } - if($null -ne $PSBoundParameters["PipelineVariable"]) - { + if ($null -ne $PSBoundParameters["PipelineVariable"]) { $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] } - if($null -ne $PSBoundParameters["OutVariable"]) - { + if ($null -ne $PSBoundParameters["OutVariable"]) { $params["OutVariable"] = $PSBoundParameters["OutVariable"] } - if($null -ne $PSBoundParameters["InformationAction"]) - { + if ($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } - if($null -ne $PSBoundParameters["WarningVariable"]) - { + if ($null -ne $PSBoundParameters["WarningVariable"]) { $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] } - if($PSBoundParameters.ContainsKey("Verbose")) - { + if ($PSBoundParameters.ContainsKey("Verbose")) { $params["Verbose"] = $PSBoundParameters["Verbose"] } - if($PSBoundParameters.ContainsKey("Debug")) - { + if ($PSBoundParameters.ContainsKey("Debug")) { $params["Debug"] = $PSBoundParameters["Debug"] } - if($null -ne $PSBoundParameters["Confirm"]) - { + if ($null -ne $PSBoundParameters["Confirm"]) { $params["Confirm"] = $PSBoundParameters["Confirm"] } - if($null -ne $PSBoundParameters["ErrorVariable"]) - { + if ($null -ne $PSBoundParameters["ErrorVariable"]) { $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] } - if($null -ne $PSBoundParameters["OutBuffer"]) - { + if ($null -ne $PSBoundParameters["OutBuffer"]) { $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] } - if($null -ne $PSBoundParameters["WarningAction"]) - { + if ($null -ne $PSBoundParameters["WarningAction"]) { $params["WarningAction"] = $PSBoundParameters["WarningAction"] } - if($null -ne $PSBoundParameters["WhatIf"]) - { + if ($null -ne $PSBoundParameters["WhatIf"]) { $params["WhatIf"] = $PSBoundParameters["WhatIf"] } - if($null -ne $PSBoundParameters["InformationVariable"]) - { + if ($null -ne $PSBoundParameters["InformationVariable"]) { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $response = Get-MgContext @params + if ($null -ne (Get-Module -Name Microsoft.Graph.Entra.Beta)) { + $entraPSVersion = (Get-Module -Name Microsoft.Graph.Entra.Beta | Select-Object -ExpandProperty Version).ToString() + $entraPSModuleName = "Microsoft.Graph.Entra.Beta" + } + elseif ($null -ne (Get-Module -Name Microsoft.Graph.Entra)) { + $entraPSVersion = (Get-Module -Name Microsoft.Graph.Entra | Select-Object -ExpandProperty Version).ToString() + $entraPSModuleName = "Microsoft.Graph.Entra" + } + + $response | Add-Member -MemberType NoteProperty -Name "EntraPowerShellModuleName" -Value $entraPSModuleName -Force + $response | Add-Member -MemberType NoteProperty -Name "EntraPowerShellVersion" -Value $entraPSVersion -Force + $response } } diff --git a/module/Entra/AdditionalFunctions/Get-EntraFeatureRolloutPolicy.ps1 b/module/Entra/AdditionalFunctions/Get-EntraFeatureRolloutPolicy.ps1 index 1b32be76c..a9b342725 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraFeatureRolloutPolicy.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraFeatureRolloutPolicy.ps1 @@ -4,14 +4,18 @@ function Get-EntraFeatureRolloutPolicy { [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Id, - [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $SearchString, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Id, + + [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $SearchString, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) PROCESS { @@ -22,38 +26,33 @@ function Get-EntraFeatureRolloutPolicy { $params["Uri"] = "$baseUri" $query = $null - if($null -ne $PSBoundParameters["Id"]) - { + if ($null -ne $PSBoundParameters["Id"]) { $Id = $PSBoundParameters["Id"] $params["Uri"] = "https://graph.microsoft.com/v1.0/policies/featureRolloutPolicies/$Id" } - if($null -ne $PSBoundParameters["SearchString"]) - { + if ($null -ne $PSBoundParameters["SearchString"]) { $FilterValue = $PSBoundParameters["SearchString"] - $filter="displayName eq '$FilterValue' or startswith(displayName,'$FilterValue')" + $filter = "displayName eq '$FilterValue' or startswith(displayName,'$FilterValue')" $f = '$' + 'Filter' $query += "&$f=$Filter" } - if($null -ne $PSBoundParameters["Filter"]) - { + if ($null -ne $PSBoundParameters["Filter"]) { $Filter = $PSBoundParameters["Filter"] $f = '$' + 'Filter' $query += "&$f=$Filter" } - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $query += "&`$select=$($selectProperties)" } - if($null -ne $query) - { + if ($null -ne $query) { $query = "?" + $query.TrimStart("&") $params["Uri"] += $query } - + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $data = Invoke-GraphRequest @params -Headers $customHeaders | ConvertTo-Json | ConvertFrom-Json @@ -62,8 +61,7 @@ function Get-EntraFeatureRolloutPolicy { } catch {} - if($data) - { + if ($data) { $userList = @() foreach ($response in $data) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphFeatureRolloutPolicy diff --git a/module/Entra/AdditionalFunctions/Get-EntraObjectSetting.ps1 b/module/Entra/AdditionalFunctions/Get-EntraObjectSetting.ps1 index faf51a15f..b1c604d60 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraObjectSetting.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraObjectSetting.ps1 @@ -1,18 +1,27 @@ # ------------------------------------------------------------------------------ -# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +# Copyright (c) Microsoft Corporation. All Rights Reserved. +# Licensed under the MIT License. See License in the project root for license information. # ------------------------------------------------------------------------------ function Get-EntraObjectSetting { [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)][System.String] $Id, + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Id, + + [Alias("Limit")] [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [System.Int32] $Top, + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [switch] $All, + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [System.String] $TargetType, + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] [System.String] $TargetObjectId, + + [Alias("Select")] [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] [System.String[]] $Property ) @@ -23,31 +32,30 @@ function Get-EntraObjectSetting { $topCount = $null $baseUri = "https://graph.microsoft.com/v1.0/$TargetType/$TargetObjectId/settings" $params["Method"] = "GET" - $params["Uri"] = $baseUri+'?$select=*' - if($null -ne $PSBoundParameters["Property"]) - { + $params["Uri"] = $baseUri + '?$select=*' + + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' - $params["Uri"] = $baseUri+"?`$select=$($selectProperties)" + $params["Uri"] = $baseUri + "?`$select=$($selectProperties)" } - if($PSBoundParameters.ContainsKey("Top") -and (-not $PSBoundParameters.ContainsKey("All"))) - { + + if ($PSBoundParameters.ContainsKey("Top") -and (-not $PSBoundParameters.ContainsKey("All"))) { $topCount = $PSBoundParameters["Top"] if ($topCount -gt 999) { $params["Uri"] += "&`$top=999" - } - else{ + } else { $params["Uri"] += "&`$top=$topCount" } } - if($null -ne $PSBoundParameters["Id"]) - { + + if ($null -ne $PSBoundParameters["Id"]) { $Id = $PSBoundParameters["Id"] $params["Uri"] = "$baseUri/$($Id)" } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $response = Invoke-GraphRequest @params -Headers $customHeaders @@ -70,11 +78,11 @@ function Get-EntraObjectSetting { $targetTypeList = @() - if($TargetType.ToLower() -eq 'groups'){ - foreach($res in $data){ + if ($TargetType.ToLower() -eq 'groups') { + foreach ($res in $data) { $groupType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphGroupSetting $res.PSObject.Properties | ForEach-Object { - $propertyName = $_.Name.Substring(0,1).ToUpper() + $_.Name.Substring(1) + $propertyName = $_.Name.Substring(0, 1).ToUpper() + $_.Name.Substring(1) $propertyValue = $_.Value $groupType | Add-Member -MemberType NoteProperty -Name $propertyName -Value $propertyValue -Force } @@ -82,11 +90,11 @@ function Get-EntraObjectSetting { } } - if($TargetType.ToLower() -eq 'users'){ - foreach($res in $data){ + if ($TargetType.ToLower() -eq 'users') { + foreach ($res in $data) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphUserSettings $res.PSObject.Properties | ForEach-Object { - $propertyName = $_.Name.Substring(0,1).ToUpper() + $_.Name.Substring(1) + $propertyName = $_.Name.Substring(0, 1).ToUpper() + $_.Name.Substring(1) $propertyValue = $_.Value $userType | Add-Member -MemberType NoteProperty -Name $propertyName -Value $propertyValue -Force } diff --git a/module/Entra/AdditionalFunctions/Get-EntraPolicy.ps1 b/module/Entra/AdditionalFunctions/Get-EntraPolicy.ps1 index 1a767cb26..216a8ce3d 100644 --- a/module/Entra/AdditionalFunctions/Get-EntraPolicy.ps1 +++ b/module/Entra/AdditionalFunctions/Get-EntraPolicy.ps1 @@ -5,26 +5,30 @@ function Get-EntraPolicy { [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Id, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Int32] $Top, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Id, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Int32] $Top, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All ) - PROCESS { + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $baseUrl = "https://graph.microsoft.com/v1.0/policies/" - $endpoints = @("homeRealmDiscoveryPolicies", "claimsMappingPolicies", "tokenIssuancePolicies", "tokenLifetimePolicies", "activityBasedTimeoutPolicies", "featureRolloutPolicies", "defaultAppManagementPolicy", "appManagementPolicies", "authenticationFlowsPolicy", "authenticationMethodsPolicy", "permissionGrantPolicies") - - if($PSBoundParameters.ContainsKey("Top") -and ($null -eq $Top -or $Top -eq 0)){ + $endpoints = @("homeRealmDiscoveryPolicies", "claimsMappingPolicies", "tokenIssuancePolicies", "tokenLifetimePolicies", "activityBasedTimeoutPolicies", "featureRolloutPolicies", "defaultAppManagementPolicy", "appManagementPolicies", "authenticationFlowsPolicy", "authenticationMethodsPolicy", "permissionGrantPolicies") + + if ($PSBoundParameters.ContainsKey("Top") -and ($null -eq $Top -or $Top -eq 0)) { Write-Error "Invalid page size specified: '0'. Must be between 1 and 999 inclusive. Status: 400 (BadRequest) ErrorCode: Request_UnsupportedQuery" break } + $response = @() foreach ($endpoint in $endpoints) { $url = "${baseUrl}${endpoint}" @@ -38,18 +42,18 @@ ErrorCode: Request_UnsupportedQuery" $_.Type = ($endpoint.Substring(0, 1).ToUpper() + $endpoint.Substring(1) -replace "ies", "y") $response += $_ if ($Top -and ($response.Count -ge $Top)) { - break + break } } } - + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================") if ($PSBoundParameters.ContainsKey("ID")) { $response = $response | Where-Object { $_.id -eq $Id } - if($Null -eq $response ) { + if ($Null -eq $response) { Write-Error "Get-EntraPolicy : Error occurred while executing Get-Policy Code: Request_BadRequest Message: Invalid object identifier '$Id' ." @@ -57,11 +61,11 @@ ErrorCode: Request_UnsupportedQuery" } elseif (-not $All -and $Top) { $response = $response | Select-Object -First $Top } - + $data = $response | ConvertTo-Json -Depth 50 | ConvertFrom-Json $respList = @() - - foreach ($res in $data) { + + foreach ($res in $data) { switch ($res.type) { "ActivityBasedTimeoutPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphActivityBasedTimeoutPolicy } "AppManagementPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphAppManagementPolicy } @@ -71,19 +75,19 @@ ErrorCode: Request_UnsupportedQuery" "TokenIssuancePolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphTokenIssuancePolicy } "TokenLifetimePolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphTokenLifetimePolicy } "PermissionGrantPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphPermissionGrantPolicy } - "DefaultAppManagementPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphappManagementPolicy } - "AuthenticationFlowsPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphauthenticationFlowsPolicy } - "AuthenticationMethodsPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphauthenticationMethodsPolicy} - default { Write-Error "Unknown type: " + $res.type} + "DefaultAppManagementPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphAppManagementPolicy } + "AuthenticationFlowsPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphAuthenticationFlowsPolicy } + "AuthenticationMethodsPolicy" { $respType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphAuthenticationMethodsPolicy } + default { Write-Error "Unknown type: " + $res.type } } $res.PSObject.Properties | ForEach-Object { - $propertyName = $_.Name.Substring(0,1).ToUpper() + $_.Name.Substring(1) + $propertyName = $_.Name.Substring(0, 1).ToUpper() + $_.Name.Substring(1) $propertyValue = $_.Value $respType | Add-Member -MemberType NoteProperty -Name $propertyName -Value $propertyValue -Force } $respList += $respType } - $respList - } + $respList + } } \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraApplication.ps1 b/module/Entra/customizations/Get-EntraApplication.ps1 index 45666941c..1cd8abe98 100644 --- a/module/Entra/customizations/Get-EntraApplication.ps1 +++ b/module/Entra/customizations/Get-EntraApplication.ps1 @@ -9,158 +9,162 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Alias('ObjectId')] - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $ApplicationId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $SearchString, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias('ObjectId')] + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $ApplicationId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $SearchString, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) - PROCESS { - $params = @{} - $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand - $keysChanged = @{SearchString = "Filter"; ApplicationId = "Id"} - if($null -ne $PSBoundParameters["SearchString"]) - { - $TmpValue = $PSBoundParameters["SearchString"] - $Value = "displayName eq '$TmpValue' or startswith(displayName,'$TmpValue')" - $params["Filter"] = $Value - } - if($null -ne $PSBoundParameters["ApplicationId"]) - { - $params["ApplicationId"] = $PSBoundParameters["ApplicationId"] - } - if($null -ne $PSBoundParameters["Property"]) - { - $params["Property"] = $PSBoundParameters["Property"] - } - if($null -ne $PSBoundParameters["Filter"]) - { - $TmpValue = $PSBoundParameters["Filter"] - foreach($i in $keysChanged.GetEnumerator()){ - $TmpValue = $TmpValue.Replace($i.Key, $i.Value) - } - $Value = $TmpValue - $params["Filter"] = $Value - } - if($PSBoundParameters.ContainsKey("Verbose")) - { - $params["Verbose"] = $PSBoundParameters["Verbose"] - } - if($null -ne $PSBoundParameters["All"]) - { - if($PSBoundParameters["All"]) - { - $params["All"] = $PSBoundParameters["All"] + PROCESS { + $params = @{} + $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand + $keysChanged = @{SearchString = "Filter"; ApplicationId = "Id"} + + if ($null -ne $PSBoundParameters["SearchString"]) { + $TmpValue = $PSBoundParameters["SearchString"] + $Value = "displayName eq '$TmpValue' or startswith(displayName,'$TmpValue')" + $params["Filter"] = $Value + } + + if ($null -ne $PSBoundParameters["ApplicationId"]) { + $params["ApplicationId"] = $PSBoundParameters["ApplicationId"] } - } - if($PSBoundParameters.ContainsKey("Debug")) - { - $params["Debug"] = $PSBoundParameters["Debug"] - } - if($PSBoundParameters.ContainsKey("Top")) - { - $params["Top"] = $PSBoundParameters["Top"] - } - if($null -ne $PSBoundParameters["WarningVariable"]) - { - $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] - } - if($null -ne $PSBoundParameters["InformationVariable"]) - { - $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] - } - if($null -ne $PSBoundParameters["InformationAction"]) - { - $params["InformationAction"] = $PSBoundParameters["InformationAction"] - } - if($null -ne $PSBoundParameters["OutVariable"]) - { - $params["OutVariable"] = $PSBoundParameters["OutVariable"] - } - if($null -ne $PSBoundParameters["OutBuffer"]) - { - $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] - } - if($null -ne $PSBoundParameters["ErrorVariable"]) - { - $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] - } - if($null -ne $PSBoundParameters["PipelineVariable"]) - { - $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] - } - if($null -ne $PSBoundParameters["ErrorAction"]) - { - $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] - } - if($null -ne $PSBoundParameters["WarningAction"]) - { - $params["WarningAction"] = $PSBoundParameters["WarningAction"] - } - Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"`$_ : `$(`$params[`$_])" } | Write-Debug - Write-Debug("=========================================================================`n") - - $response = Get-MgApplication @params -Headers $customHeaders - $response | ForEach-Object { - if($null -ne $_) { - Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id - Add-Member -InputObject $_ -MemberType AliasProperty -Name DeletionTimestamp -Value DeletedDateTime - Add-Member -InputObject $_ -MemberType AliasProperty -Name InformationalUrls -Value Info - $propsToConvert = @( - 'AddIns','Logo','AppRoles','GroupMembershipClaims','IdentifierUris','Info', - 'IsDeviceOnlyAuthSupported','KeyCredentials','Oauth2RequirePostResponse','OptionalClaims', - 'ParentalControlSettings','PasswordCredentials','Api','PublicClient', - 'PublisherDomain','Web','RequiredResourceAccess','SignInAudience') - try { - foreach ($prop in $propsToConvert) { - if($prop -eq 'AppRoles'){ - $myAppRoles = New-Object System.Collections.Generic.List[Microsoft.Open.AzureAD.Model.AppRole] - foreach ($appRole in $_.$prop) { - $hash = New-Object Microsoft.Open.AzureAD.Model.AppRole - foreach ($propertyName in $hash.psobject.Properties.Name) { - $hash.$propertyName = $appRole.$propertyName + if ($null -ne $PSBoundParameters["Property"]) { + $params["Property"] = $PSBoundParameters["Property"] + } + + if ($null -ne $PSBoundParameters["Filter"]) { + $TmpValue = $PSBoundParameters["Filter"] + foreach ($i in $keysChanged.GetEnumerator()) { + $TmpValue = $TmpValue.Replace($i.Key, $i.Value) + } + $Value = $TmpValue + $params["Filter"] = $Value + } + + if ($PSBoundParameters.ContainsKey("Verbose")) { + $params["Verbose"] = $PSBoundParameters["Verbose"] + } + + if ($null -ne $PSBoundParameters["All"]) { + if ($PSBoundParameters["All"]) { + $params["All"] = $PSBoundParameters["All"] + } + } + + if ($PSBoundParameters.ContainsKey("Debug")) { + $params["Debug"] = $PSBoundParameters["Debug"] + } + + if ($PSBoundParameters.ContainsKey("Top")) { + $params["Top"] = $PSBoundParameters["Top"] + } + + if ($null -ne $PSBoundParameters["WarningVariable"]) { + $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] + } + + if ($null -ne $PSBoundParameters["InformationVariable"]) { + $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] + } + + if ($null -ne $PSBoundParameters["InformationAction"]) { + $params["InformationAction"] = $PSBoundParameters["InformationAction"] + } + + if ($null -ne $PSBoundParameters["OutVariable"]) { + $params["OutVariable"] = $PSBoundParameters["OutVariable"] + } + + if ($null -ne $PSBoundParameters["OutBuffer"]) { + $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] + } + + if ($null -ne $PSBoundParameters["ErrorVariable"]) { + $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] + } + + if ($null -ne $PSBoundParameters["PipelineVariable"]) { + $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] + } + + if ($null -ne $PSBoundParameters["ErrorAction"]) { + $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] + } + + if ($null -ne $PSBoundParameters["WarningAction"]) { + $params["WarningAction"] = $PSBoundParameters["WarningAction"] + } + + Write-Debug("============================ TRANSFORMATIONS ============================") + $params.Keys | ForEach-Object { "`$_ : `$($params[`$_])" } | Write-Debug + Write-Debug("=========================================================================`n") + + $response = Get-MgApplication @params -Headers $customHeaders + $response | ForEach-Object { + if ($null -ne $_) { + Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id + Add-Member -InputObject $_ -MemberType AliasProperty -Name DeletionTimestamp -Value DeletedDateTime + Add-Member -InputObject $_ -MemberType AliasProperty -Name InformationalUrls -Value Info + $propsToConvert = @( + 'AddIns', 'Logo', 'AppRoles', 'GroupMembershipClaims', 'IdentifierUris', 'Info', + 'IsDeviceOnlyAuthSupported', 'KeyCredentials', 'Oauth2RequirePostResponse', 'OptionalClaims', + 'ParentalControlSettings', 'PasswordCredentials', 'Api', 'PublicClient', + 'PublisherDomain', 'Web', 'RequiredResourceAccess', 'SignInAudience' + ) + try { + foreach ($prop in $propsToConvert) { + if ($prop -eq 'AppRoles') { + $myAppRoles = New-Object System.Collections.Generic.List[Microsoft.Open.AzureAD.Model.AppRole] + foreach ($appRole in $_.$prop) { + $hash = New-Object Microsoft.Open.AzureAD.Model.AppRole + foreach ($propertyName in $hash.psobject.Properties.Name) { + $hash.$propertyName = $appRole.$propertyName + } + $myAppRoles.Add($hash) } - $myAppRoles.Add($hash) + $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($myAppRoles) -Force + } else { + $value = $_.$prop | ConvertTo-Json -Depth 10 | ConvertFrom-Json + $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($value) -Force } - $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($myAppRoles) -Force - } - else { - $value = $_.$prop | ConvertTo-Json -Depth 10 | ConvertFrom-Json - $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($value) -Force } - } - } - catch {} - } - foreach ($credType in @('KeyCredentials', 'PasswordCredentials')) { - if ($null -ne $_.PSObject.Properties[$credType]) { - $_.$credType | ForEach-Object { - try { - if ($null -ne $_.EndDateTime -or $null -ne $_.StartDateTime) { - Add-Member -InputObject $_ -MemberType NoteProperty -Name EndDate -Value $_.EndDateTime - Add-Member -InputObject $_ -MemberType NoteProperty -Name StartDate -Value $_.StartDateTime - $_.PSObject.Properties.Remove('EndDateTime') - $_.PSObject.Properties.Remove('StartDateTime') - } + } catch {} + } + foreach ($credType in @('KeyCredentials', 'PasswordCredentials')) { + if ($null -ne $_.PSObject.Properties[$credType]) { + $_.$credType | ForEach-Object { + try { + if ($null -ne $_.EndDateTime -or $null -ne $_.StartDateTime) { + Add-Member -InputObject $_ -MemberType NoteProperty -Name EndDate -Value $_.EndDateTime + Add-Member -InputObject $_ -MemberType NoteProperty -Name StartDate -Value $_.StartDateTime + $_.PSObject.Properties.Remove('EndDateTime') + $_.PSObject.Properties.Remove('StartDateTime') + } + } catch {} } - catch {} } } } - } - $response -} + $response + } '@ -} +} \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraApplicationOwner.ps1 b/module/Entra/customizations/Get-EntraApplicationOwner.ps1 index 3a2baf1e3..f8db34fca 100644 --- a/module/Entra/customizations/Get-EntraApplicationOwner.ps1 +++ b/module/Entra/customizations/Get-EntraApplicationOwner.ps1 @@ -9,54 +9,64 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $ApplicationId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $ApplicationId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $topCount = $null $baseUri = 'https://graph.microsoft.com/v1.0/applications' $properties = '$select=*' - $Method = "GET" - if($null -ne $PSBoundParameters["Property"]) - { + $Method = "GET" + + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" } - if($null -ne $PSBoundParameters["ApplicationId"]) - { + + if ($null -ne $PSBoundParameters["ApplicationId"]) { $params["ApplicationId"] = $PSBoundParameters["ApplicationId"] $URI = "$baseUri/$($params.ApplicationId)/owners?$properties" } - if($null -ne $PSBoundParameters["All"]) - { + + if ($null -ne $PSBoundParameters["All"]) { $URI = "$baseUri/$($params.ApplicationId)/owners?$properties" } - if($PSBoundParameters.ContainsKey("Top")) - { + + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] $URI = "$baseUri/$($params.ApplicationId)/owners?`$top=$topCount&$properties" } + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") + $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method).value $response = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json + $response | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id } } - if($response){ + + if ($response) { $userList = @() foreach ($data in $response) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject diff --git a/module/Entra/customizations/Get-EntraApplicationPasswordCredential.ps1 b/module/Entra/customizations/Get-EntraApplicationPasswordCredential.ps1 index 0a59c1ece..a957a3218 100644 --- a/module/Entra/customizations/Get-EntraApplicationPasswordCredential.ps1 +++ b/module/Entra/customizations/Get-EntraApplicationPasswordCredential.ps1 @@ -9,17 +9,18 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = '')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $ApplicationId, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $ApplicationId, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $params["Property"] = $PSBoundParameters["Property"] } @@ -27,11 +28,9 @@ $response = (Get-MgApplication -Headers $customHeaders -ApplicationId $PSBoundParameters["ApplicationId"]).PasswordCredentials - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $response | Select-Object $PSBoundParameters["Property"] - } - else { + } else { $response } '@ diff --git a/module/Entra/customizations/Get-EntraContact.ps1 b/module/Entra/customizations/Get-EntraContact.ps1 index 85e240103..15d8a76b0 100644 --- a/module/Entra/customizations/Get-EntraContact.ps1 +++ b/module/Entra/customizations/Get-EntraContact.ps1 @@ -6,102 +6,108 @@ TargetName = $null Parameters = $null outputs = $null - CustomScript = @' + CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $OrgContactId, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property - ) - PROCESS { + [Alias('ObjectId')] + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $OrgContactId, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property + ) + + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $keysChanged = @{OrgContactId = "Id"} - if($null -ne $PSBoundParameters["OrgContactId"]) - { + + if ($null -ne $PSBoundParameters["OrgContactId"]) { $params["OrgContactId"] = $PSBoundParameters["OrgContactId"] } - if($null -ne $PSBoundParameters["Filter"]) - { + + if ($null -ne $PSBoundParameters["Filter"]) { $TmpValue = $PSBoundParameters["Filter"] - foreach($i in $keysChanged.GetEnumerator()){ + foreach ($i in $keysChanged.GetEnumerator()) { $TmpValue = $TmpValue.Replace($i.Key, $i.Value) } $Value = $TmpValue $params["Filter"] = $Value } - if($PSBoundParameters.ContainsKey("Verbose")) - { + + if ($PSBoundParameters.ContainsKey("Verbose")) { $params["Verbose"] = $PSBoundParameters["Verbose"] } - if($null -ne $PSBoundParameters["All"]) - { - if($PSBoundParameters["All"]) - { + + if ($null -ne $PSBoundParameters["All"]) { + if ($PSBoundParameters["All"]) { $params["All"] = $PSBoundParameters["All"] } } - if($PSBoundParameters.ContainsKey("Debug")) - { + + if ($PSBoundParameters.ContainsKey("Debug")) { $params["Debug"] = $PSBoundParameters["Debug"] } - if($PSBoundParameters.ContainsKey("Top")) - { + + if ($PSBoundParameters.ContainsKey("Top")) { $params["Top"] = $PSBoundParameters["Top"] } - if($null -ne $PSBoundParameters["WarningVariable"]) - { + + if ($null -ne $PSBoundParameters["WarningVariable"]) { $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] } - if($null -ne $PSBoundParameters["InformationVariable"]) - { + + if ($null -ne $PSBoundParameters["InformationVariable"]) { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } - if($null -ne $PSBoundParameters["InformationAction"]) - { + + if ($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } - if($null -ne $PSBoundParameters["OutVariable"]) - { + + if ($null -ne $PSBoundParameters["OutVariable"]) { $params["OutVariable"] = $PSBoundParameters["OutVariable"] } - if($null -ne $PSBoundParameters["OutBuffer"]) - { + + if ($null -ne $PSBoundParameters["OutBuffer"]) { $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] } - if($null -ne $PSBoundParameters["ErrorVariable"]) - { + + if ($null -ne $PSBoundParameters["ErrorVariable"]) { $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] } - if($null -ne $PSBoundParameters["PipelineVariable"]) - { + + if ($null -ne $PSBoundParameters["PipelineVariable"]) { $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] } - if($null -ne $PSBoundParameters["ErrorAction"]) - { + + if ($null -ne $PSBoundParameters["ErrorAction"]) { $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] } - if($null -ne $PSBoundParameters["WarningAction"]) - { + + if ($null -ne $PSBoundParameters["WarningAction"]) { $params["WarningAction"] = $PSBoundParameters["WarningAction"] } - if($null -ne $PSBoundParameters["Property"]) - { + + if ($null -ne $PSBoundParameters["Property"]) { $params["Property"] = $PSBoundParameters["Property"] } - + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - + $response = Get-MgContact @params -Headers $customHeaders $response | ForEach-Object { if ($null -ne $_) { @@ -112,7 +118,7 @@ Add-Member -InputObject $_ -MemberType AliasProperty -Name Mobile -Value Phones Add-Member -InputObject $_ -MemberType AliasProperty -Name ProvisioningErrors -Value ServiceProvisioningErrors Add-Member -InputObject $_ -MemberType AliasProperty -Name TelephoneNumber -Value Phones - $propsToConvert = @('Addresses','Manager','Phones') + $propsToConvert = @('Addresses', 'Manager', 'Phones') foreach ($prop in $propsToConvert) { $value = $_.$prop | ConvertTo-Json -Depth 10 | ConvertFrom-Json $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($value) -Force @@ -120,6 +126,6 @@ } } $response - } + } '@ } \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraDeletedGroup.ps1 b/module/Entra/customizations/Get-EntraDeletedGroup.ps1 index de79e5f03..1e7cb5e2f 100644 --- a/module/Entra/customizations/Get-EntraDeletedGroup.ps1 +++ b/module/Entra/customizations/Get-EntraDeletedGroup.ps1 @@ -9,121 +9,105 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter, - - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - - [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $SearchString, - [Alias('Id')] - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $GroupId, - - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $SearchString, + + [Alias('Id')] + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $GroupId, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) - PROCESS { + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $keysChanged = @{SearchString = "Filter"} - if ($null -ne $PSBoundParameters["PipelineVariable"]) - { + + if ($null -ne $PSBoundParameters["PipelineVariable"]) { $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] } - if ($null -ne $PSBoundParameters["ProgressAction"]) - { + if ($null -ne $PSBoundParameters["ProgressAction"]) { $params["ProgressAction"] = $PSBoundParameters["ProgressAction"] } - if($PSBoundParameters.ContainsKey("Debug")) - { + if ($PSBoundParameters.ContainsKey("Debug")) { $params["Debug"] = $PSBoundParameters["Debug"] } - if ($null -ne $PSBoundParameters["WarningAction"]) - { + if ($null -ne $PSBoundParameters["WarningAction"]) { $params["WarningAction"] = $PSBoundParameters["WarningAction"] } - if ($null -ne $PSBoundParameters["ErrorVariable"]) - { + if ($null -ne $PSBoundParameters["ErrorVariable"]) { $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] } - if($null -ne $PSBoundParameters["Filter"]) - { + if ($null -ne $PSBoundParameters["Filter"]) { $TmpValue = $PSBoundParameters["Filter"] - foreach($i in $keysChanged.GetEnumerator()){ + foreach ($i in $keysChanged.GetEnumerator()) { $TmpValue = $TmpValue.Replace($i.Key, $i.Value) } $Value = $TmpValue $params["Filter"] = $Value } - if($PSBoundParameters.ContainsKey("Verbose")) - { + if ($PSBoundParameters.ContainsKey("Verbose")) { $params["Verbose"] = $PSBoundParameters["Verbose"] } - if ($null -ne $PSBoundParameters["ErrorAction"]) - { + if ($null -ne $PSBoundParameters["ErrorAction"]) { $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] } - if ($null -ne $PSBoundParameters["InformationAction"]) - { + if ($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } - if($null -ne $PSBoundParameters["All"]) - { - if($PSBoundParameters["All"]) - { + if ($null -ne $PSBoundParameters["All"]) { + if ($PSBoundParameters["All"]) { $params["All"] = $PSBoundParameters["All"] } } - if ($null -ne $PSBoundParameters["WarningVariable"]) - { + if ($null -ne $PSBoundParameters["WarningVariable"]) { $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] } - if ($null -ne $PSBoundParameters["InformationVariable"]) - { + if ($null -ne $PSBoundParameters["InformationVariable"]) { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } - if($null -ne $PSBoundParameters["SearchString"]) - { + if ($null -ne $PSBoundParameters["SearchString"]) { $TmpValue = $PSBoundParameters["SearchString"] - $Value = "mailNickName eq '$TmpValue' or (mail eq '$TmpValue' or (displayName eq '$TmpValue' or startswith(displayName,'$TmpValue')))" + $Value = "mailNickName eq '$TmpValue' or (mail eq '$TmpValue' or (displayName eq '$TmpValue' or startswith(displayName,'$TmpValue')))" $params["Filter"] = $Value } - if ($null -ne $PSBoundParameters["GroupId"]) - { + if ($null -ne $PSBoundParameters["GroupId"]) { $params["DirectoryObjectId"] = $PSBoundParameters["GroupId"] } - if ($null -ne $PSBoundParameters["OutBuffer"]) - { + if ($null -ne $PSBoundParameters["OutBuffer"]) { $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] } - if ($null -ne $PSBoundParameters["OutVariable"]) - { + if ($null -ne $PSBoundParameters["OutVariable"]) { $params["OutVariable"] = $PSBoundParameters["OutVariable"] } - if ($PSBoundParameters.ContainsKey("Top")) - { + if ($PSBoundParameters.ContainsKey("Top")) { $params["Top"] = $PSBoundParameters["Top"] } - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $params["Property"] = $PSBoundParameters["Property"] } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - + $response = Get-MgDirectoryDeletedItemAsGroup @params -Headers $customHeaders $response | ForEach-Object { - if($null -ne $_) { - Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id - + if ($null -ne $_) { + Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id } } $response diff --git a/module/Entra/customizations/Get-EntraDeviceRegisteredOwner.ps1 b/module/Entra/customizations/Get-EntraDeviceRegisteredOwner.ps1 index 220782474..d4c71c73d 100644 --- a/module/Entra/customizations/Get-EntraDeviceRegisteredOwner.ps1 +++ b/module/Entra/customizations/Get-EntraDeviceRegisteredOwner.ps1 @@ -9,50 +9,59 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $DeviceId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $DeviceId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $topCount = $null $baseUri = 'https://graph.microsoft.com/v1.0/devices' $properties = '$select=*' - $Method = "GET" - if($null -ne $PSBoundParameters["Property"]) - { + $Method = "GET" + + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" } - if($null -ne $PSBoundParameters["DeviceId"]) - { + + if ($null -ne $PSBoundParameters["DeviceId"]) { $params["DeviceId"] = $PSBoundParameters["DeviceId"] $URI = "$baseUri/$($params.DeviceId)/registeredOwners?$properties" } - if($null -ne $PSBoundParameters["All"]) - { + + if ($null -ne $PSBoundParameters["All"]) { $URI = "$baseUri/$($params.DeviceId)/registeredOwners?$properties" } - if($PSBoundParameters.ContainsKey("Top")) - { + + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] $URI = "$baseUri/$($params.DeviceId)/registeredOwners?`$top=$topCount&$properties" } + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") + $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method).value $response = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json + $response | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id Add-Member -InputObject $_ -MemberType AliasProperty -Name DeletionTimestamp -Value DeletedDateTime Add-Member -InputObject $_ -MemberType AliasProperty -Name DirSyncEnabled -Value OnPremisesSyncEnabled @@ -65,7 +74,8 @@ Add-Member -InputObject $_ -MemberType AliasProperty -Name UserStateChangedOn -Value ExternalUserStateChangeDateTime } } - if($response){ + + if ($response) { $userList = @() foreach ($data in $response) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject diff --git a/module/Entra/customizations/Get-EntraDeviceRegisteredUser.ps1 b/module/Entra/customizations/Get-EntraDeviceRegisteredUser.ps1 index 345116cf8..eefb0d990 100644 --- a/module/Entra/customizations/Get-EntraDeviceRegisteredUser.ps1 +++ b/module/Entra/customizations/Get-EntraDeviceRegisteredUser.ps1 @@ -9,50 +9,59 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $DeviceId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $DeviceId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $topCount = $null $baseUri = 'https://graph.microsoft.com/v1.0/devices' $properties = '$select=*' - $Method = "GET" - if($null -ne $PSBoundParameters["Property"]) - { + $Method = "GET" + + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" } - if($null -ne $PSBoundParameters["DeviceId"]) - { + + if ($null -ne $PSBoundParameters["DeviceId"]) { $params["DeviceId"] = $PSBoundParameters["DeviceId"] $URI = "$baseUri/$($params.DeviceId)/registeredUsers?$properties" } - if($null -ne $PSBoundParameters["All"]) - { + + if ($null -ne $PSBoundParameters["All"]) { $URI = "$baseUri/$($params.DeviceId)/registeredUsers?$properties" } - if($PSBoundParameters.ContainsKey("Top")) - { + + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] $URI = "$baseUri/$($params.DeviceId)/registeredUsers?`$top=$topCount&$properties" } + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") + $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method).value $response = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json + $response | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id Add-Member -InputObject $_ -MemberType AliasProperty -Name DeletionTimestamp -Value DeletedDateTime Add-Member -InputObject $_ -MemberType AliasProperty -Name DirSyncEnabled -Value OnPremisesSyncEnabled @@ -65,7 +74,8 @@ Add-Member -InputObject $_ -MemberType AliasProperty -Name UserStateChangedOn -Value ExternalUserStateChangeDateTime } } - if($response){ + + if ($response) { $userList = @() foreach ($data in $response) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject diff --git a/module/Entra/customizations/Get-EntraDirectoryRoleDefinition.ps1 b/module/Entra/customizations/Get-EntraDirectoryRoleDefinition.ps1 index 781a5e7e2..bffbe2f0c 100644 --- a/module/Entra/customizations/Get-EntraDirectoryRoleDefinition.ps1 +++ b/module/Entra/customizations/Get-EntraDirectoryRoleDefinition.ps1 @@ -8,122 +8,128 @@ Outputs = $null CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] - param ( - [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $SearchString, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Alias('Id')] - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $UnifiedRoleDefinitionId, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + param ( + [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $SearchString, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias('Id')] + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $UnifiedRoleDefinitionId, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) - PROCESS { + + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $keysChanged = @{SearchString = "Filter"} - if($null -ne $PSBoundParameters["UnifiedRoleDefinitionId"]) - { + + if ($null -ne $PSBoundParameters["UnifiedRoleDefinitionId"]) { $params["UnifiedRoleDefinitionId"] = $PSBoundParameters["UnifiedRoleDefinitionId"] } - if($null -ne $PSBoundParameters["Filter"]) - { + + if ($null -ne $PSBoundParameters["Filter"]) { $TmpValue = $PSBoundParameters["Filter"] - foreach($i in $keysChanged.GetEnumerator()){ + foreach ($i in $keysChanged.GetEnumerator()) { $TmpValue = $TmpValue.Replace($i.Key, $i.Value) } $Value = $TmpValue $params["Filter"] = $Value } - if($PSBoundParameters.ContainsKey("Verbose")) - { + + if ($PSBoundParameters.ContainsKey("Verbose")) { $params["Verbose"] = $PSBoundParameters["Verbose"] } - if($PSBoundParameters.ContainsKey("Debug")) - { + + if ($PSBoundParameters.ContainsKey("Debug")) { $params["Debug"] = $PSBoundParameters["Debug"] } - if($null -ne $PSBoundParameters["All"]) - { - if($PSBoundParameters["All"]) - { + + if ($null -ne $PSBoundParameters["All"]) { + if ($PSBoundParameters["All"]) { $params["All"] = $PSBoundParameters["All"] } } - if($null -ne $PSBoundParameters["SearchString"]) - { + + if ($null -ne $PSBoundParameters["SearchString"]) { $TmpValue = $PSBoundParameters["SearchString"] - $Value = "startswith(displayName,'$TmpValue')" + $Value = "startswith(displayName,'$TmpValue')" $params["Filter"] = $Value } - if($PSBoundParameters.ContainsKey("Top")) - { + + if ($PSBoundParameters.ContainsKey("Top")) { $params["Top"] = $PSBoundParameters["Top"] } - if($null -ne $PSBoundParameters["WarningVariable"]) - { + + if ($null -ne $PSBoundParameters["WarningVariable"]) { $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] } - if($null -ne $PSBoundParameters["InformationVariable"]) - { + + if ($null -ne $PSBoundParameters["InformationVariable"]) { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } - if($null -ne $PSBoundParameters["InformationAction"]) - { + + if ($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } - if($null -ne $PSBoundParameters["OutVariable"]) - { + + if ($null -ne $PSBoundParameters["OutVariable"]) { $params["OutVariable"] = $PSBoundParameters["OutVariable"] } - if($null -ne $PSBoundParameters["OutBuffer"]) - { + + if ($null -ne $PSBoundParameters["OutBuffer"]) { $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] } - if($null -ne $PSBoundParameters["ErrorVariable"]) - { + + if ($null -ne $PSBoundParameters["ErrorVariable"]) { $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] } - if($null -ne $PSBoundParameters["PipelineVariable"]) - { + + if ($null -ne $PSBoundParameters["PipelineVariable"]) { $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] } - if($null -ne $PSBoundParameters["ErrorAction"]) - { + + if ($null -ne $PSBoundParameters["ErrorAction"]) { $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] } - if($null -ne $PSBoundParameters["WarningAction"]) - { + + if ($null -ne $PSBoundParameters["WarningAction"]) { $params["WarningAction"] = $PSBoundParameters["WarningAction"] } - if($null -ne $PSBoundParameters["Property"]) - { + + if ($null -ne $PSBoundParameters["Property"]) { $params["Property"] = $PSBoundParameters["Property"] } - + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - + $response = Get-MgRoleManagementDirectoryRoleDefinition @params -Headers $customHeaders $response | ForEach-Object { - if($null -ne $_) { - $propsToConvert = @('RolePermissions') - foreach ($prop in $propsToConvert) { - $value = $_.$prop | ConvertTo-Json -Depth 10 | ConvertFrom-Json - $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($value) -Force - } - Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id - + if ($null -ne $_) { + $propsToConvert = @('RolePermissions') + foreach ($prop in $propsToConvert) { + $value = $_.$prop | ConvertTo-Json -Depth 10 | ConvertFrom-Json + $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($value) -Force + } + Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id } } - + $response - } + } '@ -} +} \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraDirectoryRoleMember.ps1 b/module/Entra/customizations/Get-EntraDirectoryRoleMember.ps1 index 5bdc239e6..43fbd1f8c 100644 --- a/module/Entra/customizations/Get-EntraDirectoryRoleMember.ps1 +++ b/module/Entra/customizations/Get-EntraDirectoryRoleMember.ps1 @@ -9,36 +9,42 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = '')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $DirectoryRoleId, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $DirectoryRoleId, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $baseUri = 'https://graph.microsoft.com/v1.0/directoryRoles' $properties = '$select=*' $Method = "GET" - if($null -ne $PSBoundParameters["Property"]) - { + + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" } - if($null -ne $PSBoundParameters["DirectoryRoleId"]) - { + + if ($null -ne $PSBoundParameters["DirectoryRoleId"]) { $params["DirectoryRoleId"] = $PSBoundParameters["DirectoryRoleId"] $URI = "$baseUri/$($params.DirectoryRoleId)/members?$properties" } + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") + $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method).value $response = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json + $response | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id Add-Member -InputObject $_ -MemberType AliasProperty -Name DirSyncEnabled -Value OnPremisesSyncEnabled Add-Member -InputObject $_ -MemberType AliasProperty -Name LastDirSyncTime -Value OnPremisesLastSyncDateTime @@ -47,7 +53,8 @@ Add-Member -InputObject $_ -MemberType AliasProperty -Name TelephoneNumber -Value businessPhones } } - if($response){ + + if ($response) { $userList = @() foreach ($data in $response) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject diff --git a/module/Entra/customizations/Get-EntraGroupMember.ps1 b/module/Entra/customizations/Get-EntraGroupMember.ps1 index bedc6e100..1c02a5e7e 100644 --- a/module/Entra/customizations/Get-EntraGroupMember.ps1 +++ b/module/Entra/customizations/Get-EntraGroupMember.ps1 @@ -9,17 +9,23 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $GroupId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $GroupId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) - PROCESS { + + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $topCount = $null @@ -27,51 +33,48 @@ $properties = '$select=*' $Method = "GET" - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" } - if($null -ne $PSBoundParameters["GroupId"]) - { + + if ($null -ne $PSBoundParameters["GroupId"]) { $params["GroupId"] = $PSBoundParameters["GroupId"] $URI = "$baseUri/$($params.GroupId)/members?$properties" } - if($null -ne $PSBoundParameters["All"]) - { + + if ($null -ne $PSBoundParameters["All"]) { $URI = "$baseUri/$($params.GroupId)/members?$properties" } - if($PSBoundParameters.ContainsKey("Top")) - { + + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] if ($topCount -gt 999) { $minTop = 999 $URI = "$baseUri/$($params.GroupId)/members?`$top=999&$properties" - } - else{ + } else { $URI = "$baseUri/$($params.GroupId)/members?`$top=$topCount&$properties" } } - + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - + $response = Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method | ConvertTo-Json -Depth 10 | ConvertFrom-Json $data = $response try { - $data = @($response.value) + $data = @($response.value) $all = $All.IsPresent $increment = $topCount - $data.Count while (($response.'@odata.nextLink' -and (($all -and ($increment -lt 0)) -or $increment -gt 0))) { $URI = $response.'@odata.nextLink' if ($increment -gt 0) { $topValue = [Math]::Min($increment, 999) - if($minTop){ + if ($minTop) { $URI = $URI.Replace("`$top=$minTop", "`$top=$topValue") - } - else{ + } else { $URI = $URI.Replace("`$top=$topCount", "`$top=$topValue") } $increment -= $topValue @@ -79,9 +82,9 @@ $response = Invoke-GraphRequest -Uri $URI -Method $Method $data += $response.value | ConvertTo-Json -Depth 10 | ConvertFrom-Json } - } catch {} + } catch {} $data | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id } } @@ -90,34 +93,32 @@ $URI = "$baseUri/$($params.GroupId)/members/microsoft.graph.servicePrincipal?$properties" $topCount = $Top - $data.count if ($PSBoundParameters.ContainsKey("Top") -and $topCount -gt 0) { - $increment = $topCount - $data.Count - $increment = 1 - $hasNextLink = $false + $increment = $topCount - $data.Count + $increment = 1 + $hasNextLink = $false - do { - $topValue = [Math]::Min($topCount, 999) - $URI = "$baseUri/$($params.GroupId)/members/microsoft.graph.servicePrincipal?`$top=$topValue&$properties" - $response = Invoke-GraphRequest -Uri $URI -Method $Method -Headers $customHeaders + do { + $topValue = [Math]::Min($topCount, 999) + $URI = "$baseUri/$($params.GroupId)/members/microsoft.graph.servicePrincipal?`$top=$topValue&$properties" + $response = Invoke-GraphRequest -Uri $URI -Method $Method -Headers $customHeaders + $serviceprincipal += $response.value | ConvertTo-Json -Depth 10 | ConvertFrom-Json + $hasNextLink = $null -ne $response.PSObject.Properties.Match('@odata.nextLink') + $increment-- + } while ($increment -gt 0 -and $hasNextLink) + } elseif ($null -eq $PSBoundParameters["Top"]) { + $response = Invoke-GraphRequest -Uri $URI -Method $Method -Headers $customHeaders $serviceprincipal += $response.value | ConvertTo-Json -Depth 10 | ConvertFrom-Json - $hasNextLink = $null -ne $response.PSObject.Properties.Match('@odata.nextLink') - $increment-- - } while ($increment -gt 0 -and $hasNextLink) } - elseif($null -eq $PSBoundParameters["Top"]){ - $response = Invoke-GraphRequest -Uri $URI -Method $Method -Headers $customHeaders - $serviceprincipal += $response.value | ConvertTo-Json -Depth 10 | ConvertFrom-Json - } - try{ + try { $serviceprincipal | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType NoteProperty -Name '@odata.type' -Value '#microsoft.graph.servicePrincipal' -Force } } $data += $serviceprincipal - } - catch {} + } catch {} } - if($data){ + if ($data) { $userList = @() foreach ($response in $data) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject @@ -131,8 +132,8 @@ } $userList += $userType } - $userList + $userList } - } + } '@ } \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraGroupOwner.ps1 b/module/Entra/customizations/Get-EntraGroupOwner.ps1 index c2e988b3e..f52297086 100644 --- a/module/Entra/customizations/Get-EntraGroupOwner.ps1 +++ b/module/Entra/customizations/Get-EntraGroupOwner.ps1 @@ -9,54 +9,64 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $GroupId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $GroupId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $topCount = $null $baseUri = 'https://graph.microsoft.com/v1.0/groups' $properties = '$select=*' - $Method = "GET" - if($null -ne $PSBoundParameters["Property"]) - { + $Method = "GET" + + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" } - if($null -ne $PSBoundParameters["GroupId"]) - { + + if ($null -ne $PSBoundParameters["GroupId"]) { $params["GroupId"] = $PSBoundParameters["GroupId"] $URI = "$baseUri/$($params.GroupId)/owners?$properties" } - if($null -ne $PSBoundParameters["All"]) - { + + if ($null -ne $PSBoundParameters["All"]) { $URI = "$baseUri/$($params.GroupId)/owners?$properties" } - if($PSBoundParameters.ContainsKey("Top")) - { + + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] $URI = "$baseUri/$($params.GroupId)/owners?`$top=$topCount&$properties" } + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") + $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method).value $response = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json + $response | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id } } - if($response){ + + if ($response) { $userList = @() foreach ($data in $response) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject diff --git a/module/Entra/customizations/Get-EntraServicePrincipalOwner.ps1 b/module/Entra/customizations/Get-EntraServicePrincipalOwner.ps1 index 0e5c5b3b4..1db67c202 100644 --- a/module/Entra/customizations/Get-EntraServicePrincipalOwner.ps1 +++ b/module/Entra/customizations/Get-EntraServicePrincipalOwner.ps1 @@ -9,103 +9,93 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Alias("ObjectId")] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $ServicePrincipalId, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable[System.Int32]] $Top, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("ObjectId")] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $ServicePrincipalId, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) - PROCESS { + PROCESS { $params = @{} - $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand - if($PSBoundParameters.ContainsKey("Verbose")) - { + $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand + + if ($PSBoundParameters.ContainsKey("Verbose")) { $params["Verbose"] = $PSBoundParameters["Verbose"] } - if($null -ne $PSBoundParameters["ServicePrincipalId"]) - { + if ($null -ne $PSBoundParameters["ServicePrincipalId"]) { $params["ServicePrincipalId"] = $PSBoundParameters["ServicePrincipalId"] } - if($null -ne $PSBoundParameters["All"]) - { - if($PSBoundParameters["All"]) - { + if ($null -ne $PSBoundParameters["All"]) { + if ($PSBoundParameters["All"]) { $params["All"] = $PSBoundParameters["All"] } } - if($PSBoundParameters.ContainsKey("Debug")) - { + if ($PSBoundParameters.ContainsKey("Debug")) { $params["Debug"] = $PSBoundParameters["Debug"] } - if($PSBoundParameters.ContainsKey("Top")) - { + if ($PSBoundParameters.ContainsKey("Top")) { $params["Top"] = $PSBoundParameters["Top"] - } - if($null -ne $PSBoundParameters["WarningVariable"]) - { + } + if ($null -ne $PSBoundParameters["WarningVariable"]) { $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] } - if($null -ne $PSBoundParameters["InformationVariable"]) - { + if ($null -ne $PSBoundParameters["InformationVariable"]) { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } - if($null -ne $PSBoundParameters["InformationAction"]) - { + if ($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } - if($null -ne $PSBoundParameters["OutVariable"]) - { + if ($null -ne $PSBoundParameters["OutVariable"]) { $params["OutVariable"] = $PSBoundParameters["OutVariable"] } - if($null -ne $PSBoundParameters["OutBuffer"]) - { + if ($null -ne $PSBoundParameters["OutBuffer"]) { $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] } - if($null -ne $PSBoundParameters["ErrorVariable"]) - { + if ($null -ne $PSBoundParameters["ErrorVariable"]) { $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] } - if($null -ne $PSBoundParameters["PipelineVariable"]) - { + if ($null -ne $PSBoundParameters["PipelineVariable"]) { $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] } - if($null -ne $PSBoundParameters["ErrorAction"]) - { + if ($null -ne $PSBoundParameters["ErrorAction"]) { $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] } - if($null -ne $PSBoundParameters["WarningAction"]) - { + if ($null -ne $PSBoundParameters["WarningAction"]) { $params["WarningAction"] = $PSBoundParameters["WarningAction"] } - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $params["Property"] = $PSBoundParameters["Property"] } - + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - + $response = Get-MgServicePrincipalOwner @params -Headers $customHeaders $response | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -NotePropertyMembers $_.AdditionalProperties Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id - $propsToConvert = @('appRoles','oauth2PermissionScopes') - try{ + $propsToConvert = @('appRoles', 'oauth2PermissionScopes') + try { foreach ($prop in $propsToConvert) { $value = $_.$prop | ConvertTo-Json -Depth 10 | ConvertFrom-Json $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($value) -Force } - }catch{} + } catch {} } } $response - } + } '@ } \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraSubscribedSku.ps1 b/module/Entra/customizations/Get-EntraSubscribedSku.ps1 index cd046d7f6..cd3e37d5e 100644 --- a/module/Entra/customizations/Get-EntraSubscribedSku.ps1 +++ b/module/Entra/customizations/Get-EntraSubscribedSku.ps1 @@ -9,72 +9,61 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $SubscribedSkuId, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $SubscribedSkuId, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand - if($PSBoundParameters.ContainsKey("Verbose")) - { + if ($PSBoundParameters.ContainsKey("Verbose")) { $params["Verbose"] = $PSBoundParameters["Verbose"] } - if($null -ne $PSBoundParameters["SubscribedSkuId"]) - { + if ($null -ne $PSBoundParameters["SubscribedSkuId"]) { $params["SubscribedSkuId"] = $PSBoundParameters["SubscribedSkuId"] } - if($PSBoundParameters.ContainsKey("Debug")) - { + if ($PSBoundParameters.ContainsKey("Debug")) { $params["Debug"] = $PSBoundParameters["Debug"] } - if($null -ne $PSBoundParameters["WarningVariable"]) - { + if ($null -ne $PSBoundParameters["WarningVariable"]) { $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] } - if($null -ne $PSBoundParameters["InformationVariable"]) - { + if ($null -ne $PSBoundParameters["InformationVariable"]) { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } - if($null -ne $PSBoundParameters["InformationAction"]) - { + if ($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } - if($null -ne $PSBoundParameters["OutVariable"]) - { + if ($null -ne $PSBoundParameters["OutVariable"]) { $params["OutVariable"] = $PSBoundParameters["OutVariable"] } - if($null -ne $PSBoundParameters["OutBuffer"]) - { + if ($null -ne $PSBoundParameters["OutBuffer"]) { $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] } - if($null -ne $PSBoundParameters["ErrorVariable"]) - { + if ($null -ne $PSBoundParameters["ErrorVariable"]) { $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] } - if($null -ne $PSBoundParameters["PipelineVariable"]) - { + if ($null -ne $PSBoundParameters["PipelineVariable"]) { $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] } - if($null -ne $PSBoundParameters["ErrorAction"]) - { + if ($null -ne $PSBoundParameters["ErrorAction"]) { $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] } - if($null -ne $PSBoundParameters["WarningAction"]) - { + if ($null -ne $PSBoundParameters["WarningAction"]) { $params["WarningAction"] = $PSBoundParameters["WarningAction"] } - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $params["Property"] = $PSBoundParameters["Property"] } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug - Write-Debug("========================================================================= -") + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug + Write-Debug("=========================================================================`n") $response = Get-MgSubscribedSku @params -Headers $customHeaders $response | ForEach-Object { diff --git a/module/Entra/customizations/Get-EntraUser.ps1 b/module/Entra/customizations/Get-EntraUser.ps1 index 488b21a15..e3ccb5d8d 100644 --- a/module/Entra/customizations/Get-EntraUser.ps1 +++ b/module/Entra/customizations/Get-EntraUser.ps1 @@ -9,19 +9,26 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Alias("ObjectId")] - [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $UserId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $SearchString, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $Filter, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable`1[System.Int32]] $Top, + + [Alias("ObjectId")] + [Parameter(ParameterSetName = "GetById", Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $UserId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Parameter(ParameterSetName = "GetVague", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $SearchString, + + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $Filter, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) PROCESS { @@ -76,7 +83,7 @@ $f = '$' + 'Filter' $params["Uri"] += "&$f=$Filter" } - + Write-Debug("============================ TRANSFORMATIONS ============================") $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") @@ -133,4 +140,4 @@ } } '@ -} +} \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraUserCreatedObject.ps1 b/module/Entra/customizations/Get-EntraUserCreatedObject.ps1 index 700a4be94..a3a5c9d73 100644 --- a/module/Entra/customizations/Get-EntraUserCreatedObject.ps1 +++ b/module/Entra/customizations/Get-EntraUserCreatedObject.ps1 @@ -6,90 +6,81 @@ TargetName = $null Parameters = $null outputs = $null - CustomScript = @' + CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $UserId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $UserId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable`1[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) - PROCESS { + + PROCESS { $params = @{} - $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand - if($PSBoundParameters.ContainsKey("Verbose")) - { + $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand + + if ($PSBoundParameters.ContainsKey("Verbose")) { $params["Verbose"] = $PSBoundParameters["Verbose"] } - if($null -ne $PSBoundParameters["UserId"]) - { + if ($null -ne $PSBoundParameters["UserId"]) { $params["UserId"] = $PSBoundParameters["UserId"] } - if($null -ne $PSBoundParameters["All"]) - { - if($PSBoundParameters["All"]) - { + if ($null -ne $PSBoundParameters["All"]) { + if ($PSBoundParameters["All"]) { $params["All"] = $PSBoundParameters["All"] } } - if($PSBoundParameters.ContainsKey("Debug")) - { + if ($PSBoundParameters.ContainsKey("Debug")) { $params["Debug"] = $PSBoundParameters["Debug"] } - if($PSBoundParameters.ContainsKey("Top")) - { + if ($PSBoundParameters.ContainsKey("Top")) { $params["Top"] = $PSBoundParameters["Top"] } - if($null -ne $PSBoundParameters["WarningVariable"]) - { + if ($null -ne $PSBoundParameters["WarningVariable"]) { $params["WarningVariable"] = $PSBoundParameters["WarningVariable"] } - if($null -ne $PSBoundParameters["InformationVariable"]) - { + if ($null -ne $PSBoundParameters["InformationVariable"]) { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } - if($null -ne $PSBoundParameters["InformationAction"]) - { + if ($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } - if($null -ne $PSBoundParameters["OutVariable"]) - { + if ($null -ne $PSBoundParameters["OutVariable"]) { $params["OutVariable"] = $PSBoundParameters["OutVariable"] } - if($null -ne $PSBoundParameters["OutBuffer"]) - { + if ($null -ne $PSBoundParameters["OutBuffer"]) { $params["OutBuffer"] = $PSBoundParameters["OutBuffer"] } - if($null -ne $PSBoundParameters["ErrorVariable"]) - { + if ($null -ne $PSBoundParameters["ErrorVariable"]) { $params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"] } - if($null -ne $PSBoundParameters["PipelineVariable"]) - { + if ($null -ne $PSBoundParameters["PipelineVariable"]) { $params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"] } - if($null -ne $PSBoundParameters["ErrorAction"]) - { + if ($null -ne $PSBoundParameters["ErrorAction"]) { $params["ErrorAction"] = $PSBoundParameters["ErrorAction"] } - if($null -ne $PSBoundParameters["WarningAction"]) - { + if ($null -ne $PSBoundParameters["WarningAction"]) { $params["WarningAction"] = $PSBoundParameters["WarningAction"] } - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $params["Property"] = $PSBoundParameters["Property"] } - + Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - + $response = Get-MgUserCreatedObject @params -Headers $customHeaders $properties = @{ ObjectId = "Id" @@ -97,8 +88,8 @@ AppOwnerTenantId = "appOwnerOrganizationId" } $response | ForEach-Object { - if($null -ne $_) { - Add-Member -InputObject $_ -NotePropertyMembers $_.AdditionalProperties + if ($null -ne $_) { + Add-Member -InputObject $_ -NotePropertyMembers $_.AdditionalProperties foreach ($prop in $properties.GetEnumerator()) { $propertyName = $prop.Name $propertyValue = $prop.Value @@ -106,19 +97,18 @@ $_ | Add-Member -MemberType AliasProperty -Name $propertyName -Value $propertyValue } } - $propsToConvert = @('keyCredentials','passwordCredentials','requiredResourceAccess') + $propsToConvert = @('keyCredentials', 'passwordCredentials', 'requiredResourceAccess') foreach ($prop in $propsToConvert) { try { - if($_.PSObject.Properties.Match($prop)) { + if ($_.PSObject.Properties.Match($prop)) { $value = $_.$prop | ConvertTo-Json -Depth 10 | ConvertFrom-Json - $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($value) -Force + $_ | Add-Member -MemberType NoteProperty -Name $prop -Value ($value) -Force } - } - catch {} + } catch {} } } } $response - } + } '@ } \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraUserDirectReport.ps1 b/module/Entra/customizations/Get-EntraUserDirectReport.ps1 index 64464f2ec..1d7784945 100644 --- a/module/Entra/customizations/Get-EntraUserDirectReport.ps1 +++ b/module/Entra/customizations/Get-EntraUserDirectReport.ps1 @@ -9,16 +9,22 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $UserId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $UserId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable`1[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand @@ -26,33 +32,29 @@ $baseUri = 'https://graph.microsoft.com/v1.0/users' $properties = '$select=*' $Method = "GET" - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" } - if($null -ne $PSBoundParameters["UserId"]) - { + if ($null -ne $PSBoundParameters["UserId"]) { $params["UserId"] = $PSBoundParameters["UserId"] $URI = "$baseUri/$($params.UserId)/directReports?$properties" } - if($null -ne $PSBoundParameters["All"]) - { + if ($null -ne $PSBoundParameters["All"]) { $URI = "$baseUri/$($params.UserId)/directReports?$properties" } - if($PSBoundParameters.ContainsKey("Top")) - { + if ($PSBoundParameters.ContainsKey("Top")) { $topCount = $PSBoundParameters["Top"] $URI = "$baseUri/$($params.UserId)/directReports?`$top=$topCount&$properties" } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method).value $response = $response | ConvertTo-Json -Depth 10 | ConvertFrom-Json $response | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id Add-Member -InputObject $_ -MemberType AliasProperty -Name DeletionTimestamp -Value DeletedDateTime Add-Member -InputObject $_ -MemberType AliasProperty -Name DirSyncEnabled -Value OnPremisesSyncEnabled @@ -65,7 +67,7 @@ Add-Member -InputObject $_ -MemberType AliasProperty -Name UserStateChangedOn -Value ExternalUserStateChangeDateTime } } - if($response){ + if ($response) { $userList = @() foreach ($data in $response) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject diff --git a/module/Entra/customizations/Get-EntraUserExtension.ps1 b/module/Entra/customizations/Get-EntraUserExtension.ps1 index e486037de..a4dfd34ea 100644 --- a/module/Entra/customizations/Get-EntraUserExtension.ps1 +++ b/module/Entra/customizations/Get-EntraUserExtension.ps1 @@ -7,13 +7,15 @@ Parameters = $null Outputs = $null CustomScript = @' - [CmdletBinding(DefaultParameterSetName = '')] + [CmdletBinding(DefaultParameterSetName = '')] param ( - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [Alias("ObjectId")] - [System.String] $UserId, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [Alias("ObjectId")] + [System.String] $UserId, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) PROCESS { $params = @{} @@ -22,8 +24,7 @@ $properties = '$select=Identities,OnPremisesDistinguishedName,EmployeeId,CreatedDateTime' $params["Uri"] = "$baseUri/?$properties" - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $params["Property"] = $PSBoundParameters["Property"] $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' @@ -32,16 +33,16 @@ } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") - $data = Invoke-GraphRequest -Uri $($params.Uri) -Method GET -Headers $customHeaders | Convertto-json | convertfrom-json + $data = Invoke-GraphRequest -Uri $($params.Uri) -Method GET -Headers $customHeaders | ConvertTo-Json | ConvertFrom-Json $data | ForEach-Object { - if($null -ne $_) { + if ($null -ne $_) { Add-Member -InputObject $_ -MemberType AliasProperty -Name userIdentities -Value identities } } $data } '@ -} +} \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraUserManager.ps1 b/module/Entra/customizations/Get-EntraUserManager.ps1 index 07081c2ff..18be3c237 100644 --- a/module/Entra/customizations/Get-EntraUserManager.ps1 +++ b/module/Entra/customizations/Get-EntraUserManager.ps1 @@ -7,44 +7,44 @@ Parameters = $null outputs = $null CustomScript = @' - [CmdletBinding(DefaultParameterSetName = '')] + [CmdletBinding(DefaultParameterSetName = '')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $UserId, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $UserId, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand $Method = "GET" $keysChanged = @{UserId = "Id"} - if($null -ne $PSBoundParameters["UserId"]) - { + if ($null -ne $PSBoundParameters["UserId"]) { $params["UserId"] = $PSBoundParameters["UserId"] } $URI = "https://graph.microsoft.com/v1.0/users/$($params.UserId)/manager?`$select=*" - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" $URI = "https://graph.microsoft.com/v1.0/users/$($params.UserId)/manager?$properties" } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $response = Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method -ErrorAction Stop try { $response = $response | ConvertTo-Json -Depth 5 | ConvertFrom-Json $response | ForEach-Object { - if($null -ne $_) { - Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id + if ($null -ne $_) { + Add-Member -InputObject $_ -MemberType AliasProperty -Name ObjectId -Value Id } } - if($response){ + if ($response) { $userList = @() foreach ($data in $response) { $userType = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject @@ -57,8 +57,7 @@ } $userList } - } - catch {} + } catch {} } '@ } \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraUserOwnedDevice.ps1 b/module/Entra/customizations/Get-EntraUserOwnedDevice.ps1 index 32cc548da..dae85295c 100644 --- a/module/Entra/customizations/Get-EntraUserOwnedDevice.ps1 +++ b/module/Entra/customizations/Get-EntraUserOwnedDevice.ps1 @@ -9,16 +9,22 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $UserId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $UserId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable`1[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand @@ -53,7 +59,7 @@ { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } - if($null -ne $PSBoundParameters["InformationAction"]) + if($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } @@ -101,6 +107,6 @@ } } $response - } + } '@ } \ No newline at end of file diff --git a/module/Entra/customizations/Get-EntraUserOwnedObject.ps1 b/module/Entra/customizations/Get-EntraUserOwnedObject.ps1 index ce6d5fa78..726729d97 100644 --- a/module/Entra/customizations/Get-EntraUserOwnedObject.ps1 +++ b/module/Entra/customizations/Get-EntraUserOwnedObject.ps1 @@ -9,16 +9,22 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $UserId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $UserId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable`1[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand @@ -27,8 +33,7 @@ } $URI = "/v1.0/users/$($params.UserId)/ownedObjects" - if($null -ne $PSBoundParameters["Property"]) - { + if ($null -ne $PSBoundParameters["Property"]) { $selectProperties = $PSBoundParameters["Property"] $selectProperties = $selectProperties -Join ',' $properties = "`$select=$($selectProperties)" @@ -36,18 +41,18 @@ } Write-Debug("============================ TRANSFORMATIONS ============================") - $params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug + $params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug Write-Debug("=========================================================================`n") $Method = "GET" - $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method).value; + $response = (Invoke-GraphRequest -Headers $customHeaders -Uri $URI -Method $Method).value $Top = $null if ($PSBoundParameters.ContainsKey("Top")) { $Top = $PSBoundParameters["Top"] } - if($null -ne $Top){ + if ($null -ne $Top) { $userList = @() $response | ForEach-Object { if ($null -ne $_ -and $Top -gt 0) { @@ -63,8 +68,7 @@ } } $userList - } - else { + } else { $userList = @() $response | ForEach-Object { if ($null -ne $_) { diff --git a/module/Entra/customizations/Get-EntraUserRegisteredDevice.ps1 b/module/Entra/customizations/Get-EntraUserRegisteredDevice.ps1 index f62ad012d..b22768cc2 100644 --- a/module/Entra/customizations/Get-EntraUserRegisteredDevice.ps1 +++ b/module/Entra/customizations/Get-EntraUserRegisteredDevice.ps1 @@ -9,16 +9,22 @@ CustomScript = @' [CmdletBinding(DefaultParameterSetName = 'GetQuery')] param ( - [Alias('ObjectId')] - [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.String] $UserId, - [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [switch] $All, - [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] - [System.Nullable`1[System.Int32]] $Top, - [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] - [System.String[]] $Property + [Alias('ObjectId')] + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.String] $UserId, + + [Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [switch] $All, + + [Alias("Limit")] + [Parameter(ParameterSetName = "GetQuery", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [System.Nullable`1[System.Int32]] $Top, + + [Alias("Select")] + [Parameter(Mandatory = $false, ValueFromPipeline = $false, ValueFromPipelineByPropertyName = $true)] + [System.String[]] $Property ) + PROCESS { $params = @{} $customHeaders = New-EntraCustomHeaders -Command $MyInvocation.MyCommand @@ -53,7 +59,7 @@ { $params["InformationVariable"] = $PSBoundParameters["InformationVariable"] } - if($null -ne $PSBoundParameters["InformationAction"]) + if($null -ne $PSBoundParameters["InformationAction"]) { $params["InformationAction"] = $PSBoundParameters["InformationAction"] } @@ -101,6 +107,6 @@ } } $response - } + } '@ } \ No newline at end of file diff --git a/module/EntraBeta/AdditionalFunctions/Get-EntraContext.ps1 b/module/EntraBeta/AdditionalFunctions/Get-EntraContext.ps1 index adbf0f323..60bb98dbd 100644 --- a/module/EntraBeta/AdditionalFunctions/Get-EntraContext.ps1 +++ b/module/EntraBeta/AdditionalFunctions/Get-EntraContext.ps1 @@ -66,6 +66,18 @@ function Get-EntraContext { Write-Debug("=========================================================================`n") $response = Get-MgContext @params + if ($null -ne (Get-Module -Name Microsoft.Graph.Entra.Beta)) { + $entraPSVersion = (Get-Module -Name Microsoft.Graph.Entra.Beta | Select-Object -ExpandProperty Version).ToString() + $entraPSModuleName = "Microsoft.Graph.Entra.Beta" + } + elseif ($null -ne (Get-Module -Name Microsoft.Graph.Entra)) { + $entraPSVersion = (Get-Module -Name Microsoft.Graph.Entra | Select-Object -ExpandProperty Version).ToString() + $entraPSModuleName = "Microsoft.Graph.Entra" + } + + $response | Add-Member -MemberType NoteProperty -Name "EntraPowerShellModuleName" -Value $entraPSModuleName -Force + $response | Add-Member -MemberType NoteProperty -Name "EntraPowerShellVersion" -Value $entraPSVersion -Force + $response } } diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAdministrativeUnit.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAdministrativeUnit.md index 0c85fb6da..b78943254 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAdministrativeUnit.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAdministrativeUnit.md @@ -193,7 +193,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAdministrativeUnitMember.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAdministrativeUnitMember.md index f4232506c..0e662e6fe 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAdministrativeUnitMember.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAdministrativeUnitMember.md @@ -151,7 +151,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplication.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplication.md index d8cdda2c3..21ae3d5e9 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplication.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplication.md @@ -232,7 +232,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named @@ -248,7 +248,7 @@ Specifies properties to be returned ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationOwner.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationOwner.md index d023a42ca..e1e4e621b 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationOwner.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationOwner.md @@ -170,7 +170,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -186,7 +186,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationPasswordCredential.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationPasswordCredential.md index acc350cb4..6f8edc6b7 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationPasswordCredential.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationPasswordCredential.md @@ -80,7 +80,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationTemplate.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationTemplate.md index 3ad0d410f..f6e6eed17 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationTemplate.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraApplicationTemplate.md @@ -134,7 +134,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named @@ -150,7 +150,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuditDirectoryLog.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuditDirectoryLog.md index 640ed63b0..04944c7c6 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuditDirectoryLog.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuditDirectoryLog.md @@ -124,7 +124,7 @@ The maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named Default value: None diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuditSignInLog.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuditSignInLog.md index 5f710b7c0..193ec3bf0 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuditSignInLog.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuditSignInLog.md @@ -156,7 +156,7 @@ The maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuthorizationPolicy.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuthorizationPolicy.md index c735ee4d6..fed4152bf 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuthorizationPolicy.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuthorizationPolicy.md @@ -132,7 +132,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraContact.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraContact.md index fb0bcb0cb..8020e665e 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraContact.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraContact.md @@ -196,7 +196,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named @@ -212,7 +212,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeletedGroup.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeletedGroup.md index f6a4c492a..ba43661c6 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeletedGroup.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeletedGroup.md @@ -249,7 +249,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named @@ -265,7 +265,7 @@ Specifies properties to be returned ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeviceRegisteredOwner.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeviceRegisteredOwner.md index 1149f5438..239881a7e 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeviceRegisteredOwner.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeviceRegisteredOwner.md @@ -152,7 +152,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -168,7 +168,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeviceRegisteredUser.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeviceRegisteredUser.md index 810e5ec60..0ceb28de6 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeviceRegisteredUser.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDeviceRegisteredUser.md @@ -138,7 +138,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -154,7 +154,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDirectoryRoleDefinition.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDirectoryRoleDefinition.md index 7fcd4cd5a..057fa6804 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDirectoryRoleDefinition.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDirectoryRoleDefinition.md @@ -193,7 +193,7 @@ Specifies the maximum number of records that this cmdlet gets. The default value ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named @@ -241,7 +241,7 @@ Specifies properties to be returned ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDirectoryRoleMember.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDirectoryRoleMember.md index 3238d3cb0..139099a96 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDirectoryRoleMember.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraDirectoryRoleMember.md @@ -80,7 +80,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraFeatureRolloutPolicy.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraFeatureRolloutPolicy.md index b4dd3a5fd..0c6a54348 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraFeatureRolloutPolicy.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraFeatureRolloutPolicy.md @@ -182,7 +182,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraGroupMember.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraGroupMember.md index ff3f1cfb0..c54103b68 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraGroupMember.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraGroupMember.md @@ -176,7 +176,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -192,7 +192,7 @@ Specifies properties to be returned ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraGroupOwner.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraGroupOwner.md index cdbfe48d7..a4fefb8e0 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraGroupOwner.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraGroupOwner.md @@ -147,7 +147,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -163,7 +163,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraObjectSetting.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraObjectSetting.md index cea3e290c..c847f43f4 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraObjectSetting.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraObjectSetting.md @@ -221,7 +221,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named @@ -237,7 +237,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraPolicy.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraPolicy.md index 77785c64c..1e6d20481 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraPolicy.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraPolicy.md @@ -168,7 +168,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraServicePrincipalOwner.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraServicePrincipalOwner.md index 388473b24..ddc350431 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraServicePrincipalOwner.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraServicePrincipalOwner.md @@ -137,7 +137,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -153,7 +153,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraSubscribedSku.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraSubscribedSku.md index bcf1591a2..eb2ee142a 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraSubscribedSku.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraSubscribedSku.md @@ -205,7 +205,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUser.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUser.md index b0b93e6c3..7a619879c 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUser.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUser.md @@ -385,7 +385,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: GetQuery -Aliases: +Aliases: Limit Required: False Position: Named @@ -401,7 +401,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserCreatedObject.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserCreatedObject.md index 56eb9c60b..d3baf627b 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserCreatedObject.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserCreatedObject.md @@ -137,7 +137,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -153,7 +153,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserDirectReport.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserDirectReport.md index 0a4ea05e0..bd61ec88b 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserDirectReport.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserDirectReport.md @@ -137,7 +137,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -153,7 +153,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserExtension.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserExtension.md index 96b66cd87..4ddd07d8b 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserExtension.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserExtension.md @@ -83,7 +83,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserManager.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserManager.md index a72d6f6dd..e6c0c67f9 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserManager.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserManager.md @@ -116,7 +116,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserOwnedDevice.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserOwnedDevice.md index b6f4ade3c..16b205d16 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserOwnedDevice.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserOwnedDevice.md @@ -128,7 +128,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -144,7 +144,7 @@ Specifies properties to be returned ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserOwnedObject.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserOwnedObject.md index cc4f9de59..c75ef53db 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserOwnedObject.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserOwnedObject.md @@ -170,7 +170,7 @@ Specifies the maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -186,7 +186,7 @@ Specifies properties to be returned. ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named diff --git a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserRegisteredDevice.md b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserRegisteredDevice.md index c58d964a6..1c186f090 100644 --- a/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserRegisteredDevice.md +++ b/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraUserRegisteredDevice.md @@ -127,7 +127,7 @@ Specifies The maximum number of records to return. ```yaml Type: System.Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -143,7 +143,7 @@ Specifies properties to be returned ```yaml Type: System.String[] Parameter Sets: (All) -Aliases: +Aliases: Select Required: False Position: Named