Skip to content

Commit

Permalink
Added Sentinel workload
Browse files Browse the repository at this point in the history
  • Loading branch information
ykuijs committed Sep 18, 2024
1 parent 85fc50c commit 633f19b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/Private/Convert-M365WorkloadName.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $DSC_Workloads = @{
'Planner' = 'Planner'
'PowerPlatform' = 'PP'
'SecurityCompliance' = 'SC'
'Sentinel' = 'Sentinel'
'SharePoint' = 'SPO'
'Teams' = 'Teams'
}
Expand Down
13 changes: 13 additions & 0 deletions source/Public/Add-ModulesToBlobStorage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ function Add-ModulesToBlobStorage

Write-Log -Object 'Upload Microsoft365DSC module dependencies to storage container'

$isPowerShellCore = $PSVersionTable.PSEdition -eq 'Core'

Write-Log -Object "Connecting to storage account '$StorageAccountName'"
$storageAcc = Get-AzStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageAccountName

Expand Down Expand Up @@ -77,6 +79,17 @@ function Add-ModulesToBlobStorage
$data = Import-PowerShellDataFile -Path $dependenciesPath
foreach ($dependency in $data.Dependencies)
{
if ($dependency.PowerShellCore -and -not $isPowerShellCore)
{
Write-Verbose -Message "Skipping module {$($dependency.ModuleName)} as it is not compatible with Windows PowerShell."
continue
}
elseif ($dependency.PowerShellCore -eq $false -and $isPowerShellCore)
{
Write-Verbose -Message "Skipping module {$($dependency.ModuleName)} as it is not compatible with PowerShell Core."
continue
}

Write-Log -Object ('Saving module {0} (v{1})' -f $dependency.ModuleName, $dependency.RequiredVersion)
Save-Module -Name $dependency.ModuleName -RequiredVersion $dependency.RequiredVersion -Path $savePath
}
Expand Down

0 comments on commit 633f19b

Please sign in to comment.