From ed18ee899e1b60339e1ec702dd937b7a3b513efd Mon Sep 17 00:00:00 2001 From: Joon Ro Date: Mon, 6 Jun 2022 20:35:39 +0900 Subject: [PATCH] Use $Script:ShowHeader to decide whether to show header --- src/FileInfo.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/FileInfo.ps1 b/src/FileInfo.ps1 index a310c5a..d2d450b 100644 --- a/src/FileInfo.ps1 +++ b/src/FileInfo.ps1 @@ -32,7 +32,7 @@ function FileInfo { $ParentName = $Item.PSParentPath.Replace("Microsoft.PowerShell.Core\FileSystem::", "") - If ($Script:LastParentName -ne $ParentName) { + If ($Script:LastParentName -ne $ParentName -or $Script:ShowHeader) { $Color = $GetChildItemColorTable.File['Directory'] Write-Host @@ -45,6 +45,8 @@ function FileInfo { Write-Host "Mode LastWriteTime Length Name" Write-Host "---- ------------- ------ ----" + + $Script:ShowHeader = $False } $Color = Get-FileColor $Item