PsBash.psd1
|
# # Module manifest for module 'PsBash' # # Generated by: Andy Brummer # # Generated on: 04/02/2026 # @{ # Script module or binary module file associated with this manifest. RootModule = 'PsBash.psm1' # Version number of this module. ModuleVersion = '0.15.4' # ID used to uniquely identify this module GUID = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' # Author of this module Author = 'Andy Brummer' # Company or vendor of this module CompanyName = 'Unknown' # Copyright statement for this module Copyright = '(c) Andy Brummer. All rights reserved.' # Description of the functionality provided by this module Description = 'Real bash commands for PowerShell with typed objects. 76 commands (ls, grep, sort, awk, sed, jq, find, ps, du, tar, etc.) that accept real bash flags and return structured PowerShell objects while producing identical text output. Pipeline bridge pattern preserves typed objects through grep, sort, head, tail.' # Supported PSEditions CompatiblePSEditions = 'Core' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '7.4' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module # RequiredModules = @() # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module FormatsToProcess = 'PsBash.Format.ps1xml' # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @( 'Compare-Version', 'Complete-BashBgJob', 'Complete-BashBgJobsAtExit', 'ConvertFrom-BashArgs', 'ConvertFrom-HumanNumeric', 'ConvertFrom-MonthName', 'ConvertFrom-SimpleYaml', 'ConvertFrom-YamlValue', 'ConvertTo-BrowseRow', 'ConvertTo-JqJson', 'ConvertTo-PermissionString', 'ConvertTo-SimpleYaml', 'Disable-BashHookPrompt', 'Emit-BashLine', 'Enable-BashHookPrompt', 'Expand-EscapeSequences', 'Find-JqBranchKeyword', 'Find-JqKeyword', 'Find-JqTopLevelChar', 'Find-JqTopLevelStr', 'Format-BashDate', 'Format-BashSize', 'Format-LsGrid', 'Format-LsLine', 'Get-BashFileInfo', 'Get-BashItem', 'Get-BashJobCount', 'Get-BashLsProviderEntries', 'Get-BashPlatform', 'Get-BashText', 'Get-BrowseDisplayProperties', 'Get-BrowseTargetText', 'Get-JqMatchingBracket', 'Get-LsDisplayName', 'Get-LsEntryFromFsi', 'Get-LsEntryFromPsItem', 'Initialize-BrowseAdapters', 'Invoke-BashBg', # Invoke-BashEcho / Invoke-BashKill / Invoke-BashRedirect migrated to binary # cmdlets (PsBash.Cmdlets); they are no longer psm1 functions, so exporting them # here was stale (harmless — PowerShell ignores missing names — but misleading). 'Invoke-BashFg', 'Invoke-BashJobs', # Wrapper: normalizes 'sed -e A -e B' to '-e @(A,B)' so the underlying # binary cmdlet's array Expression parameter accepts repeated -e. 'Invoke-BashSed', # Wrapper: bundles repeated -e patterns and split bundles whose letters # prefix-match common parameters (-ie / -ve / -we) before the cmdlet # binder sees them; also disambiguates -E (extended regex flag). 'Invoke-BashGrep', 'Invoke-BashWait', 'Invoke-BashBind', 'Invoke-BashCaller', 'Invoke-BashDisown', 'Invoke-BashEnable', 'Invoke-BashLogout', 'Invoke-BashSuspend', 'Invoke-BrowseAction', 'Invoke-BrowseCommand', 'Invoke-BrowseInteractive', 'Invoke-JqFilter', 'Invoke-JqIf', 'Invoke-JqRecurse', 'Invoke-JqSelect', 'Invoke-ProcessSub', 'New-BashProcessSubPath', 'Invoke-ProcessSubPipeline', 'Invoke-ProcessSubString', 'New-BashObject', 'New-BrowseAction', 'New-BrowseAdapter', 'New-BrowseBinding', 'New-BrowseSafetyPreview', 'Register-BrowseAdapter', 'Get-BrowseAdapter', 'Unregister-BrowseAdapter', 'New-FlagDefs', 'Open-BashFileReader', 'Read-BashFileBytes', 'Read-BashFileLines', 'Read-BashFileRaw', 'Read-BashFileStreaming', 'Register-BashCompletions', 'Register-BashLsProvider', 'Remove-BashBgFinished', 'Remove-BashBgState', 'Resolve-BashCommand', 'Resolve-BashGlob', 'Resolve-BrowseAdapter', 'Resolve-JqDotPath', 'Resolve-JqStringInterpolation', 'Set-BashDisplayProperty', 'Set-BashErrorMode', 'Show-BashHelp', 'Split-JqComma', 'Split-JqPipe', 'Test-BashHelpFlag', 'Test-BrowseCommandRequiresConfirmation', 'Write-BashBgSignalReport', 'Write-BashError', 'Write-BashFileRaw', 'Write-BashFileText', 'Write-BashHostStderr' ) # Cmdlets to export from this module. The psm1 imports PsBash.Cmdlets.dll # via -Global; its exported cmdlets propagate to this module's session state # and need to be re-exported through this entry to be Get-Command-resolvable. # Wildcard form keeps the manifest in sync with the binary surface without a # per-cmdlet list duplicating PsBash.Cmdlets.psd1. CmdletsToExport = '*' # Variables to export from this module # VariablesToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = 'echo', 'printf', 'ls', 'cat', 'grep', 'sort', 'head', 'tail', 'wc', 'find', 'stat', 'cp', 'mv', 'rm', 'mkdir', 'rmdir', 'touch', 'ln', 'ps', 'sed', 'awk', 'cut', 'tr', 'uniq', 'rev', 'nl', 'diff', 'comm', 'column', 'join', 'paste', 'tee', 'xargs', 'jq', 'date', 'seq', 'expr', 'du', 'tree', 'env', 'nohup', 'printenv', 'true', 'false', 'basename', 'dirname', 'cd', 'pwd', 'hostname', 'whoami', 'uname', 'fold', 'expand', 'unexpand', 'strings', 'split', 'tac', 'base64', 'md5sum', 'sha1sum', 'sha256sum', 'file', 'od', 'chmod', 'rg', 'cd', 'gzip', 'gunzip', 'zcat', 'tar', 'yq', 'xan', 'sleep', 'time', 'which', 'unalias', 'readlink', 'mktemp', 'type', 'bash', 'sh', 'wait', 'jobs', 'fg', 'bg', 'shift', 'getopts', 'flock', 'timeout', 'times', 'history', 'fc', 'hash', 'umask', 'ulimit', 'compgen', 'realpath', 'command', 'source', 'unset', 'pushd', 'popd', 'dirs', 'yes', 'tput', 'shopt', # NB: the '[' alias (the bash `test` builtin) is intentionally NOT # listed here. A bare '[' is an invalid wildcard pattern that breaks # Test-ModuleManifest and Publish-Module ("wildcard character pattern # is not valid: ["). The psm1 registers '[' via a global AllScope # Set-Alias on import, so the command is still available to users. 'kill', 'test', 'let', 'id', 'shuf', 'balias', 'install', 'browse', 'more', 'less', 'trap', 'alias', 'mapfile', 'readarray', 'ping', 'tracert', 'traceroute', 'psgit', 'gtui', 'psav', 'psffmpeg', 'avtui' # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ Tags = @('bash', 'linux', 'cross-platform', 'cli', 'grep', 'awk', 'sed', 'jq', 'pipeline', 'typed-objects', 'powershell-module', 'devops', 'unix', 'shell', 'commands', 'windows', 'macos', 'PSEdition_Core') LicenseUri = 'https://github.com/standardbeagle/ps-bash/blob/main/LICENSE' ProjectUri = 'https://github.com/standardbeagle/ps-bash' # ReleaseNotes of this module ReleaseNotes = 'v0.15.4: Embedding and fixes. An embedding host that runs several sessions in one process can lend a credential to ONE session (ShellSecrets.Register): $NAME, $env:NAME and printenv read it in that session only, a child program gets exactly the granted secrets (export grants nothing, NAME=v cmd grants it to that command, env -i gives it to nobody), and env, printenv, set, declare -p and Get-ChildItem Env: list it as NAME=‹secret›. ${a[@]:o:n} copies only the selected elements, parsed arithmetic is cached, the 100k loop-pass limit is gone (bash has none), and the host gives memory back after a command (400 small commands end at about 253 MB instead of 410 MB). A leading | (| cat, ! | cat) is a syntax error, as in bash. A socket-path override longer than sun_path is a clear error instead of a launcher crash. v0.15.3: Performance and embedding. A bash array that a script grows (a+=(x)) or writes by element (a[i]=v) is a persistent vector: append and element-write loops are linear instead of quadratic (40k appends: 14.5 s -> 1.0 s; 40k element writes: 91 s -> 1.9 s), ${#a[@]} no longer copies the array, and a subshell, function scope or background job still never sees another copy''s writes. An embedding host can lend its terminal to the full-screen programs a session runs (vim, htop, less) instead of piping them. v0.15.2: Bash-compatibility fixes. On Windows a lowercase spelling of a reserved name (path, tmp, temp, home, os) is its own variable, as in bash; Windows spellings (windir, SystemRoot) list upper-cased as in Git Bash, and set -x prints the bash name. unset -n drops a nameref, unset reads clustered options (-vn, -nf) and --, a nameref or attribute declared in a subshell ends with it, and a nameref declared with no target is listed, takes its target from the first write (assignment, for, read, printf -v), is unbound under set -u, and becomes an array when one is assigned to it. fc -l ranges, fc -s and fc -e - re-run as bash 5.2 does, in the caller (return, break, local), and history takes -d ranges, -p expansion and -anrw; history modifiers chain (:s, :gs, :&). A quoted builtin name (local, export, eval, return) runs the builtin and skips any alias, and a quoted declaration builtin splits its words as bash does. A return inside a redirected group, loop, if or case leaves the function; a run-time local is always local. Bash text built at run time (eval, trap, a nested bash -c) never runs as PowerShell. Under set -e a redirect that cannot open its file ends the shell. bash FILE exits 127 when FILE is missing and 126 when it is a directory. Array writes in a pipe stage or command substitution are several times faster. Container setups for Windows (Nano Server, Server Core) and Linux in docker/, with a CI smoke test. sed, grep, expr and find share one GNU regex translator (sed: last-regex reuse, N line numbers, -f error lines, s/y escapes). $SECONDS counts from the shell start and honours assignment; && / || operands record PIPESTATUS. Hosts: on Linux a session''s warm host no longer exits seconds after each command; nested and overflow commands run on warm slots, not fresh hosts; install drains old hosts once idle instead of killing a running command (host drain). v0.15.1: Bash-compatibility fixes. A pipe stage is a subshell: cd, source, set, umask and the other state builtins in it change nothing in the caller. Refused assignments (readonly, a[]=, circular nameref) drop the rest of the line as bash does, and end the shell under set -e or posix. local -a/-A and declare in a function make a local array; a callee''s array write reaches the caller''s local; a local''s attributes and nameref are its frame''s. Diagnostics name the script and line (t.sh: line N:) for refusals, bad subscripts, failglob, ambiguous redirects and arithmetic errors; an arithmetic error discards the line. A builtin given too many arguments drops the line; exec reads the stdin it inherits; a piped script (cat f | bash) is read from stdin; env -i no longer clears the host environment; time and timeout pass their pipe byte for byte; every command rejects an option it does not have; on Windows the output of a redirected nohup command run by the Git ls/sh reaches its file, and 2> truncates. v0.15.0: Bash-compatibility release (XFAIL marks in the bash spec suite 140 -> 79). BREAKING: paths a script sees use forward slashes on Windows ($PWD, ~, $HOME, mktemp, realpath print C:/x; input still accepts C:\x and /c/x); bash code no longer resolves PowerShell aliases (gci, iex, r are command not found, 127, unless a function or program has the name; use the full cmdlet name); a nested shell sees exported variables only (x=1; sh -c "echo $x" prints an empty line; use export; a plain prog still sees all). Background jobs: output streams as the job runs, in launch order, with bounded memory; a job reads its own copy of the variables; a job sleep counts from its &. New: kill -SIG $$ and signals sent to a shell pid reach its trap; hash keeps the bash table; BASH_LINENO; --rcfile; a session whose hosts are all busy runs the command on a private host (PSBASH_EXEC_OVERFLOW_MS). Fix: pasted Unicode quote and dash marks no longer break the emitted PowerShell; line tools join a piece without its newline into the next line (printf a | sed); a while-read pipe stage reads lines as they are written; set -e ends a failing pipe stage; exit, break and errexit stop at subshell boundaries; pipefail after && and ||; an assignment sets PIPESTATUS; stopping a child ends its whole process tree; a 2>&1 child keeps its write order; a nested bash streams and is never timed out; a record keeps its trailing empty lines; base64 and od stream endless input; /dev/* names are never opened as files; file redirects write as output is produced; readlink and realpath canonicalize like GNU; kill -l prints the bash signal table; {a,} is one word; command and nohup run #! scripts; command not found carries the bash line prefix. Builtins and variables: help, bind, caller, enable, disown, logout, suspend; PPID, SHLVL, SRANDOM, BASH_SUBSHELL, default IFS; exec N<>file read-write descriptors; a DEBUG trap set on one line fires. Commands: GNU option parsing for uname, shuf, id, ping and tee; seq, tr, touch and install operand errors; date MMDDhhmm; env -C runs pwd in DIR; mkdir dir/; kill -RTMIN+N; a #! script reads the exact bytes piped to it. macOS: scripts no longer die with exit 138 (SIGUSR1 is left to the .NET runtime); stat, signals and ioctl are decoded per OS and arch. Known issues: docs/known-issues.md. Older versions: https://github.com/standardbeagle/ps-bash/releases' } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } |