{"id":20040745,"url":"https://github.com/poshcode/codeflow","last_synced_at":"2025-05-05T08:32:05.015Z","repository":{"id":69193857,"uuid":"45950573","full_name":"PoshCode/CodeFlow","owner":"PoshCode","description":"Functions for PowerShell code cleanup and generation","archived":false,"fork":false,"pushed_at":"2016-03-08T17:21:50.000Z","size":12,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-08T19:47:09.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PoshCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-11T00:50:30.000Z","updated_at":"2023-10-24T13:46:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3a3ce4a-32a6-49b7-97b2-d1190ae6325d","html_url":"https://github.com/PoshCode/CodeFlow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoshCode%2FCodeFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoshCode%2FCodeFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoshCode%2FCodeFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoshCode%2FCodeFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PoshCode","download_url":"https://codeload.github.com/PoshCode/CodeFlow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252466724,"owners_count":21752422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T10:43:36.507Z","updated_at":"2025-05-05T08:32:05.000Z","avatar_url":"https://github.com/PoshCode.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"This module is a combination of a few pieces I have written over the years, put together in what will hopefully become a cohesive set :wink:\n\n\n# The Expander Module\n\nThe primary (and most mature part) of this module are the Expander functions:\n\n## Expand-Alias \n\nExpand aliases and clean up short parameter names.\n\nThe unexpected bonus on this command are a whole bunch of  options to filter the commands and modules which are allowed in the resulting scripts (and throw errors if commands from other modules are used).  I added that functionality when I was trying to sanitize user input to a white list of modules/commands in an existing session (i.e. without using contrained endpoints, this lets you create a constrained language filter for script blocks).\n\n## Protect-Script\n\nA wrapper around Expand-Alias to make it easier to use for the purpose of constraining user input script blocks.\n\n## Resolve-Command\n\nA Get-Command wrapper which resolves aliases to the root command and supports whitelists of allowed modules and commands (primarily to support the previous two commands)\n\n\n\n# The Parser Module\n\nThe simplest part of this module is the Parser module which contains a few commands wrapped around the PowerShell language parser:\n\n## Confirm-RestrictedLanguage\n\nVerifies that a scriptblock is valid in restricted language mode\n\n## Invoke-Parser\n\nInvokes the language parser and returns a _single_ result object which includes the errors, the output Tokens and the AST.\n\n## Select-Ast\n\nAllows returning a filtered subset of the AST for a specific script (e.g. all IF statements).\n\n\n\n# The Formatting Module\n\nCurrently under development, these are functions for reformatting code to fix indenting etc.  I've just started this, so it's very error prone, and my next task is to write a few test cases for it to fail.\n\nThe goal is to use these functions in conjunction with Expand-Alias to clean up functions to a \"standard\" syntax format.\n\n\n# The CodeGen Module\n\nI have a few functions lying around for generating module skeletons and templating advanced functions. Those will go here shortly, but this is \"future\" work, for now.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposhcode%2Fcodeflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposhcode%2Fcodeflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposhcode%2Fcodeflow/lists"}