Compare commits
No commits in common. "bb29930d51b60e5a75df8b4293596768876cd35a" and "40cb17d419c07fb4f0b8349229a84c73a7eeed12" have entirely different histories.
bb29930d51
...
40cb17d419
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
"package": {
|
|
||||||
"Name": "BitWarden",
|
|
||||||
"Condition": [
|
|
||||||
{
|
|
||||||
"custom": null,
|
|
||||||
"System": null,
|
|
||||||
"Hostname": null,
|
|
||||||
"Username": null,
|
|
||||||
"CmdletExists": null,
|
|
||||||
"ModuleExists": null,
|
|
||||||
"AppExeExists": [
|
|
||||||
"bw"
|
|
||||||
],
|
|
||||||
"Logic": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
if( -not (Test-Path env:BITWARDEN_CLI_PATH) ) {
|
|
||||||
$env:BITWARDEN_CLI_PATH = Get-Command bw -Type Application | Select-Object -First 1 -ExpandProperty Source
|
|
||||||
}
|
|
||||||
|
|
||||||
$local:bwPath = Join-Path $HOME 'tmp'
|
|
||||||
$null = New-Item -ItemType Directory -Path $bwPath -Force
|
|
||||||
$bwPath = Join-Path $bwPath 'git-credential-bw.key'
|
|
||||||
if( Test-Path $bwPath ) {
|
|
||||||
$env:BW_SESSION= Get-Content $bwPath
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"Always": [
|
|
||||||
"BitwardenWrapper"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
[CmdletBinding(SupportsShouldProcess)]param(
|
[CmdletBinding(SupportsShouldProcess)]param(
|
||||||
[Alias('Slug')]
|
|
||||||
[string[]]$AddOnSlug,
|
[string[]]$AddOnSlug,
|
||||||
[Alias('Name')]
|
|
||||||
[string[]]$AddOnName,
|
[string[]]$AddOnName,
|
||||||
[switch]$InspectContainer,
|
[switch]$InspectContainer,
|
||||||
[switch]$NoPatternMatch,
|
[switch]$NoPatternMatch,
|
||||||
|
@ -16,7 +14,7 @@ $addons = $addons.data.addons
|
||||||
switch( $Status ) {
|
switch( $Status ) {
|
||||||
'Installed' { $addons = $addons | Where-Object Installed }
|
'Installed' { $addons = $addons | Where-Object Installed }
|
||||||
'NotInstalled' { $addons = $addons | Where-Object -Not Installed }
|
'NotInstalled' { $addons = $addons | Where-Object -Not Installed }
|
||||||
default {
|
'Running' {
|
||||||
$addons = $addons | Where-Object Installed
|
$addons = $addons | Where-Object Installed
|
||||||
$InspectContainer = $true
|
$InspectContainer = $true
|
||||||
}
|
}
|
||||||
|
@ -51,7 +49,7 @@ switch( $Status ) {
|
||||||
$addons = $addons | Where-Object Status -eq 'running'
|
$addons = $addons | Where-Object Status -eq 'running'
|
||||||
}
|
}
|
||||||
'Stopped' {
|
'Stopped' {
|
||||||
$addons = $addons | Where-Object Status -ne 'running'
|
$addons = $addons | Where-Object Status -eq 'running'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,8 @@
|
||||||
[CmdletBinding(SupportsShouldProcess)]param(
|
[CmdletBinding(SupportsShouldProcess)]param(
|
||||||
[Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)]
|
|
||||||
[Alias('Slug')]
|
|
||||||
[string[]]$AddOnSlug,
|
[string[]]$AddOnSlug,
|
||||||
[switch]$NoPatternMatch
|
[switch]$NoPatternMatch
|
||||||
)
|
)
|
||||||
|
|
||||||
begin{}
|
Get-HA_Addon 'Installed' -AddOnSlug:$AddOnSlug -NoPatternMatch:$NoPatternMatch | ForEach-Object {
|
||||||
process{
|
Invoke-HomeAssistantCli addons start $_.slug
|
||||||
foreach( $slug in $AddOnSlug ) {
|
|
||||||
Get-HA_Addon 'Running' -AddOnSlug:$slug -NoPatternMatch:$NoPatternMatch | ForEach-Object {
|
|
||||||
$local:a = $_
|
|
||||||
$local:invocation = Invoke-HomeAssistantCli addons start $a.slug
|
|
||||||
Get-HA_Addon -InspectContainer -NoPatternMatch -AddOnSlug $a.slug |
|
|
||||||
Select-Object @{
|
|
||||||
L='result';E={$invocation.result}
|
|
||||||
},@{
|
|
||||||
L='data';E={$invocation.data}
|
|
||||||
},*
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
end{}
|
|
||||||
|
|
|
@ -1,23 +1,8 @@
|
||||||
[CmdletBinding(SupportsShouldProcess)]param(
|
[CmdletBinding(SupportsShouldProcess)]param(
|
||||||
[Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)]
|
|
||||||
[Alias('Slug')]
|
|
||||||
[string[]]$AddOnSlug,
|
[string[]]$AddOnSlug,
|
||||||
[switch]$NoPatternMatch
|
[switch]$NoPatternMatch
|
||||||
)
|
)
|
||||||
|
|
||||||
begin{}
|
Get-HA_Addon 'Running' -AddOnSlug:$AddOnSlug -NoPatternMatch:$NoPatternMatch | ForEach-Object {
|
||||||
process{
|
Invoke-HomeAssistantCli addons stop $_.slug
|
||||||
foreach( $slug in $AddOnSlug ) {
|
|
||||||
Get-HA_Addon 'Running' -AddOnSlug:$slug -NoPatternMatch:$NoPatternMatch | ForEach-Object {
|
|
||||||
$local:a = $_
|
|
||||||
$local:invocation = Invoke-HomeAssistantCli addons stop $a.slug
|
|
||||||
Get-HA_Addon -InspectContainer -NoPatternMatch -AddOnSlug $a.slug |
|
|
||||||
Select-Object @{
|
|
||||||
L='result';E={$invocation.result}
|
|
||||||
},@{
|
|
||||||
L='data';E={$invocation.data}
|
|
||||||
},*
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
end{}
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
|
|
||||||
sudo killall -9 corosync
|
|
||||||
sudo systemctl restart pve-cluster
|
|
||||||
sudo systemctl restart pvedaemon
|
|
||||||
sudo systemctl restart pveproxy
|
|
||||||
sudo systemctl restart pvestatd
|
|
||||||
|
|
||||||
sudo qm stop 100
|
|
||||||
sudo qm start 100
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"package": {
|
|
||||||
"Name": "Proxmox",
|
|
||||||
"Condition": [
|
|
||||||
{
|
|
||||||
"custom": null,
|
|
||||||
"System": [ "Linux" ],
|
|
||||||
"Hostname": null,
|
|
||||||
"Username": null,
|
|
||||||
"CmdletExists": null,
|
|
||||||
"ModuleExists": null,
|
|
||||||
"AppExeExists": "/usr/sbin/qm",
|
|
||||||
"Logic": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,10 +5,6 @@
|
||||||
|
|
||||||
$local:pathChar = [IO.Path]::DirectorySeparatorChar
|
$local:pathChar = [IO.Path]::DirectorySeparatorChar
|
||||||
$MountPath = Get-Path $MountPath
|
$MountPath = Get-Path $MountPath
|
||||||
$local:MountName = $($($(
|
$local:MountName = $MountPath -replace '-','\\x2d' -replace $pathChar,'-' -replace '^-','' -replace '-^',''
|
||||||
$MountPath -replace '-','\\x2d'
|
|
||||||
).Replace( $pathChar, '-' )
|
|
||||||
) -replace '^-',''
|
|
||||||
)
|
|
||||||
|
|
||||||
$MountName
|
$MountName
|
||||||
|
|
|
@ -5,10 +5,6 @@ param(
|
||||||
|
|
||||||
$local:detectedDisistro = cat /etc/os-release | Select-String -Pattern "^ID=" | ForEach-Object { $_ -split '=' | Select-Object -Skip 1 }
|
$local:detectedDisistro = cat /etc/os-release | Select-String -Pattern "^ID=" | ForEach-Object { $_ -split '=' | Select-Object -Skip 1 }
|
||||||
switch ($detectedDisistro) {
|
switch ($detectedDisistro) {
|
||||||
'arch' {
|
'arch' { Update-ArchOSz -Mode:$Mode $args }
|
||||||
Update-ArchOSz -Mode:$Mode $args
|
'ubuntu' { Update-UbuntuOSz -Mode:$Mode $args }
|
||||||
}
|
|
||||||
{$_ -in 'debian','ubuntu','zorin'} {
|
|
||||||
Update-UbuntuOSz -Mode:$Mode $args
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,21 +6,4 @@ if( -not (Test-Path env:XDG_DATA_HOME) ) {
|
||||||
}
|
}
|
||||||
if( -not (Test-Path env:XDG_CONFIG_HOME) ) {
|
if( -not (Test-Path env:XDG_CONFIG_HOME) ) {
|
||||||
$env:XDG_CONFIG_HOME="$HOME/.config"
|
$env:XDG_CONFIG_HOME="$HOME/.config"
|
||||||
}
|
}
|
||||||
|
|
||||||
if( -not (
|
|
||||||
Test-Path env:SHELL_PARENT
|
|
||||||
) -and -not (
|
|
||||||
$env:SHELL -match 'p(wsh|owershell)$'
|
|
||||||
) -and (
|
|
||||||
Test-Path env:SHELL
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
$env:COMPLETION_SHELL_PREFERENCE = $env:SHELL
|
|
||||||
$env:SHELL_PARENT = $env:SHELL
|
|
||||||
}
|
|
||||||
$env:SHELL = Get-Process -Id $PID | Select-Object -ExpandProperty Path
|
|
||||||
Get-Command -ListImported Set-UnixCompleter -ErrorAction Ignore |
|
|
||||||
ForEach-Object {
|
|
||||||
Set-UnixCompleter -Shell $env:COMPLETION_SHELL_PREFERENCE
|
|
||||||
}
|
|
|
@ -5,6 +5,17 @@
|
||||||
[string[]]$Path
|
[string[]]$Path
|
||||||
)
|
)
|
||||||
process {
|
process {
|
||||||
|
|
||||||
|
function Get-FullPath {
|
||||||
|
param([string]$Path)
|
||||||
|
|
||||||
|
if([System.IO.Path]::IsPathRooted($Path)){
|
||||||
|
[System.IO.Path]::GetFullPath($Path)
|
||||||
|
}else{
|
||||||
|
[System.IO.Path]::GetFullPath((Join-Path $PWD $Path))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach( $local:p in $Path ) {
|
foreach( $local:p in $Path ) {
|
||||||
switch( $p[0] ) {
|
switch( $p[0] ) {
|
||||||
'@' { $p = Join-Path $MyPSScriptRoot $p.Substring(1) }
|
'@' { $p = Join-Path $MyPSScriptRoot $p.Substring(1) }
|
||||||
|
@ -16,9 +27,6 @@ process {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# clean end of path from DirectorySeparatorChars
|
|
||||||
$p = $p -replace '[/\\]+$',''
|
|
||||||
|
|
||||||
$p = $p -replace '#C-','#C-#' -replace '\*','#C-A#' -replace '\?','#C-Q#'
|
$p = $p -replace '#C-','#C-#' -replace '\*','#C-A#' -replace '\?','#C-Q#'
|
||||||
if([System.IO.Path]::IsPathRooted($p)){
|
if([System.IO.Path]::IsPathRooted($p)){
|
||||||
$p = [System.IO.Path]::GetFullPath($p)
|
$p = [System.IO.Path]::GetFullPath($p)
|
||||||
|
@ -36,3 +44,9 @@ process {
|
||||||
$p
|
$p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# try {
|
||||||
|
# get-item $Path -Force -ErrorAction Stop |
|
||||||
|
# Select-Object -ExpandProperty FullName
|
||||||
|
# } catch {
|
||||||
|
# $_.targetObject
|
||||||
|
# }
|
||||||
|
|
|
@ -37,7 +37,6 @@ class DockerNetworks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( -not (Get-Command docker-compose -ErrorAction Ignore) ) { return }
|
|
||||||
class DockerComposeCommands { #: System.Management.Automation.IValidateSetValuesGenerator {
|
class DockerComposeCommands { #: System.Management.Automation.IValidateSetValuesGenerator {
|
||||||
static [string[]] $cachedCommands = @()
|
static [string[]] $cachedCommands = @()
|
||||||
static [string[]] _GetValidValues([string]$wordToComplete,[string]$subcommand,[bool]$Strict) {
|
static [string[]] _GetValidValues([string]$wordToComplete,[string]$subcommand,[bool]$Strict) {
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Get-ZfsItem
|
|
|
@ -1,25 +0,0 @@
|
||||||
[CmdletBinding()]param(
|
|
||||||
[string[]]$Options='name,used,avail,refer,canmount,mounted,mountpoint'
|
|
||||||
)
|
|
||||||
|
|
||||||
$Options = $Options -join ','
|
|
||||||
if( $options -split ',' -notcontains 'name' ) { $options = "name,$Options" }
|
|
||||||
$local:prev = '';
|
|
||||||
zfs list -o $Options |
|
|
||||||
ForEach-Object { $_ -replace ' +',"`t" } |
|
|
||||||
ConvertFrom-Csv -Delimiter "`t" |
|
|
||||||
Where-Object Name -NotMatch '^rpool/var/lib/docker/' |
|
|
||||||
ForEach-Object {
|
|
||||||
$local:o = $_ | Select-Object @{L='-';E={''}},*
|
|
||||||
$local:tmpPrev = $o.Name -replace '^(\w+(\W\w+(\W\w+)?)?).*','$1';
|
|
||||||
if( $tmpPrev -notmatch "^$prev" -and $prev -notin ('','NAME') ) {
|
|
||||||
$o.'-' = "`n-"
|
|
||||||
};
|
|
||||||
$prev = $tmpPrev;
|
|
||||||
if( $o.MOUNTPOINT ) {
|
|
||||||
$o.MOUNTPOINT = $o.MOUNTPOINT -replace '^none$','<none>'
|
|
||||||
}
|
|
||||||
$o
|
|
||||||
} |
|
|
||||||
Format-Table -Wrap
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
$local:prev = "";
|
||||||
|
zfs list -o name,used,avail,refer,canmount,mounted,mountpoint $args |
|
||||||
|
grep -v 'docker/' |
|
||||||
|
ForEach-Object {
|
||||||
|
$local:tmpPrev = $_ -replace '^(\w+(\W\w+(\W\w+)?)?).*','$1';
|
||||||
|
if( $tmpPrev -notmatch "^$prev" -and $prev -notin ('','NAME') ) {
|
||||||
|
'-----------------'
|
||||||
|
};
|
||||||
|
$prev = $tmpPrev;
|
||||||
|
$_
|
||||||
|
}
|
Loading…
Reference in New Issue