Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion shell/windows/topics/06-functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ function _cachedInit {
$sources = @($Exe) + @($DependsOn | Where-Object { Test-Path $_ })
$newest = ($sources | ForEach-Object { (Get-Item $_).LastWriteTime } | Measure-Object -Maximum).Maximum
if (-not (Test-Path $file) -or (Get-Item $file).LastWriteTime -lt $newest) {
$script = & $Exe @InitArgs | Out-String
# Smart App Control can refuse to start an unsigned tool (zoxide from winget is one), which
# is a terminating error that would print at the top of every new shell until it is allowed
try { $script = & $Exe @InitArgs | Out-String } catch { return }
# an empty result (the tool failed) is never saved, so the next start tries again
if (-not $script.Trim()) { return }
if ($Transform) { $script = & $Transform $script }
Expand Down
Loading