File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,13 +320,14 @@ function ShowAttribLine{
320320
321321 $AttributesToShow | ForEach-Object {
322322 $name = $_.Name
323+ $value = $_.Value
323324 $color = $_.Color
324325 $prefix = $_.Prefix
325326 $BetweenQuotes = $_.BetweenQuotes
326327 $DefaultValue = $_.DefaultValue ?? " [$name ]"
327328 $HideIfEmpty = $_.HideIfEmpty
328329
329- $value = $item .$name
330+ $value = $value ?? $ item .$name
330331
331332 if ($HideIfEmpty -and [string ]::IsNullOrEmpty($value )){
332333 return
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ function Use-Order {
77 [Parameter ()][Alias (" e" )][switch ]$OpenInEditor ,
88 [Parameter ()][Alias (" w" )][switch ]$OpenInBrowser ,
99 [Parameter ()][Alias (" p" )][switch ]$PassThru ,
10- [Parameter ()][Alias (" c" )][switch ]$ClearScreen
10+ [Parameter ()][Alias (" c" )][switch ]$ClearScreen ,
11+ [Parameter ()][scriptblock ]$ShowProjectItemScriptBlock
1112 )
1213
1314 begin {
@@ -54,8 +55,17 @@ function Use-Order {
5455 return [PsCustomObject ]$i
5556 }
5657
58+ # Get function to show item
59+ $ShowProjectItemScriptBlock = $ShowProjectItemScriptBlock ?? { param ($parameters ) Show-ProjectItem @parameters }
60+
5761 # Show item in console or editor
58- Show-ProjectItem - Item $itemId - OpenInEditor:$OpenInEditor - OpenInBrowser:$OpenInBrowser - ClearScreen:$ClearScreen
62+ $params = @ {
63+ Item = $itemId
64+ OpenInEditor = $OpenInEditor
65+ OpenInBrowser = $OpenInBrowser
66+ ClearScreen = $ClearScreen
67+ }
68+ $ShowProjectItemScriptBlock.Invoke ($params )
5969 return
6070
6171 }
You can’t perform that action at this time.
0 commit comments