PowerShell_Scripts/scoop/profile.d/smart-refresh-on-startup.ps1
Gal Szkolnik 2d858a8a06 Add SessionData class to setup script
Added [SessionData] static class to setup script
Utilized SessionData for scoop refreshing, so it will happen once per login session
 - otherwise it's a nuisance.
2021-06-29 09:46:57 -04:00

17 lines
No EOL
524 B
PowerShell

param([switch]$Force)
if( -not $global:ThisSeszion -or $Force ) {
$global:MyModulesWarning = @()
}
scoop autocomplete-on
if( Test-Path (Join-Path $env:SCOOP last-scoop-refresh.clixml) ) {
if($Host.Name -ne 'Visual Studio Code Host' ) {
scoop refresh
}
} else {
Write-Warning ("No recorded time for last 'scoop refresh', to remedy, run 'scoop refresh' at least once manually." +
"`nIf the issue still persists, please run 'scoop alias-update' to update to latest refresh code, and try again.")
}