@@ -6,100 +6,85 @@ function New-EntraServicePrincipalAppRoleAssignment {
6
6
[CmdletBinding (DefaultParameterSetName = ' InvokeByDynamicParameters' )]
7
7
param (
8
8
9
- [Parameter (ParameterSetName = " InvokeByDynamicParameters" , Mandatory = $true )]
10
- [System.String ] $PrincipalId ,
9
+ [Parameter (ParameterSetName = " InvokeByDynamicParameters" , Mandatory = $true )]
10
+ [System.String ] $PrincipalId ,
11
11
12
- [Parameter (ParameterSetName = " InvokeByDynamicParameters" , Mandatory = $true )]
13
- [System.String ] $ResourceId ,
12
+ [Parameter (ParameterSetName = " InvokeByDynamicParameters" , Mandatory = $true )]
13
+ [System.String ] $ResourceId ,
14
14
15
- [Parameter (ParameterSetName = " InvokeByDynamicParameters" , Mandatory = $true )]
16
- [System.String ] $Id ,
15
+ [Parameter (ParameterSetName = " InvokeByDynamicParameters" , Mandatory = $true )]
16
+ [System.String ] $Id ,
17
17
18
- [Parameter (Mandatory = $true , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )]
19
- [System.String ] $ObjectId
18
+ [Parameter (Mandatory = $true , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )]
19
+ [Alias (" ObjectId" )]
20
+ [System.String ] $ServicePrincipalId
20
21
)
21
22
22
23
PROCESS {
23
- $params = @ {}
24
- $customHeaders = New-EntraCustomHeaders - Command $MyInvocation.MyCommand
24
+ $params = @ {}
25
+ $customHeaders = New-EntraCustomHeaders - Command $MyInvocation.MyCommand
25
26
26
- if ($null -ne $PSBoundParameters [" OutVariable" ])
27
- {
28
- $params [" OutVariable" ] = $PSBoundParameters [" OutVariable" ]
29
- }
30
- if ($null -ne $PSBoundParameters [" PrincipalId" ])
31
- {
32
- $params [" PrincipalId" ] = $PSBoundParameters [" PrincipalId" ]
33
- }
34
- if ($PSBoundParameters.ContainsKey (" Debug" ))
35
- {
36
- $params [" Debug" ] = $PSBoundParameters [" Debug" ]
37
- }
38
- if ($null -ne $PSBoundParameters [" PipelineVariable" ])
39
- {
40
- $params [" PipelineVariable" ] = $PSBoundParameters [" PipelineVariable" ]
41
- }
42
- if ($null -ne $PSBoundParameters [" InformationVariable" ])
43
- {
44
- $params [" InformationVariable" ] = $PSBoundParameters [" InformationVariable" ]
45
- }
46
- if ($null -ne $PSBoundParameters [" OutBuffer" ])
47
- {
48
- $params [" OutBuffer" ] = $PSBoundParameters [" OutBuffer" ]
49
- }
50
- if ($null -ne $PSBoundParameters [" ResourceId" ])
51
- {
52
- $params [" ResourceId" ] = $PSBoundParameters [" ResourceId" ]
53
- }
54
- if ($null -ne $PSBoundParameters [" WarningVariable" ])
55
- {
56
- $params [" WarningVariable" ] = $PSBoundParameters [" WarningVariable" ]
57
- }
58
- if ($PSBoundParameters.ContainsKey (" Verbose" ))
59
- {
60
- $params [" Verbose" ] = $PSBoundParameters [" Verbose" ]
61
- }
62
- if ($null -ne $PSBoundParameters [" Id" ])
63
- {
64
- $params [" AppRoleId" ] = $PSBoundParameters [" Id" ]
65
- }
66
- if ($null -ne $PSBoundParameters [" ErrorVariable" ])
67
- {
68
- $params [" ErrorVariable" ] = $PSBoundParameters [" ErrorVariable" ]
69
- }
70
- if ($null -ne $PSBoundParameters [" ErrorAction" ])
71
- {
72
- $params [" ErrorAction" ] = $PSBoundParameters [" ErrorAction" ]
73
- }
74
- if ($null -ne $PSBoundParameters [" ObjectId" ])
75
- {
76
- $params [" ServicePrincipalId" ] = $PSBoundParameters [" ObjectId" ]
77
- }
78
- if ($null -ne $PSBoundParameters [" InformationAction" ])
79
- {
80
- $params [" InformationAction" ] = $PSBoundParameters [" InformationAction" ]
81
- }
82
- if ($null -ne $PSBoundParameters [" WarningAction" ])
83
- {
84
- $params [" WarningAction" ] = $PSBoundParameters [" WarningAction" ]
85
- }
86
- if ($null -ne $PSBoundParameters [" ProgressAction" ])
87
- {
88
- $params [" ProgressAction" ] = $PSBoundParameters [" ProgressAction" ]
89
- }
27
+ if ($null -ne $PSBoundParameters [" OutVariable" ]) {
28
+ $params [" OutVariable" ] = $PSBoundParameters [" OutVariable" ]
29
+ }
30
+ if ($null -ne $PSBoundParameters [" PrincipalId" ]) {
31
+ $params [" PrincipalId" ] = $PSBoundParameters [" PrincipalId" ]
32
+ }
33
+ if ($PSBoundParameters.ContainsKey (" Debug" )) {
34
+ $params [" Debug" ] = $PSBoundParameters [" Debug" ]
35
+ }
36
+ if ($null -ne $PSBoundParameters [" PipelineVariable" ]) {
37
+ $params [" PipelineVariable" ] = $PSBoundParameters [" PipelineVariable" ]
38
+ }
39
+ if ($null -ne $PSBoundParameters [" InformationVariable" ]) {
40
+ $params [" InformationVariable" ] = $PSBoundParameters [" InformationVariable" ]
41
+ }
42
+ if ($null -ne $PSBoundParameters [" OutBuffer" ]) {
43
+ $params [" OutBuffer" ] = $PSBoundParameters [" OutBuffer" ]
44
+ }
45
+ if ($null -ne $PSBoundParameters [" ResourceId" ]) {
46
+ $params [" ResourceId" ] = $PSBoundParameters [" ResourceId" ]
47
+ }
48
+ if ($null -ne $PSBoundParameters [" WarningVariable" ]) {
49
+ $params [" WarningVariable" ] = $PSBoundParameters [" WarningVariable" ]
50
+ }
51
+ if ($PSBoundParameters.ContainsKey (" Verbose" )) {
52
+ $params [" Verbose" ] = $PSBoundParameters [" Verbose" ]
53
+ }
54
+ if ($null -ne $PSBoundParameters [" Id" ]) {
55
+ $params [" AppRoleId" ] = $PSBoundParameters [" Id" ]
56
+ }
57
+ if ($null -ne $PSBoundParameters [" ErrorVariable" ]) {
58
+ $params [" ErrorVariable" ] = $PSBoundParameters [" ErrorVariable" ]
59
+ }
60
+ if ($null -ne $PSBoundParameters [" ErrorAction" ]) {
61
+ $params [" ErrorAction" ] = $PSBoundParameters [" ErrorAction" ]
62
+ }
63
+ if ($null -ne $PSBoundParameters [" ServicePrincipalId" ]) {
64
+ $params [" ServicePrincipalId" ] = $PSBoundParameters [" ServicePrincipalId" ]
65
+ }
66
+ if ($null -ne $PSBoundParameters [" InformationAction" ]) {
67
+ $params [" InformationAction" ] = $PSBoundParameters [" InformationAction" ]
68
+ }
69
+ if ($null -ne $PSBoundParameters [" WarningAction" ]) {
70
+ $params [" WarningAction" ] = $PSBoundParameters [" WarningAction" ]
71
+ }
72
+ if ($null -ne $PSBoundParameters [" ProgressAction" ]) {
73
+ $params [" ProgressAction" ] = $PSBoundParameters [" ProgressAction" ]
74
+ }
90
75
91
- Write-Debug (" ============================ TRANSFORMATIONS ============================" )
92
- $params.Keys | ForEach-Object {" $_ : $ ( $params [$_ ]) " } | Write-Debug
93
- Write-Debug (" =========================================================================`n " )
76
+ Write-Debug (" ============================ TRANSFORMATIONS ============================" )
77
+ $params.Keys | ForEach-Object { " $_ : $ ( $params [$_ ]) " } | Write-Debug
78
+ Write-Debug (" =========================================================================`n " )
94
79
95
- $response = New-MgServicePrincipalAppRoleAssignment @params - Headers $customHeaders
96
- $response | ForEach-Object {
97
- if ($null -ne $_ ) {
98
- Add-Member - InputObject $_ - MemberType AliasProperty - Name ObjectId - Value Id
80
+ $response = New-MgServicePrincipalAppRoleAssignment @params - Headers $customHeaders
81
+ $response | ForEach-Object {
82
+ if ($null -ne $_ ) {
83
+ Add-Member - InputObject $_ - MemberType AliasProperty - Name ObjectId - Value Id
99
84
85
+ }
100
86
}
101
- }
102
- $response
87
+ $response
103
88
}
104
89
}
105
90
0 commit comments