PSColor.psm1
Add-Type -assemblyname System.ServiceProcess . "$PSScriptRoot\PSColorHelper.ps1" . "$PSScriptRoot\FileInfo.ps1" . "$PSScriptRoot\ServiceController.ps1" . "$PSScriptRoot\MatchInfo.ps1" . "$PSScriptRoot\ProcessInfo.ps1" $global:PSColor = @{ File = @{ Default = @{ Color = 'White' } Directory = @{ Color = 'Cyan'} Hidden = @{ Color = 'DarkGray'; Pattern = '^\.' } Code = @{ Color = 'Magenta'; Pattern = '\.(java|c|cpp|cs|js|css|html)$' } Executable = @{ Color = 'Red'; Pattern = '\.(exe|bat|cmd|py|pl|ps1|psm1|vbs|rb|reg)$' } Text = @{ Color = 'Yellow'; Pattern = '\.(txt|cfg|conf|ini|csv|log|config|xml|yml|md|markdown)$' } Compressed = @{ Color = 'Green'; Pattern = '\.(zip|tar|gz|rar|jar|war)$' } } Service = @{ Default = @{ Color = 'White' } Running = @{ Color = 'DarkGreen' } Stopped = @{ Color = 'DarkRed' } } Match = @{ Default = @{ Color = 'White' } Path = @{ Color = 'Cyan'} LineNumber = @{ Color = 'Yellow' } Line = @{ Color = 'White' } } } $script:showHeader=$true New-CommandWrapper Out-Default -Process { if(($_ -is [System.IO.DirectoryInfo]) -or ($_ -is [System.IO.FileInfo])) { FileInfo $_ $_ = $null } elseif($_ -is [System.ServiceProcess.ServiceController]) { ServiceController $_ $_ = $null } elseif($_ -is [Microsoft.Powershell.Commands.MatchInfo]) { MatchInfo $_ $_ = $null } } -end { write-host "" $script:showHeader=$true } Export-ModuleMember |