This commit is contained in:
Mikael Karlsson
2022-10-11 20:35:20 +11:00
parent 9c9e46d315
commit d7f2d32771
33 changed files with 2508 additions and 2175 deletions

View File

@@ -10,7 +10,7 @@ This module manages Microsoft Grap fuctions like calling APIs, managing graph ob
#>
function Get-ModuleVersion
{
'3.7.0'
'3.7.2'
}
$global:MSGraphGlobalApps = @(
@@ -2113,7 +2113,12 @@ function Get-GraphFileObjects
}
else
{
$graphObj = (ConvertFrom-Json (Get-Content -LiteralPath $file.FullName -Raw))
$json = Get-Content -LiteralPath $file.FullName -Raw
if($global:Organization.Id)
{
$json = $json -replace "%OrganizationId%",$global:Organization.Id
}
$graphObj = (ConvertFrom-Json $json)
}
$obj = New-Object PSObject -Property @{
@@ -3052,7 +3057,14 @@ function Export-GraphObject
}
$fullPath = ([IO.Path]::Combine($exportFolder, (Remove-InvalidFileNameChars "$($fileName).json")))
$obj | ConvertTo-Json -Depth 50 | Out-File -LiteralPath $fullPath -Force
$json = $obj | ConvertTo-Json -Depth 50
if($global:Organization.Id)
{
$json = $json -replace $global:Organization.Id, "%OrganizationId%"
}
$json | Out-File -LiteralPath $fullPath -Force
if($objectType.PostExportCommand)
{
@@ -3441,6 +3453,11 @@ function Import-GraphObject
$json = Update-JsonForEnvironment $json
}
if($global:Organization.Id)
{
$json = $json -replace "%OrganizationId%",$global:Organization.Id
}
$newObj = (Invoke-GraphRequest -Url $strAPI -Content $json -HttpMethod $method @params)
if($newObj -and $method -eq "POST")