PowerShell_Scripts/base/profile.d/Test-MyModules.ps1

14 lines
313 B
PowerShell

param([switch]$Force)
if( -not $global:MyModulesWarning -or $Force ) {
$global:MyModulesWarning = @()
}
Get-MyModules -MissingOnly |
Where-Object {
$_ -notin $global:MyModulesWarning
} | ForEach-Object {
$global:MyModulesWarning += $_
Write-Warning "Missing module: $_"
}