Skip to content

Commit 508aba0

Browse files
committed
Fix Edit-Code so it always waits when editing functions
1 parent 22ffb10 commit 508aba0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

PotentialContribution/EditFunction.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ function Edit-Code {
361361
if($File) {
362362
$LastWriteTime = (Get-Item $File).LastWriteTime
363363

364+
# If it's a temp file, they're editing a function, so we have to wait!
365+
if($File.EndsWith(".tmp.ps1") -and $File.StartsWith(([IO.Path]::GetTempPath()))) {
366+
$Wait = $true
367+
}
368+
364369
# Avoid errors if Parameter is null/empty.
365370
Write-Verbose "$PSEditor '$File'"
366371
if ($PSEditor.Parameters)

0 commit comments

Comments
 (0)