@@ -9,15 +9,13 @@ function Set-EntraAppRoleToApplicationUser {
9
9
HelpMessage = " Specify the data source type: 'DatabaseorDirectory', 'SAPCloudIdentity', or 'Generic' which determines the column attribute mapping." ,
10
10
ParameterSetName = ' Default' )]
11
11
[Parameter (Mandatory = $true , ParameterSetName = ' ExportResults' )]
12
- [Parameter (Mandatory = $true , ParameterSetName = ' ValidateAction' )]
13
12
[ValidateSet (" DatabaseorDirectory" , " SAPCloudIdentity" , " Generic" )]
14
13
[string ]$DataSource ,
15
14
16
15
[Parameter (Mandatory = $true ,
17
16
HelpMessage = " Path to the input file containing users, e.g., C:\temp\users.csv" ,
18
17
ParameterSetName = ' Default' )]
19
18
[Parameter (Mandatory = $true , ParameterSetName = ' ExportResults' )]
20
- [Parameter (Mandatory = $true , ParameterSetName = ' ValidateAction' )]
21
19
[ValidateNotNullOrEmpty ()]
22
20
[ValidateScript ({ Test-Path $_ })]
23
21
[System.IO.FileInfo ]$FileName ,
@@ -26,7 +24,6 @@ function Set-EntraAppRoleToApplicationUser {
26
24
HelpMessage = " Name of the application (Service Principal) to assign roles for" ,
27
25
ParameterSetName = ' Default' )]
28
26
[Parameter (Mandatory = $true , ParameterSetName = ' ExportResults' )]
29
- [Parameter (Mandatory = $true , ParameterSetName = ' ValidateAction' )]
30
27
[ValidateNotNullOrEmpty ()]
31
28
[string ]$ApplicationName ,
32
29
@@ -37,10 +34,7 @@ function Set-EntraAppRoleToApplicationUser {
37
34
38
35
[Parameter (Mandatory = $false , ParameterSetName = ' ExportResults' ,
39
36
HelpMessage = " Path for the export file. Defaults to current directory." )]
40
- [System.IO.FileInfo ]$ExportFileName = (Join-Path (Get-Location ) " EntraAppRoleAssignments_$ ( Get-Date - Format ' yyyyMMdd_HHmmss' ) .csv" ),
41
-
42
- [Parameter (Mandatory = $false , ParameterSetName = ' ValidateAction' )]
43
- [switch ]$Validate
37
+ [System.IO.FileInfo ]$ExportFileName = (Join-Path (Get-Location ) " EntraAppRoleAssignments_$ ( Get-Date - Format ' yyyyMMdd_HHmmss' ) .csv" )
44
38
)
45
39
46
40
process {
@@ -136,7 +130,6 @@ function Set-EntraAppRoleToApplicationUser {
136
130
}
137
131
138
132
$newApp = New-EntraApplication @appParams
139
- $validationStatus += " New application will be created with displayName - '$DisplayName '"
140
133
Write-ColoredVerbose " Created new application: $DisplayName "
141
134
142
135
# Create service principal for the application
@@ -327,7 +320,6 @@ function Set-EntraAppRoleToApplicationUser {
327
320
function StartOrchestration {
328
321
329
322
try {
330
- $validationStatus = @ ()
331
323
# Import users from the CSV file
332
324
Write-ColoredVerbose " Importing users from file: $FileName " - Color " Cyan"
333
325
$users = Import-Csv - Path $FileName
0 commit comments