function Update-DeveloperModules { <# .SYNOPSIS Used to update developers modules in a consistent manner. Useful for reducing manual module management by developers. This function does not look for advanced modules to be downloaded, it only updates local modules. #> param ( ) $logLead = (Get-LogLeadName) # Get all modules with SREModule AlkamiManifeset componentTypes $lookInFolder = (Get-ChocolateyInstallPath) $allFilePaths = @() $moduleNames = @() foreach ($filename in (Get-ValidPackageManifestFilenames)) { $findPath = (Join-Path (Join-Path $lookInFolder 'lib') $filename) $allFilePaths += @((Get-ChildItem $findPath -Recurse).FullName) } foreach($filepath in $allFilePaths) { if ([string]::IsNullOrWhiteSpace($filepath)) { continue } $packageManifest = (Get-PackageManifest -Path $filepath) if (($packageManifest.general.componentType -eq 'SREModule') -or ($packageManifest.general.componentType -eq 'Installer')) { $moduleNames += (Get-ChocoPackageFromPath -Path $filepath) } } if ($moduleNames.Count -gt 0) { $arguments = @('upgrade','--no-progress','--confirm') $arguments += $moduleNames $chocoPath = (Join-Path (Join-Path $lookInFolder 'bin') 'choco.exe') Write-Host "$logLead : $chocoPath @($arguments -join ' ')" Invoke-CallOperatorWithPathAndParameters -Path $chocoPath -Arguments $arguments Get-Module Alkami* | Remove-Module -Force } else { Write-Warning "$logLead : Could not find any packages under [$lookInFolder]. Have you upgraded to the latest modules before running this command?" Write-Host "$logLead : Use this command string to update your modules to some variant of the latest, but this may be out of date`n`nchoco update Alkami.PowerShell.AD Alkami.PowerShell.Choco Alkami.PowerShell.Common Alkami.PowerShell.Configuration Alkami.PowerShell.Database Alkami.PowerShell.IIS Alkami.PowerShell.ServerManagement Alkami.PowerShell.ServiceFabric Alkami.PowerShell.Services Alkami.Installer.Provider Alkami.Installer.WebExtension Alkami.Installer.Widget Alkami.Installer.WebApplication Alkami.Installer.Services Alkami.Installer.WebSite -y`n`nIn the future this function should work for what you want." } try { if ((Get-ADDomain -ErrorAction Ignore).Forest -eq 'corp.alkamitech.com') { if ((choco list carbon -lo) -match 'carbon' ) { choco uninstall carbon -fy Write-Warning " ==========" Write-Warning " ATTENTION" Write-Warning " ==========" Write-Warning "Sorry folks, carbon is deterimental to the Alkami environment and we are asking all devs to remove it" Write-Warning "It will now be uninstalled from your machine. If you have a need for it, please reach out to @cicd in #eng-crossfire" Write-Warning "We want to help everyone, so if we can help with a task Carbon previously did, we want to make things better." Write-Warning "" Write-Warning "If you don't know why you had carbon installed, you can ignore this message" } } } catch { <# purposefully ignore this #>} }