Get-ColoredContent.ps1 321 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
[CmdletBinding()]
Param (
	[Parameter(Mandatory=$True, ValueFromPipeline=$True)]
	[string[]]$Path,

	[string]$Style="vim"
)

Process {
	ForEach($_ in $Path) {
		Try {
			$n = Get-Item $_ -ErrorAction Stop | Select -Expand FullName
13
			& pygmentize -f terminal16m -O style=$Style $n
14 15 16 17 18 19
		} Catch {
			Write-Error $_
		}
	}
}