@@ -16,10 +16,27 @@ function FormatPqSourceItem {
1616 build metadata on the objects, making source generation easier
1717 . NOTES
1818 if already is formatted, don't mutate it again, return as a no-op.
19+
20+ now you can pipe directly from native command too
21+
22+ . EXAMPLE
23+ fd inspect.type | gi | FormatPqSourceItem
24+
25+ # auto converts to Item if it's a string
26+ fd inspect.type | FormatPqSourceItem
27+
28+ # and duplicate calls are safe
29+ fd inspect.type | FormatPqSourceItem | FormatPqSourceItem # no-op return
1930 #>
2031 [CmdletBinding ()]
21- param ( [Parameter (Mandatory , ValueFromPipeline )] $InObj )
32+ param (
33+ # Pass either file info, or paths as a string
34+ [Parameter (Mandatory , ValueFromPipeline )] $InObj
35+ )
2236 process {
37+ if ( $InObj -is [string ] ) {
38+ $InObj = Get-Item - ea ' stop' $InObj
39+ }
2340
2441 if ( $InObj.pstypenames -contains ' PqLibSourceItem' ) {
2542 return $InObj
@@ -194,7 +211,7 @@ $group_byParent = $find_pq | Group DirectoryBaseName
194211# $group_byRelPath = $find_pq | Group RelativePath
195212$group_byDirectory = $find_pq | Group Directory
196213
197- # RenderReadmeForGroup -GroupedBy $group_byRelpath -PathOutput 'readme.byRelpath.md'
214+ RenderReadmeForGroup - GroupedBy $group_byRelpath - PathOutput ' readme.byRelpath.md'
198215RenderReadmeForGroup - GroupedBy $group_byDirectory - PathOutput ' readme.byDirectory.md'
199216RenderReadmeForGroup - GroupedBy $group_byParent - PathOutput ' readme.byParent.md'
200217
0 commit comments