{"id":14063830,"url":"https://github.com/secretGeek/ok-ps","last_synced_at":"2025-07-29T16:34:18.827Z","repository":{"id":150237212,"uuid":"116189746","full_name":"secretGeek/ok-ps","owner":"secretGeek","description":".ok folder profiles for Powershell","archived":false,"fork":false,"pushed_at":"2023-07-18T08:47:39.000Z","size":79,"stargazers_count":34,"open_issues_count":4,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-13T07:05:33.021Z","etag":null,"topics":["commands","folder-profiles","powershell"],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secretGeek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-01-03T22:49:13.000Z","updated_at":"2024-07-03T11:18:11.000Z","dependencies_parsed_at":"2024-02-07T17:04:01.307Z","dependency_job_id":"faebbd03-71ca-489b-82d1-18626b8b106d","html_url":"https://github.com/secretGeek/ok-ps","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/secretGeek%2Fok-ps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretGeek%2Fok-ps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretGeek%2Fok-ps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretGeek%2Fok-ps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secretGeek","download_url":"https://codeload.github.com/secretGeek/ok-ps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228032909,"owners_count":17858913,"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":["commands","folder-profiles","powershell"],"created_at":"2024-08-13T07:03:31.749Z","updated_at":"2024-12-04T02:30:29.959Z","avatar_url":"https://github.com/secretGeek.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"# ok-ps\n\n## \"ok\" gives you .ok folder profiles for powershell\n\n(There is also a [bash version](https://github.com/secretGeek/ok-bash/))\n\n`ok` makes you smarter and more efficient.\n\nDo you work on many different projects? And in each project, are there commands or URLs you use that are specific to that project? You need a `.ok` file.\n\nA `.ok` file is a place to store any handy one-liners specific to the folder it is in. It can be viewed with a simple command. And commands in the `.ok` file can be executed immediately with the command `ok {number}` (example, `ok 3` to run the 3rd command.)\n\nImagine your `.ok` file contains these three lines:\n\n    build.ps1 # builds the project\n    deploy.ps1 # deploys the project\n    commit_push.ps1 $arg[0] # commit with comment, rebase and push\n\nA `.ok` file acts as a neat place to document how a given project works. This is useful if you have many projects, or many people working on a project. It's such a little file; it's quick to write, follows a [specification](#language-specification) (still in draft) and easy to edit.\n\nBut it's not just a document, it's executable.\n\nIf you run the command `ok` (with no parameters) you'll see the file listed, with numbers against each command:\n\n    \u003e ok\n    1: build.ps1             # builds the project\n    2: deploy.ps1            # deploys the project\n    3: commit_push.ps1 $arg  # commit with comment, rebase and push\n\nThen if you run `ok {number}` (ok followed by a number) you'll execute that line of the file.\n\n\t\u003e ok 1\n\t\u003e build.ps1 # builds the project\n\tbuilding.....\n\nAnd you can pass simple arguments to the commands. For example:\n\n\t\u003e ok 3 Added laser guidance system\n    \u003e commit_push.ps1 $arg # commit with comment, rebase and push\n\n\tCommitting with comment \"Added laser guidance system\"\n\tCommit succeeded.\n\tRebase successful\n\tPushing to master.\n\n\n💡 Tip: \".\" (i.e. source) the \"Invoke-OKCommand.ps1\" script from your `$profile`, e.g:\n\n    . .\\Invoke-OKCommand.ps1\n\nIt will give you the `ok` command (which is really an alias to `Invoke-OK`)\n\n## .ok file specification\n\nAn ok file consists of lines of text.\n\neach line is finished by a line break, or an end of file marker.\n\neach line either:\n\n- starts with a '#' character - indicating it is a comment. (can be preceeded by whitespace - spaces, tabs etc.) for example:\n\n        # This is a comment\n\n- or starts with a \"command name\" followed by a colon, followed by a powershell one-liner. For example:\n\n        build: .\\build.ps1   # call `ok build` to run the command `.\\build.ps1`\n\n  - \"A command name followed by a colon\" is identified by this regex:\n\n        [regex]$rx = \"^[ `t]*(?\u003ccommandName\u003e[A-Za-z_][A-Za-z0-9-_.]*)[ `t]*\\:(?\u003ccommandText\u003e.*)$\";\n\n- Or, if it matches neither of the above, it is treated as a pure powershell command. i.e. a powershell one liner. e.g.\n\n        .\\build.ps1 # execute this by calling `ok 1` (assuming it is the 1st line)\n\nSo there are two basic types of commands: named commands, and numbered commands. In fact, all commands are numbered, but if a command has a name, then the name is shown instead of the number.\n\nFor example, if this was your `.ok` file:\n\n    build: build.ps1 # builds the project\n    deploy.ps1 # deploys the project\n    commit: commit_push.ps1 $arg[0]\n\nCalling `ok` it would be displayed like this:\n\n\tbuild: build.ps1 # builds the project\n\t\t2: deploy.ps1 # deploys the project\n\t\t3: commit: commit_push.ps1 $arg[0]\n\nAnd the first line could be called either with `ok build` or `ok 1`.\n\n-----\n\n## Running Unit tests\n\nPowershell Unit tests rely on Pester 4+. Pester 3.4.0 is pre-installed on Windows 10.\n\n\tInstall-Module -Name Pester -Force -SkipPublisherCheck\n\nRun tests like this:\n\n\tok test\n\nOr\n\n\tInvoke-Pester\n\nOr:\n\n\tInvoke-Pester -Script .\\Get-OKCommandLength.Tests.ps1\n\n## Running Invoke-ScriptAnalyzer\n\nRequires the module `PSScriptAnalyzer` -- see [PS Gallery: PSScriptAnalyzer](https://www.powershellgallery.com/packages/PSScriptAnalyzer/)\n\n\tInstall-Module -Name PSScriptAnalyzer\n\nAnd can be executed like so:\n\n\tInvoke-ScriptAnalyzer *.ps1 -ExcludeRule PSAvoidUsingWriteHost | ft -auto\n\n-----\n\nSee \u003chttps://secretgeek.net/ok\u003e for the blog post launching (and describing) \"ok\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FsecretGeek%2Fok-ps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FsecretGeek%2Fok-ps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FsecretGeek%2Fok-ps/lists"}