Skip to content

Commit

Permalink
New-AzureADMSApplication GA1.0 and Beta (#273)
Browse files Browse the repository at this point in the history
* New-AzureADMSApplication GA1.0
* New-AzureADMSApplication Beta
* New-AzureADMSApplication refactor: expand additional properties
  • Loading branch information
v-uansari authored Jan 10, 2024
1 parent f64dbc8 commit 28e0a9e
Show file tree
Hide file tree
Showing 2 changed files with 307 additions and 0 deletions.
159 changes: 159 additions & 0 deletions module/AzureAD/customizations/New-AzureADMSApplication.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------
@{
SourceName = "New-AzureADMSApplication"
TargetName = "New-MgApplication"
Parameters = @(
@{
SourceName = "AddIns"
TargetName = "AddIns"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "Api"
TargetName = "Api"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
}
@{
SourceName = "AppRoles"
TargetName = "AppRoles"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$a = @()
$input = $TmpValue
foreach($v in $input)
{
$Temp = $v | ConvertTo-Json
$hash = @{}
(ConvertFrom-Json $Temp).psobject.properties | Foreach { if($null -ne $_.Value){ $hash[$_.Name] = $_.Value }}
$a += $hash
}
$Value = $a
'@
},
@{
SourceName = "InformationalUrl"
TargetName = "Info"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "KeyCredentials"
TargetName = "KeyCredentials"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$a = @()
$input = $TmpValue
foreach($v in $input)
{
$hash = @{
CustomKeyIdentifier= $v.CustomKeyIdentifier
EndDateTime = $v.EndDateTime
Key= $v.Key
StartDateTime= $v.StartDateTime
Type= $v.Type
Usage= $v.Usage
}
$a += $hash
}
$Value = $a
'@
},
@{
SourceName = "OptionalClaims"
TargetName = "OptionalClaims"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "ParentalControlSettings"
TargetName = "ParentalControlSettings"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "PasswordCredentials"
TargetName = "PasswordCredentials"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$a = @()
$input = $TmpValue
foreach($v in $input)
{
$Temp = $v | ConvertTo-Json
$hash = @{}
(ConvertFrom-Json $Temp).psobject.properties | Foreach { if($null -ne $_.Value){ $hash[$_.Name] = $_.Value }}
$a += $hash
}
$Value = $a
'@
},
@{
SourceName = "PublicClient"
TargetName = "PublicClient"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "RequiredResourceAccess"
TargetName = "RequiredResourceAccess"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Value = $TmpValue | ConvertTo-Json
'@
},
@{
SourceName = "Web"
TargetName = "Web"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
}
)
outputs = @(
@{
SourceName = "AdditionalProperties"
TargetName = "AdditionalProperties"
ConversionType = "FlatObject"
SpecialMapping = $null
}
)
CustomScript = $null
}
148 changes: 148 additions & 0 deletions module/AzureADPreview/customizations/New-AzureADMSApplication.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
# ------------------------------------------------------------------------------
@{
SourceName = "New-AzureADMSApplication"
TargetName = "New-MgBetaApplication"
Parameters = @(
@{
SourceName = "Api"
TargetName = "Api"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
}
@{
SourceName = "AppRoles"
TargetName = "AppRoles"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$a = @()
$input = $TmpValue
foreach($v in $input)
{
$Temp = $v | ConvertTo-Json
$hash = @{}
(ConvertFrom-Json $Temp).psobject.properties | Foreach { if($null -ne $_.Value){ $hash[$_.Name] = $_.Value }}
$a += $hash
}
$Value = $a
'@
},
@{
SourceName = "InformationalUrl"
TargetName = "Info"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "KeyCredentials"
TargetName = "KeyCredentials"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$a = @()
$input = $TmpValue
foreach($v in $input)
{
$hash = @{
CustomKeyIdentifier= $v.CustomKeyIdentifier
EndDateTime = $v.EndDateTime
Key= $v.Key
StartDateTime= $v.StartDateTime
Type= $v.Type
Usage= $v.Usage
}
$a += $hash
}
$Value = $a
'@
},
@{
SourceName = "OptionalClaims"
TargetName = "OptionalClaims"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "ParentalControlSettings"
TargetName = "ParentalControlSettings"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "PasswordCredentials"
TargetName = "PasswordCredentials"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$a = @()
$input = $TmpValue
foreach($v in $input)
{
$Temp = $v | ConvertTo-Json
$hash = @{}
(ConvertFrom-Json $Temp).psobject.properties | Foreach { if($null -ne $_.Value){ $hash[$_.Name] = $_.Value }}
$a += $hash
}
$Value = $a
'@
},
@{
SourceName = "PublicClient"
TargetName = "PublicClient"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
},
@{
SourceName = "RequiredResourceAccess"
TargetName = "RequiredResourceAccess"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Value = $TmpValue | ConvertTo-Json
'@
},
@{
SourceName = "Web"
TargetName = "Web"
ConversionType = "ScriptBlock"
SpecialMapping = @'
$Temp = $TmpValue | ConvertTo-Json
$Value = $Temp
'@
}
)
outputs = @(
@{
SourceName = "AdditionalProperties"
TargetName = "AdditionalProperties"
ConversionType = "FlatObject"
SpecialMapping = $null
}
)
CustomScript = $null
}

0 comments on commit 28e0a9e

Please sign in to comment.