diff --git a/source/Private/Convert-M365WorkloadName.ps1 b/source/Private/Convert-M365WorkloadName.ps1 index a8aaf8f..17b69a8 100644 --- a/source/Private/Convert-M365WorkloadName.ps1 +++ b/source/Private/Convert-M365WorkloadName.ps1 @@ -8,6 +8,7 @@ $DSC_Workloads = @{ 'Planner' = 'Planner' 'PowerPlatform' = 'PP' 'SecurityCompliance' = 'SC' + 'Sentinel' = 'Sentinel' 'SharePoint' = 'SPO' 'Teams' = 'Teams' } diff --git a/source/Public/Add-ModulesToBlobStorage.ps1 b/source/Public/Add-ModulesToBlobStorage.ps1 index 74c9eed..1813f59 100644 --- a/source/Public/Add-ModulesToBlobStorage.ps1 +++ b/source/Public/Add-ModulesToBlobStorage.ps1 @@ -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 @@ -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 }