{"id":26947364,"url":"https://github.com/r8vnhill/pwsh-fun","last_synced_at":"2025-04-02T20:19:07.046Z","repository":{"id":45170498,"uuid":"410323945","full_name":"r8vnhill/pwsh-fun","owner":"r8vnhill","description":"Because PowerShell can be fun (at least that's what I tell myself)","archived":false,"fork":false,"pushed_at":"2023-08-06T20:27:29.000Z","size":116,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-06T21:39:50.829Z","etag":null,"topics":["powershell"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r8vnhill.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-25T16:29:03.000Z","updated_at":"2022-05-15T02:34:29.000Z","dependencies_parsed_at":"2023-01-23T02:31:16.594Z","dependency_job_id":null,"html_url":"https://github.com/r8vnhill/pwsh-fun","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r8vnhill%2Fpwsh-fun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r8vnhill%2Fpwsh-fun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r8vnhill%2Fpwsh-fun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r8vnhill%2Fpwsh-fun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r8vnhill","download_url":"https://codeload.github.com/r8vnhill/pwsh-fun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246884737,"owners_count":20849554,"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":["powershell"],"created_at":"2025-04-02T20:19:06.399Z","updated_at":"2025-04-02T20:19:07.030Z","avatar_url":"https://github.com/r8vnhill.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pwsh-Fun (or the Functions I Use)\n\n![http://creativecommons.org/licenses/by/4.0/](https://i.creativecommons.org/l/by/4.0/88x31.png)\n\nThis work is licensed under a\n[Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/)\n\nBecause PowerShell can be fun (at least that's what I tell myself).\nHere are some utility functions that can help you to use the Power of your Shell (I can't believe I\nseriously wrote that).\n\n## Installation\n\nTo use the modules from *Pwsh-Fun* you need to include the code from this repository in your \n*PowerShell Modules* (or simply *Modules*) path.\n\nLet's first start by cloning the repository into an empty directory using your favorite cloning \nmethod.\nI'd recommend using *GitHub CLI*:\n\n```bash\ngh repo clone r8vnhill/pwsh-fun\n```\n\nNow, with the repository cloned, we'll move the contents from the repo to the *Modules* path, in\n*PowerShell*:\n\n```powershell\n$PS_PROFILE_DIRECTORY = $(Get-Item $PROFILE).Directory.FullName\nif (-not $(Test-Path $PS_PROFILE_DIRECTORY\\Modules)) {\n  New-Item -ItemType Directory -Force -Path $PS_PROFILE_DIRECTORY\\Modules\n}\nGet-ChildItem -Path .\\pwsh-fun\\* -Recurse -Force `\n  | Move-Item -Destination \"$PS_PROFILE_DIRECTORY\\Modules\\\"\nRemove-Item -Path .\\pwsh-fun -Force -Recurse\n```\n\nThis will make the modules accessible to *PowerShell*, you must start a new console to see the \nchanges.\n\n## Updating the Modules\n\nSince we copied all the repository's contents in the previous step, the *Modules* directory is now\nthe root of the repository.\nThe repo is configured to only track the directories which name starts with ``Ravenhill.``, so every\nchange you do on other files or directories will be ignored by *Git*, this will allow you to update\nthe modules easily by simply doing ``git pull`` on the *Modules* root.\n\n## Modules Documentation\n\nThis repository is organized as multiple directories (*Modules*) grouping the commands according\nto their functionality.\nEach module has it's own ``README.md`` file explaining the contained commands.\n\n\u003c!-- ## ConvertTo-Mp3\n\nConverts a list of files to mp3.\n\nMakes a conversion of all valid audio files of a directory to .mp3 extension using _ffmpeg_.\n\n### SYNTAX\n```powershell\nConvertTo-MP3 [-Path] \u003cString\u003e [-Cleanup] [\u003cCommonParameters\u003e]\n```\nUsing the ``Cleanup`` flag will delete the original audio files if the conversion was successful.\n\n## Ceil\n\nCalculates the ceiling of a number.\n\nFor any _x_ returns the **closest integer** that's **greater or equal** than _x_.\n\n### SYNTAX\n```powershell\nCeil [[-x] \u003cDouble\u003e] [\u003cCommonParameters\u003e]\n```\n\n## Invoke-GradleRun\n\nInvokes a `gradle run` Task and waits for it to finish it's execution.\n### SYNTAX\n\n```powershell\nInvoke-GradleRun [-Path] \u003cString\u003e [[-Arguments] \u003cString[]\u003e] [\u003cCommonParameters\u003e]\n```\n#### PARAMETERS \n- ``Path``: The path to a folder containing a ``gradle.build`` or ``gradle.build.kts`` file.\n\n### EXAMPLES\n\n```powershell\nfunction Some-Function {\n  Invoke-GradleRun -Path 'C:\\Some\\Function\\Path\\GradleProject' $Args\n}\n```\n\n## Test-Command\n\nChecks if a command exists.\n\n### SYNTAX\n\n```powershell\nTest-Command [-Command] \u003cString\u003e [\u003cCommonParameters\u003e]\n```\n#### PARAMETERS\n```powershell\n-Command \u003cString\u003e\n  The name of the command to check.\n```\n\n#### Examples\n```powershell\nPS\u003e Test-Command winget\nTrue\n```\n---\n```powershell\nPS\u003e Test-Command julia\nFalse\n```\n---\n```powershell\nPS\u003e 'julia' | Test-Command\nFalse\n```\n\n## Test-Application\n\nChecks if an application is installed on the system.\n\n\n### SYNTAX\n```powershell\nTest-Application [[-Name] \u003cString\u003e] [\u003cCommonParameters\u003e]\n\nTest-Application [-DisplayName] \u003cString\u003e [\u003cCommonParameters\u003e]\n```\n\n### PARAMETERS\n\n```powershell\n-DisplayName \u003cString\u003e\n    The display name of the application.\n\n-Name \u003cString\u003e\n    The name of the process that identifies the application.\n```\n\n### Examples\n\n```powershell\nPS\u003e Test-Application 'NVIDIA Web Helper.exe'\n# True if the service NVIDIA Web Helper is registered, False otherwise\n```\n\n---\n\n```powershell\nPS\u003e Test-Application -Name '7-zip'\n# True if 7-zip is installed, false otherwise\n```\n\n---\n```powershell\nPS\u003e Test-Application -DisplayName '3Tene'\n# True if 3Tene is installed, regardless of the installation method\n# (If using Steam this could have been registered with a 'Name' like Steam App XXXXXX)\n``` --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr8vnhill%2Fpwsh-fun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr8vnhill%2Fpwsh-fun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr8vnhill%2Fpwsh-fun/lists"}