Last active
May 13, 2026 09:17
-
-
Save OlinB/62c93d8803527846f8c649b0c5d0f146 to your computer and use it in GitHub Desktop.
Powershell recursive folder comparaison
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using namespace System.Management.Automation | |
| using namespace System.Management.Automation.Language | |
| New-Alias -Name "php72" C:\laragon\bin\php\php-7.2.34-Win32-VC15-x64\php | |
| New-Alias -Name "php73" C:\laragon\bin\php\php-7.3.9-Win32-VC15-x64\php | |
| New-Alias -Name "php74" C:\laragon\bin\php\php-7.4.19-Win32-vc15-x64\php | |
| New-Alias -Name "php8" C:\laragon\bin\php\php-8.0.11-Win32-vs16-x64\php | |
| New-Alias -Name "php81" C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\php | |
| function Get-TextFromIcon { | |
| param ( | |
| $icon, | |
| $json | |
| ) | |
| # Find the frame with the specified icon | |
| $frame = $json.frames | Where-Object { $_.icon -eq $icon } | |
| # Return the text property if found, otherwise return a message | |
| if ($frame -ne $null) { | |
| return $frame.text | |
| } else { | |
| return "Icon not found in JSON response" | |
| } | |
| } | |
| function temp { | |
| $json = Invoke-RestMethod -Uri "https://netatmo.inetisdev.ch/" -Method Get | |
| Write-Host "co2: $(Get-TextFromIcon -icon 'i19638' -json $json)" | |
| Write-Host "temp: $(Get-TextFromIcon -icon 'i2056' -json $json)" | |
| } | |
| Set-Alias -Name co2 -Value temp | |
| Set-Alias -Name october -Value C:\Users\Olin\Documents\october\builds\build\windows\windows-x64.exe | |
| function netatmo-temp{ | |
| $json = Invoke-RestMethod -Uri "https://netatmo.inetisdev.ch/" -Method Get | |
| Write-Host "$(Get-TextFromIcon -icon 'i2056' -json $json)" | |
| } | |
| function om { | |
| Write-Host " $($PSStyle.italic)herd php artisan october:migrate$($PSStyle.ItalicOff)" | |
| herd php artisan october:migrate | |
| } | |
| function hp { | |
| Write-Host " $($PSStyle.italic)herd php $($args)$($PSStyle.ItalicOff)" | |
| herd php @Args | |
| } | |
| function hc { | |
| Write-Host " $($PSStyle.italic)herd composer $($args)$($PSStyle.ItalicOff)" | |
| herd composer @Args | |
| } | |
| function hr { | |
| Write-Host " $($PSStyle.italic)herd restart$($PSStyle.ItalicOff)" | |
| herd restart | |
| } | |
| function Toggle-HerdDebug { | |
| & "C:\Users\Olin\Documents\PowerShell\Toggle-HerdDebug.ps1" | |
| } | |
| Set-Alias -Name debug -Value Toggle-HerdDebug | |
| function Uncapitalize { | |
| & "C:\Users\Olin\Documents\PowerShell\Uncapitalize.ps1" @Args | |
| } | |
| Set-Alias -Name uncap -Value Uncapitalize | |
| function convert-font { | |
| node C:\Users\Olin\Documents\fonts-converter\fonts-converter.js @Args | |
| } | |
| function Unzip-GoogleFont { | |
| node C:\Users\Olin\Documents\fonts-converter\fonts-extractor.js @Args | |
| } | |
| function Get-Files { | |
| param ( | |
| [string]$path, | |
| [string[]]$exclude | |
| ) | |
| if (-not $path) { | |
| Write-Host "Usage: Get-Files -path <string> (-exclude <string>)" | |
| return | |
| } | |
| foreach ($item in Get-ChildItem -Path $path) { | |
| if ($excludedFiles -contains $item.Name) { continue } | |
| if ((Get-Item $item.FullName) -is [System.IO.DirectoryInfo]) { | |
| Write-Output '[' + $item.Name + ']' | |
| } else { | |
| Write-Output $item.Name | |
| } | |
| if (Test-Path -Path $item.FullName -PathType Container) { | |
| Get-Files -path $item.FullName -excludedFiles $exclude | |
| } | |
| } | |
| } | |
| function Compare-Dir { | |
| param ( | |
| [string]$path1, | |
| [string]$path2 | |
| ) | |
| if (-not $path1 -or -not $path2) { | |
| Write-Host "Usage: Compare-Dir -path1 <string> -path2 <string>" | |
| return | |
| } | |
| $env1 = Get-Files -path $path1 -exclude @() | |
| $env2 = Get-Files -path $path2 -exclude @() | |
| $comparison = Compare-Object -DifferenceObject $env1 -ReferenceObject $env2 | |
| foreach ($difference in $comparison) { | |
| if ($difference.SideIndicator -eq '=>') { | |
| $difference.SideIndicator = '-->' | |
| } elseif ($difference.SideIndicator -eq '<=') { | |
| $difference.SideIndicator = '<--' | |
| } | |
| Write-Output $difference | |
| } | |
| } | |
| # Copilot aliases | |
| function ghcs { | |
| # Debug support provided by common PowerShell function parameters, which is natively aliased as -d or -db | |
| # https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7.4#-debug | |
| param( | |
| [Parameter()] | |
| [string]$Hostname, | |
| [ValidateSet('gh', 'git', 'shell')] | |
| [Alias('t')] | |
| [String]$Target = 'shell', | |
| [Parameter(Position=0, ValueFromRemainingArguments)] | |
| [string]$Prompt | |
| ) | |
| begin { | |
| # Create temporary file to store potential command user wants to execute when exiting | |
| $executeCommandFile = New-TemporaryFile | |
| # Store original value of GH_* environment variable | |
| $envGhDebug = $Env:GH_DEBUG | |
| $envGhHost = $Env:GH_HOST | |
| } | |
| process { | |
| if ($PSBoundParameters['Debug']) { | |
| $Env:GH_DEBUG = 'api' | |
| } | |
| $Env:GH_HOST = $Hostname | |
| gh copilot suggest -t $Target -s "$executeCommandFile" ('use powershell to ' + $Prompt) | |
| } | |
| end { | |
| # Execute command contained within temporary file if it is not empty | |
| if ($executeCommandFile.Length -gt 0) { | |
| # Extract command to execute from temporary file | |
| $executeCommand = (Get-Content -Path $executeCommandFile -Raw).Trim() | |
| # Insert command into PowerShell up/down arrow key history | |
| [Microsoft.PowerShell.PSConsoleReadLine]::AddToHistory($executeCommand) | |
| # Insert command into PowerShell history | |
| $now = Get-Date | |
| $executeCommandHistoryItem = [PSCustomObject]@{ | |
| CommandLine = $executeCommand | |
| ExecutionStatus = [Management.Automation.Runspaces.PipelineState]::NotStarted | |
| StartExecutionTime = $now | |
| EndExecutionTime = $now.AddSeconds(1) | |
| } | |
| Add-History -InputObject $executeCommandHistoryItem | |
| # Execute command | |
| Write-Host "`n" | |
| Invoke-Expression $executeCommand | |
| } | |
| } | |
| clean { | |
| # Clean up temporary file used to store potential command user wants to execute when exiting | |
| Remove-Item -Path $executeCommandFile | |
| # Restore GH_* environment variables to their original value | |
| $Env:GH_DEBUG = $envGhDebug | |
| } | |
| } | |
| function ghce { | |
| # Debug support provided by common PowerShell function parameters, which is natively aliased as -d or -db | |
| # https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7.4#-debug | |
| param( | |
| [Parameter()] | |
| [string]$Hostname, | |
| [Parameter(Position=0, ValueFromRemainingArguments)] | |
| [string[]]$Prompt | |
| ) | |
| begin { | |
| # Store original value of GH_* environment variables | |
| $envGhDebug = $Env:GH_DEBUG | |
| $envGhHost = $Env:GH_HOST | |
| } | |
| process { | |
| if ($PSBoundParameters['Debug']) { | |
| $Env:GH_DEBUG = 'api' | |
| } | |
| $Env:GH_HOST = $Hostname | |
| gh copilot explain $Prompt | |
| } | |
| clean { | |
| # Restore GH_* environment variables to their original value | |
| $Env:GH_DEBUG = $envGhDebug | |
| $Env:GH_HOST = $envGhHost | |
| } | |
| } | |
| Register-ArgumentCompleter -Native -CommandName 'starship' -ScriptBlock { | |
| param($wordToComplete, $commandAst, $cursorPosition) | |
| $commandElements = $commandAst.CommandElements | |
| $command = @( | |
| 'starship' | |
| for ($i = 1; $i -lt $commandElements.Count; $i++) { | |
| $element = $commandElements[$i] | |
| if ($element -isnot [StringConstantExpressionAst] -or | |
| $element.StringConstantType -ne [StringConstantType]::BareWord -or | |
| $element.Value.StartsWith('-') -or | |
| $element.Value -eq $wordToComplete) { | |
| break | |
| } | |
| $element.Value | |
| }) -join ';' | |
| $completions = @(switch ($command) { | |
| 'starship' { | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('-V', 'V ', [CompletionResultType]::ParameterName, 'Print version') | |
| [CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version') | |
| [CompletionResult]::new('bug-report', 'bug-report', [CompletionResultType]::ParameterValue, 'Create a pre-populated GitHub issue with information about your configuration') | |
| [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate starship shell completions for your shell to stdout') | |
| [CompletionResult]::new('config', 'config', [CompletionResultType]::ParameterValue, 'Edit the starship configuration') | |
| [CompletionResult]::new('explain', 'explain', [CompletionResultType]::ParameterValue, 'Explains the currently showing modules') | |
| [CompletionResult]::new('init', 'init', [CompletionResultType]::ParameterValue, 'Prints the shell function used to execute starship') | |
| [CompletionResult]::new('module', 'module', [CompletionResultType]::ParameterValue, 'Prints a specific prompt module') | |
| [CompletionResult]::new('preset', 'preset', [CompletionResultType]::ParameterValue, 'Prints a preset config') | |
| [CompletionResult]::new('print-config', 'print-config', [CompletionResultType]::ParameterValue, 'Prints the computed starship configuration') | |
| [CompletionResult]::new('prompt', 'prompt', [CompletionResultType]::ParameterValue, 'Prints the full starship prompt') | |
| [CompletionResult]::new('session', 'session', [CompletionResultType]::ParameterValue, 'Generate random session key') | |
| [CompletionResult]::new('time', 'time', [CompletionResultType]::ParameterValue, 'Prints time in milliseconds') | |
| [CompletionResult]::new('timings', 'timings', [CompletionResultType]::ParameterValue, 'Prints timings of all active modules') | |
| [CompletionResult]::new('toggle', 'toggle', [CompletionResultType]::ParameterValue, 'Toggle a given starship module') | |
| [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') | |
| break | |
| } | |
| 'starship;bug-report' { | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;completions' { | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;config' { | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;explain' { | |
| [CompletionResult]::new('-s', 's', [CompletionResultType]::ParameterName, 'The status code of the previously run command as an unsigned or signed 32bit integer') | |
| [CompletionResult]::new('--status', 'status', [CompletionResultType]::ParameterName, 'The status code of the previously run command as an unsigned or signed 32bit integer') | |
| [CompletionResult]::new('--pipestatus', 'pipestatus', [CompletionResultType]::ParameterName, 'Bash, Fish and Zsh support returning codes for each process in a pipeline') | |
| [CompletionResult]::new('-w', 'w', [CompletionResultType]::ParameterName, 'The width of the current interactive terminal') | |
| [CompletionResult]::new('--terminal-width', 'terminal-width', [CompletionResultType]::ParameterName, 'The width of the current interactive terminal') | |
| [CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'The path that the prompt should render for') | |
| [CompletionResult]::new('--path', 'path', [CompletionResultType]::ParameterName, 'The path that the prompt should render for') | |
| [CompletionResult]::new('-P', 'P ', [CompletionResultType]::ParameterName, 'The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument') | |
| [CompletionResult]::new('--logical-path', 'logical-path', [CompletionResultType]::ParameterName, 'The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument') | |
| [CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'The execution duration of the last command, in milliseconds') | |
| [CompletionResult]::new('--cmd-duration', 'cmd-duration', [CompletionResultType]::ParameterName, 'The execution duration of the last command, in milliseconds') | |
| [CompletionResult]::new('-k', 'k', [CompletionResultType]::ParameterName, 'The keymap of fish/zsh/cmd') | |
| [CompletionResult]::new('--keymap', 'keymap', [CompletionResultType]::ParameterName, 'The keymap of fish/zsh/cmd') | |
| [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'The number of currently running jobs') | |
| [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'The number of currently running jobs') | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;init' { | |
| [CompletionResult]::new('--print-full-init', 'print-full-init', [CompletionResultType]::ParameterName, 'print-full-init') | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;module' { | |
| [CompletionResult]::new('-s', 's', [CompletionResultType]::ParameterName, 'The status code of the previously run command as an unsigned or signed 32bit integer') | |
| [CompletionResult]::new('--status', 'status', [CompletionResultType]::ParameterName, 'The status code of the previously run command as an unsigned or signed 32bit integer') | |
| [CompletionResult]::new('--pipestatus', 'pipestatus', [CompletionResultType]::ParameterName, 'Bash, Fish and Zsh support returning codes for each process in a pipeline') | |
| [CompletionResult]::new('-w', 'w', [CompletionResultType]::ParameterName, 'The width of the current interactive terminal') | |
| [CompletionResult]::new('--terminal-width', 'terminal-width', [CompletionResultType]::ParameterName, 'The width of the current interactive terminal') | |
| [CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'The path that the prompt should render for') | |
| [CompletionResult]::new('--path', 'path', [CompletionResultType]::ParameterName, 'The path that the prompt should render for') | |
| [CompletionResult]::new('-P', 'P ', [CompletionResultType]::ParameterName, 'The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument') | |
| [CompletionResult]::new('--logical-path', 'logical-path', [CompletionResultType]::ParameterName, 'The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument') | |
| [CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'The execution duration of the last command, in milliseconds') | |
| [CompletionResult]::new('--cmd-duration', 'cmd-duration', [CompletionResultType]::ParameterName, 'The execution duration of the last command, in milliseconds') | |
| [CompletionResult]::new('-k', 'k', [CompletionResultType]::ParameterName, 'The keymap of fish/zsh/cmd') | |
| [CompletionResult]::new('--keymap', 'keymap', [CompletionResultType]::ParameterName, 'The keymap of fish/zsh/cmd') | |
| [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'The number of currently running jobs') | |
| [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'The number of currently running jobs') | |
| [CompletionResult]::new('-l', 'l', [CompletionResultType]::ParameterName, 'List out all supported modules') | |
| [CompletionResult]::new('--list', 'list', [CompletionResultType]::ParameterName, 'List out all supported modules') | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;preset' { | |
| [CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Output the preset to a file instead of stdout') | |
| [CompletionResult]::new('--output', 'output', [CompletionResultType]::ParameterName, 'Output the preset to a file instead of stdout') | |
| [CompletionResult]::new('-l', 'l', [CompletionResultType]::ParameterName, 'List out all preset names') | |
| [CompletionResult]::new('--list', 'list', [CompletionResultType]::ParameterName, 'List out all preset names') | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;print-config' { | |
| [CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'Print the default instead of the computed config') | |
| [CompletionResult]::new('--default', 'default', [CompletionResultType]::ParameterName, 'Print the default instead of the computed config') | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;prompt' { | |
| [CompletionResult]::new('--profile', 'profile', [CompletionResultType]::ParameterName, 'Print the prompt with the specified profile name (instead of the standard left prompt)') | |
| [CompletionResult]::new('-s', 's', [CompletionResultType]::ParameterName, 'The status code of the previously run command as an unsigned or signed 32bit integer') | |
| [CompletionResult]::new('--status', 'status', [CompletionResultType]::ParameterName, 'The status code of the previously run command as an unsigned or signed 32bit integer') | |
| [CompletionResult]::new('--pipestatus', 'pipestatus', [CompletionResultType]::ParameterName, 'Bash, Fish and Zsh support returning codes for each process in a pipeline') | |
| [CompletionResult]::new('-w', 'w', [CompletionResultType]::ParameterName, 'The width of the current interactive terminal') | |
| [CompletionResult]::new('--terminal-width', 'terminal-width', [CompletionResultType]::ParameterName, 'The width of the current interactive terminal') | |
| [CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'The path that the prompt should render for') | |
| [CompletionResult]::new('--path', 'path', [CompletionResultType]::ParameterName, 'The path that the prompt should render for') | |
| [CompletionResult]::new('-P', 'P ', [CompletionResultType]::ParameterName, 'The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument') | |
| [CompletionResult]::new('--logical-path', 'logical-path', [CompletionResultType]::ParameterName, 'The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument') | |
| [CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'The execution duration of the last command, in milliseconds') | |
| [CompletionResult]::new('--cmd-duration', 'cmd-duration', [CompletionResultType]::ParameterName, 'The execution duration of the last command, in milliseconds') | |
| [CompletionResult]::new('-k', 'k', [CompletionResultType]::ParameterName, 'The keymap of fish/zsh/cmd') | |
| [CompletionResult]::new('--keymap', 'keymap', [CompletionResultType]::ParameterName, 'The keymap of fish/zsh/cmd') | |
| [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'The number of currently running jobs') | |
| [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'The number of currently running jobs') | |
| [CompletionResult]::new('--right', 'right', [CompletionResultType]::ParameterName, 'Print the right prompt (instead of the standard left prompt)') | |
| [CompletionResult]::new('--continuation', 'continuation', [CompletionResultType]::ParameterName, 'Print the continuation prompt (instead of the standard left prompt)') | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;session' { | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;time' { | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;timings' { | |
| [CompletionResult]::new('-s', 's', [CompletionResultType]::ParameterName, 'The status code of the previously run command as an unsigned or signed 32bit integer') | |
| [CompletionResult]::new('--status', 'status', [CompletionResultType]::ParameterName, 'The status code of the previously run command as an unsigned or signed 32bit integer') | |
| [CompletionResult]::new('--pipestatus', 'pipestatus', [CompletionResultType]::ParameterName, 'Bash, Fish and Zsh support returning codes for each process in a pipeline') | |
| [CompletionResult]::new('-w', 'w', [CompletionResultType]::ParameterName, 'The width of the current interactive terminal') | |
| [CompletionResult]::new('--terminal-width', 'terminal-width', [CompletionResultType]::ParameterName, 'The width of the current interactive terminal') | |
| [CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'The path that the prompt should render for') | |
| [CompletionResult]::new('--path', 'path', [CompletionResultType]::ParameterName, 'The path that the prompt should render for') | |
| [CompletionResult]::new('-P', 'P ', [CompletionResultType]::ParameterName, 'The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument') | |
| [CompletionResult]::new('--logical-path', 'logical-path', [CompletionResultType]::ParameterName, 'The logical path that the prompt should render for. This path should be a virtual/logical representation of the PATH argument') | |
| [CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'The execution duration of the last command, in milliseconds') | |
| [CompletionResult]::new('--cmd-duration', 'cmd-duration', [CompletionResultType]::ParameterName, 'The execution duration of the last command, in milliseconds') | |
| [CompletionResult]::new('-k', 'k', [CompletionResultType]::ParameterName, 'The keymap of fish/zsh/cmd') | |
| [CompletionResult]::new('--keymap', 'keymap', [CompletionResultType]::ParameterName, 'The keymap of fish/zsh/cmd') | |
| [CompletionResult]::new('-j', 'j', [CompletionResultType]::ParameterName, 'The number of currently running jobs') | |
| [CompletionResult]::new('--jobs', 'jobs', [CompletionResultType]::ParameterName, 'The number of currently running jobs') | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;toggle' { | |
| [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help') | |
| [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help') | |
| break | |
| } | |
| 'starship;help' { | |
| [CompletionResult]::new('bug-report', 'bug-report', [CompletionResultType]::ParameterValue, 'Create a pre-populated GitHub issue with information about your configuration') | |
| [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generate starship shell completions for your shell to stdout') | |
| [CompletionResult]::new('config', 'config', [CompletionResultType]::ParameterValue, 'Edit the starship configuration') | |
| [CompletionResult]::new('explain', 'explain', [CompletionResultType]::ParameterValue, 'Explains the currently showing modules') | |
| [CompletionResult]::new('init', 'init', [CompletionResultType]::ParameterValue, 'Prints the shell function used to execute starship') | |
| [CompletionResult]::new('module', 'module', [CompletionResultType]::ParameterValue, 'Prints a specific prompt module') | |
| [CompletionResult]::new('preset', 'preset', [CompletionResultType]::ParameterValue, 'Prints a preset config') | |
| [CompletionResult]::new('print-config', 'print-config', [CompletionResultType]::ParameterValue, 'Prints the computed starship configuration') | |
| [CompletionResult]::new('prompt', 'prompt', [CompletionResultType]::ParameterValue, 'Prints the full starship prompt') | |
| [CompletionResult]::new('session', 'session', [CompletionResultType]::ParameterValue, 'Generate random session key') | |
| [CompletionResult]::new('time', 'time', [CompletionResultType]::ParameterValue, 'Prints time in milliseconds') | |
| [CompletionResult]::new('timings', 'timings', [CompletionResultType]::ParameterValue, 'Prints timings of all active modules') | |
| [CompletionResult]::new('toggle', 'toggle', [CompletionResultType]::ParameterValue, 'Toggle a given starship module') | |
| [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') | |
| break | |
| } | |
| 'starship;help;bug-report' { | |
| break | |
| } | |
| 'starship;help;completions' { | |
| break | |
| } | |
| 'starship;help;config' { | |
| break | |
| } | |
| 'starship;help;explain' { | |
| break | |
| } | |
| 'starship;help;init' { | |
| break | |
| } | |
| 'starship;help;module' { | |
| break | |
| } | |
| 'starship;help;preset' { | |
| break | |
| } | |
| 'starship;help;print-config' { | |
| break | |
| } | |
| 'starship;help;prompt' { | |
| break | |
| } | |
| 'starship;help;session' { | |
| break | |
| } | |
| 'starship;help;time' { | |
| break | |
| } | |
| 'starship;help;timings' { | |
| break | |
| } | |
| 'starship;help;toggle' { | |
| break | |
| } | |
| 'starship;help;help' { | |
| break | |
| } | |
| }) | |
| $completions.Where{ $_.CompletionText -like "$wordToComplete*" } | | |
| Sort-Object -Property ListItemText | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment