{"id":19990740,"url":"https://github.com/thomas-illiet/Hangfire.PowerShellExecutor","last_synced_at":"2025-05-04T10:30:42.470Z","repository":{"id":38039931,"uuid":"382603130","full_name":"thomas-illiet/Hangfire.PowerShellExecutor","owner":"thomas-illiet","description":"A plugin for Hangfire that allows you to easily launch your powershell scripts.","archived":false,"fork":false,"pushed_at":"2023-04-28T09:57:50.000Z","size":91,"stargazers_count":13,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T05:39:11.535Z","etag":null,"topics":["addon","console","hangfire","jobs","powershell","script","utility","windows"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Hangfire.PowerShellExecutor/","language":"C#","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/thomas-illiet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-03T11:52:45.000Z","updated_at":"2024-08-27T08:31:50.000Z","dependencies_parsed_at":"2024-11-13T04:52:32.865Z","dependency_job_id":"bf0095cb-7115-43c8-9c0b-899a5e223999","html_url":"https://github.com/thomas-illiet/Hangfire.PowerShellExecutor","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas-illiet%2FHangfire.PowerShellExecutor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas-illiet%2FHangfire.PowerShellExecutor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas-illiet%2FHangfire.PowerShellExecutor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomas-illiet%2FHangfire.PowerShellExecutor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomas-illiet","download_url":"https://codeload.github.com/thomas-illiet/Hangfire.PowerShellExecutor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252319950,"owners_count":21729039,"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":["addon","console","hangfire","jobs","powershell","script","utility","windows"],"created_at":"2024-11-13T04:51:27.099Z","updated_at":"2025-05-04T10:30:42.009Z","avatar_url":"https://github.com/thomas-illiet.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# \u003cimg align=\"center\" style=\"height:80px;margin-right:10px\" src=\"https://raw.githubusercontent.com/thomas-illiet/Hangfire.PowerShellExecutor/main/Assets/Icon.png\"/\u003e PowerShellExecutor\n\n[![NuGet](https://img.shields.io/nuget/vpre/Hangfire.PowerShellExecutor)](https://www.nuget.org/packages/Hangfire.PowerShellExecutor/)\n[![NuGet](https://img.shields.io/nuget/dt/Hangfire.PowerShellExecutor)](https://www.nuget.org/packages/Hangfire.PowerShellExecutor/)\n[![Tests](https://github.com/thomas-illiet/Hangfire.PowerShellExecutor/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/thomas-illiet/Hangfire.PowerShellExecutor/actions/workflows/build-and-test.yml)\n[![CodeQL](https://github.com/thomas-illiet/Hangfire.PowerShellExecutor/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/thomas-illiet/Hangfire.PowerShellExecutor/actions/workflows/codeql-analysis.yml)\n![MIT License](https://img.shields.io/badge/license-MIT-orange.svg)\n\nA plugin for Hangfire that allows you to easily launch your powershell scripts.\n\n![dashboard](Assets/Dashboard.png)\n\n*In this screenshot i'm using [MissionControl](https://github.com/ahydrax/Hangfire.MissionControl) to facilitate the creation of jobs.*\n\nRead about hangfire here: \u003chttps://github.com/HangfireIO/Hangfire\u003e here: \u003chttp://hangfire.io\u003e\n\n## Features\n\n* **Noob Friendly**: Allow to easily launch your powershell scripts.\n* **100% Safe**: no Hangfire-managed data (e.g. jobs, states) is ever updated, hence there's no risk to corrupt it.\n* *(blah-blah-blah)*\n\n## Setup\n\nInstall NuGet package, and configure the [console](https://github.com/pieceofsummer/Hangfire.Console) in .NET Core's Startup.cs:\n\n```c#\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddHangfire(config =\u003e\n    {\n        config.UseMemoryStorage();\n        config.UseConsole();\n    });\n    services.AddPSExecutorExtensions();\n}\n```\n\nOtherwise,\n\n```c#\nGlobalConfiguration.Configuration\n    .UseMemoryStorage()\n    .UseConsole();\nservices.AddPSExecutorExtensions();\n```\n\n**NOTE**: If you have Dashboard and Server running separately, you'll need to call `UseConsole()` on both.\n\n## Example\n\n```C#\nusing Hangfire.MissionControl;\nusing Hangfire.Server;\nusing System.Threading;\n\nnamespace Hangfire.PowerShellExecutor.Test\n{\n    [MissionLauncher(CategoryName = \"TestSuite\")]\n    public class TestSuite\n    {\n        private readonly PSExecutorBuilder _executorBuilder;\n\n        public TestSuite (PSExecutorBuilder executorBuilder)\n        {\n            _executorBuilder = executorBuilder;\n        }\n\n        public void WithInjection(PerformContext context, CancellationToken cancellationToken)\n        {\n            var localProcess = _executorBuilder\n                .SetCommand(\"Get-ChildItem\")\n                .SetExecutionPolicy(PSExecutionPolicy.Bypass)\n                .Build();\n            localProcess.Start(cancellationToken);\n        }\n\n        public void WithoutInjection(PerformContext context, CancellationToken cancellationToken)\n        {\n            var localProcess = new PSExecutorBuilder(context)\n                .SetCommand(\"Get-ChildItem\")\n                .SetExecutionPolicy(PSExecutionPolicy.Bypass)\n                .Build();\n            localProcess.Start(cancellationToken);\n        }\n\n        public void WithParameter(PerformContext context, CancellationToken cancellationToken)\n        {\n            var localProcess = new PSExecutorBuilder(context)\n                .AddParameter(\"PE_TEST01\", \"TEST01\")\n                .AddParameter(\"PE_TEST02\", \"TEST02\")\n                .SetCommand(\"Get-ChildItem -Path Env:\")\n                .SetExecutionPolicy(PSExecutionPolicy.Bypass)\n                .Build();\n            localProcess.Start(cancellationToken);\n        }\n\n        public void WithSecret(PerformContext context, CancellationToken cancellationToken)\n        {\n            var localProcess = new PSExecutorBuilder(context)\n                .AddSecret(\"PE_TEST01\", \"8SE2vsPH$AZrGHq4u*t\")\n                .AddSecret(\"PE_TEST02\", \"xr^!!DjA7C**7YyH%AF\")\n                .SetCommand(\"Get-ChildItem -Path Env:\")\n                .SetExecutionPolicy(PSExecutionPolicy.Bypass)\n                .Build();\n            localProcess.Start(cancellationToken);\n        }\n\n        public void WithExternalFile(PerformContext context, CancellationToken cancellationToken)\n        {\n            var localProcess = new PSExecutorBuilder(context)\n                .SetFile(@\"D:\\Scripts\\FileScript.ps1\")\n                .SetExecutionPolicy(PSExecutionPolicy.Bypass)\n                .Build();\n            localProcess.Start(cancellationToken);\n        }\n\n        public void WithError(PerformContext context, CancellationToken cancellationToken)\n        {\n            var localProcess = new PSExecutorBuilder(context)\n                .SetCommand(\"Write-Error 'Test''\")\n                .SetExecutionPolicy(PSExecutionPolicy.Bypass)\n                .Build();\n            localProcess.Start(cancellationToken);\n        }\n    }\n}\n\n```\n\n## License\n\nAuthored by: Thomas ILLIET\n\nThis project is under MIT license. You can obtain the license copy [here](https://github.com/thomas-illiet/Hangfire.PowerShellExecutor/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomas-illiet%2FHangfire.PowerShellExecutor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomas-illiet%2FHangfire.PowerShellExecutor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomas-illiet%2FHangfire.PowerShellExecutor/lists"}