Skip to content

Commit f699430

Browse files
Merge branch 'main' into se-Build-Install-Dependencies
2 parents e99a74f + 908a4d5 commit f699430

File tree

3 files changed

+60
-61
lines changed

3 files changed

+60
-61
lines changed

module/Entra/AdditionalFunctions/Get-EntraContext.ps1

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,64 @@ function Get-EntraContext {
88

99
PROCESS {
1010
$params = @{}
11-
if($null -ne $PSBoundParameters["ErrorAction"])
12-
{
11+
if ($null -ne $PSBoundParameters["ErrorAction"]) {
1312
$params["ErrorAction"] = $PSBoundParameters["ErrorAction"]
1413
}
15-
if($null -ne $PSBoundParameters["PipelineVariable"])
16-
{
14+
if ($null -ne $PSBoundParameters["PipelineVariable"]) {
1715
$params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"]
1816
}
19-
if($null -ne $PSBoundParameters["OutVariable"])
20-
{
17+
if ($null -ne $PSBoundParameters["OutVariable"]) {
2118
$params["OutVariable"] = $PSBoundParameters["OutVariable"]
2219
}
23-
if($null -ne $PSBoundParameters["InformationAction"])
24-
{
20+
if ($null -ne $PSBoundParameters["InformationAction"]) {
2521
$params["InformationAction"] = $PSBoundParameters["InformationAction"]
2622
}
27-
if($null -ne $PSBoundParameters["WarningVariable"])
28-
{
23+
if ($null -ne $PSBoundParameters["WarningVariable"]) {
2924
$params["WarningVariable"] = $PSBoundParameters["WarningVariable"]
3025
}
31-
if($PSBoundParameters.ContainsKey("Verbose"))
32-
{
26+
if ($PSBoundParameters.ContainsKey("Verbose")) {
3327
$params["Verbose"] = $PSBoundParameters["Verbose"]
3428
}
35-
if($PSBoundParameters.ContainsKey("Debug"))
36-
{
29+
if ($PSBoundParameters.ContainsKey("Debug")) {
3730
$params["Debug"] = $PSBoundParameters["Debug"]
3831
}
39-
if($null -ne $PSBoundParameters["Confirm"])
40-
{
32+
if ($null -ne $PSBoundParameters["Confirm"]) {
4133
$params["Confirm"] = $PSBoundParameters["Confirm"]
4234
}
43-
if($null -ne $PSBoundParameters["ErrorVariable"])
44-
{
35+
if ($null -ne $PSBoundParameters["ErrorVariable"]) {
4536
$params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"]
4637
}
47-
if($null -ne $PSBoundParameters["OutBuffer"])
48-
{
38+
if ($null -ne $PSBoundParameters["OutBuffer"]) {
4939
$params["OutBuffer"] = $PSBoundParameters["OutBuffer"]
5040
}
51-
if($null -ne $PSBoundParameters["WarningAction"])
52-
{
41+
if ($null -ne $PSBoundParameters["WarningAction"]) {
5342
$params["WarningAction"] = $PSBoundParameters["WarningAction"]
5443
}
55-
if($null -ne $PSBoundParameters["WhatIf"])
56-
{
44+
if ($null -ne $PSBoundParameters["WhatIf"]) {
5745
$params["WhatIf"] = $PSBoundParameters["WhatIf"]
5846
}
59-
if($null -ne $PSBoundParameters["InformationVariable"])
60-
{
47+
if ($null -ne $PSBoundParameters["InformationVariable"]) {
6148
$params["InformationVariable"] = $PSBoundParameters["InformationVariable"]
6249
}
63-
50+
6451
Write-Debug("============================ TRANSFORMATIONS ============================")
65-
$params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug
52+
$params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug
6653
Write-Debug("=========================================================================`n")
67-
54+
6855
$response = Get-MgContext @params
56+
57+
$module = Get-Module -Name Microsoft.Graph.Entra.Beta -ErrorAction SilentlyContinue
58+
if ($null -eq $module) {
59+
$module = Get-Module -Name Microsoft.Graph.Entra -ErrorAction SilentlyContinue
60+
}
61+
62+
if ($null -ne $module) {
63+
$entraPSVersion = $module.Version.ToString()
64+
$entraPSModuleName = $module.Name
65+
$response | Add-Member -MemberType NoteProperty -Name "EntraPSModuleName" -Value $entraPSModuleName -Force
66+
$response | Add-Member -MemberType NoteProperty -Name "EntraPSVersion" -Value $entraPSVersion -Force
67+
}
68+
6969
$response
7070
}
7171
}

module/EntraBeta/AdditionalFunctions/Get-EntraContext.ps1

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,64 @@ function Get-EntraContext {
88

99
PROCESS {
1010
$params = @{}
11-
if($null -ne $PSBoundParameters["ErrorAction"])
12-
{
11+
if ($null -ne $PSBoundParameters["ErrorAction"]) {
1312
$params["ErrorAction"] = $PSBoundParameters["ErrorAction"]
1413
}
15-
if($null -ne $PSBoundParameters["PipelineVariable"])
16-
{
14+
if ($null -ne $PSBoundParameters["PipelineVariable"]) {
1715
$params["PipelineVariable"] = $PSBoundParameters["PipelineVariable"]
1816
}
19-
if($null -ne $PSBoundParameters["OutVariable"])
20-
{
17+
if ($null -ne $PSBoundParameters["OutVariable"]) {
2118
$params["OutVariable"] = $PSBoundParameters["OutVariable"]
2219
}
23-
if($null -ne $PSBoundParameters["InformationAction"])
24-
{
20+
if ($null -ne $PSBoundParameters["InformationAction"]) {
2521
$params["InformationAction"] = $PSBoundParameters["InformationAction"]
2622
}
27-
if($null -ne $PSBoundParameters["WarningVariable"])
28-
{
23+
if ($null -ne $PSBoundParameters["WarningVariable"]) {
2924
$params["WarningVariable"] = $PSBoundParameters["WarningVariable"]
3025
}
31-
if($PSBoundParameters.ContainsKey("Verbose"))
32-
{
26+
if ($PSBoundParameters.ContainsKey("Verbose")) {
3327
$params["Verbose"] = $PSBoundParameters["Verbose"]
3428
}
35-
if($PSBoundParameters.ContainsKey("Debug"))
36-
{
29+
if ($PSBoundParameters.ContainsKey("Debug")) {
3730
$params["Debug"] = $PSBoundParameters["Debug"]
3831
}
39-
if($null -ne $PSBoundParameters["Confirm"])
40-
{
32+
if ($null -ne $PSBoundParameters["Confirm"]) {
4133
$params["Confirm"] = $PSBoundParameters["Confirm"]
4234
}
43-
if($null -ne $PSBoundParameters["ErrorVariable"])
44-
{
35+
if ($null -ne $PSBoundParameters["ErrorVariable"]) {
4536
$params["ErrorVariable"] = $PSBoundParameters["ErrorVariable"]
4637
}
47-
if($null -ne $PSBoundParameters["OutBuffer"])
48-
{
38+
if ($null -ne $PSBoundParameters["OutBuffer"]) {
4939
$params["OutBuffer"] = $PSBoundParameters["OutBuffer"]
5040
}
51-
if($null -ne $PSBoundParameters["WarningAction"])
52-
{
41+
if ($null -ne $PSBoundParameters["WarningAction"]) {
5342
$params["WarningAction"] = $PSBoundParameters["WarningAction"]
5443
}
55-
if($null -ne $PSBoundParameters["WhatIf"])
56-
{
44+
if ($null -ne $PSBoundParameters["WhatIf"]) {
5745
$params["WhatIf"] = $PSBoundParameters["WhatIf"]
5846
}
59-
if($null -ne $PSBoundParameters["InformationVariable"])
60-
{
47+
if ($null -ne $PSBoundParameters["InformationVariable"]) {
6148
$params["InformationVariable"] = $PSBoundParameters["InformationVariable"]
6249
}
63-
50+
6451
Write-Debug("============================ TRANSFORMATIONS ============================")
65-
$params.Keys | ForEach-Object {"$_ : $($params[$_])" } | Write-Debug
52+
$params.Keys | ForEach-Object { "$_ : $($params[$_])" } | Write-Debug
6653
Write-Debug("=========================================================================`n")
67-
54+
6855
$response = Get-MgContext @params
56+
57+
$module = Get-Module -Name Microsoft.Graph.Entra.Beta -ErrorAction SilentlyContinue
58+
if ($null -eq $module) {
59+
$module = Get-Module -Name Microsoft.Graph.Entra -ErrorAction SilentlyContinue
60+
}
61+
62+
if ($null -ne $module) {
63+
$entraPSVersion = $module.Version.ToString()
64+
$entraPSModuleName = $module.Name
65+
$response | Add-Member -MemberType NoteProperty -Name "EntraPSModuleName" -Value $entraPSModuleName -Force
66+
$response | Add-Member -MemberType NoteProperty -Name "EntraPSVersion" -Value $entraPSVersion -Force
67+
}
68+
6969
$response
7070
}
7171
}

module/EntraBeta/AdditionalFunctions/Update-EntraBetaUserAuthenticationRequirement.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ function Update-EntraBetaUserAuthenticationRequirement {
99
[Alias("ObjectId")]
1010
[System.String] $UserId,
1111

12-
[Parameter(Mandatory = $true, HelpMessage = "Specify the per-user MFA state. Valid values are 'enabled', 'disabled', or 'enforced'.")]
13-
[ValidateSet("enabled", "disabled", "enforced")]
12+
[Parameter(Mandatory = $true, HelpMessage = "Specify the Multi-Factor Authentication (MFA) state for individual users. Valid values include 'Enabled', 'Disabled', and 'Enforced'.")]
1413
[System.String] $PerUserMfaState
1514
)
1615

@@ -23,7 +22,7 @@ function Update-EntraBetaUserAuthenticationRequirement {
2322
if ($null -ne $PSBoundParameters["UserId"]) {
2423
$params["UserId"] = $PSBoundParameters["UserId"]
2524
}
26-
if ($null -ne $PSBoundParameters["CurrentPassword"]) {
25+
if ($null -ne $PSBoundParameters["PerUserMfaState"]) {
2726
$params["PerUserMfaState"] = $PSBoundParameters["PerUserMfaState"]
2827
}
2928

0 commit comments

Comments
 (0)