diff --git a/base/Reload-MyScripts.ps1 b/base/Reload-MyScripts.ps1 index 583ca6c..f557bf4 100644 --- a/base/Reload-MyScripts.ps1 +++ b/base/Reload-MyScripts.ps1 @@ -107,7 +107,15 @@ foreach ( $local:PackagePath in $myPackages ) { ". '$($_.FullName)';" } | Invoke-Expression - + + Join-Path $PackagePath 'profile.d' | Where-Object { Test-Path $_ } | + Get-ChildItem -Filter '*.format.ps1xml' | + ForEach-Object { + Write-Verbose "Loading $(getScriptName $_.FullName)..."; + "Update-FormatData '$($_.FullName)';" + } | + Invoke-Expression + $local:CommandsToAlias = ( @( $PackagePath ) + $( [SystemName]::_GetValidValues("", $true, $true) | @@ -131,4 +139,4 @@ foreach ( $local:alias in $myAliases.Keys ) { . SafeSetAlias $alias $myAliases[$alias] '#MyAlias' } -Remove-Item Function:\RemoveAlias, Function:\SafeSetAlias -ErrorAction SilentlyContinue \ No newline at end of file +Remove-Item Function:\RemoveAlias, Function:\SafeSetAlias -ErrorAction SilentlyContinue diff --git a/base/_ll.ps1 b/base/_ll.ps1 new file mode 100644 index 0000000..7ab2815 --- /dev/null +++ b/base/_ll.ps1 @@ -0,0 +1 @@ +_ls -la $args diff --git a/base/src/config.files.json b/base/src/config.files.json index 762166f..11e9138 100644 --- a/base/src/config.files.json +++ b/base/src/config.files.json @@ -1,11 +1,4 @@ { - "neovim": [ - "~/.config/nvim/init.vim", - "~/.config/nvim/vim-plug/plugins.vim", - "#vim", - "#vi" - ], - "vi": "~/.virc", "omp": "~/.oh-my-posh.omp.json", "profile": [ "~/.profile", @@ -54,15 +47,17 @@ "~/.spacemacs", "#emacs" ], + "vi": "~/.virc", "vim": [ "~/.vimrc", "~/.vim/vimrc" ], - "nvim": [ + "neovim": [ "~/.config/nvim/init.vim", - "~/.nvimrc", + "~/.config/nvim/vim-plug/plugins.vim", "#vim" ], + "nvim": "#neovim", "tmux": [ "~/.tmux.conf", "~/.byobu/.tmux.conf" diff --git a/docker/Get-DockerProcess.ps1 b/docker/Get-DockerProcess.ps1 index b6f1aa3..4245f15 100644 --- a/docker/Get-DockerProcess.ps1 +++ b/docker/Get-DockerProcess.ps1 @@ -1,12 +1,31 @@ #[CmdletBinding(SupportsShouldProcess)]param( [CmdletBinding()]param([string[]]$MatchName,[string[]]$OrderBy,[switch]$PassThru,[string[]]$MatchAny) -$local:result = $(docker ps --format='{{ .Image }}\t{{ .Names }}\t{{ .Status }}\t{{ .Ports }}' | +$local:containers = [ordered]@{} +$(docker ps -q) | ForEach-Object { - $local:l = $_ -split '\t'; - [PSCustomObject]([ordered]@{Image=$l[0];Name=$l[1];Status=$l[2];Ports=$l[3] -replace ', ',"`n"}) - } ) | Sort-Object Name + $local:tmp = docker inspect $_ | ConvertFrom-Json; + $local:tmpObj = [PSCustomObject]([ordered]@{ + Name=$tmp.Name.Substring(1) + Project=$tmp.Config.Labels.'com.docker.compose.project' + Service=$tmp.Config.Labels.'com.docker.compose.service' + Status=$tmp.State.Status + Image=$tmp.Config.Image + Ports=$( + $tmp.HostConfig.PortBindings | + Get-Member -type NoteProperty | Select-Object -ExpandProperty Name | + ForEach-Object { + "$($tmp.HostConfig.PortBindings."$_".HostPort)/$_" + } + ) + Binds= $tmp.HostConfig.Binds + raw = $tmp + }) + $tmpObj.PSObject.TypeNames.Insert(0,"DockerContainersOutput") + $containers[$tmpObj.Name]=$tmpObj + } +$local:result = $containers.Values | Sort-Object Name if( $MatchName ) { $result = $result | Where-Object Name -match $($MatchName -join '|') } @@ -19,6 +38,6 @@ if( $OrderBy ) { $result = $result | Sort-Object $OrderBy } -if( $PassThru ) { return $result } -$result | Format-Table -Wrap +#if( $PassThru ) { return $result } +$result #| Format-Table -Wrap diff --git a/docker/profile.d/TypeData.format.ps1xml b/docker/profile.d/TypeData.format.ps1xml new file mode 100644 index 0000000..479857f --- /dev/null +++ b/docker/profile.d/TypeData.format.ps1xml @@ -0,0 +1,41 @@ + + + + + + DockerContainersOutputTable + + DockerContainersOutput + + + + 12 + 15 + 20 + 14 + 20 + 15 + + + + + + + Project + Service + Name + Status + + $($($($_.Image -split ':') -join "`n:") -split '/') -join "`n/" + + $_.Ports -join "`n" + $_.Binds -join "`n" + + + + + + +