{"id":14980422,"url":"https://github.com/codaamok/psshlink","last_synced_at":"2025-10-29T00:30:28.721Z","repository":{"id":79228465,"uuid":"307178589","full_name":"codaamok/PSShlink","owner":"codaamok","description":"An unofficial PowerShell module for Shlink (https://shlink.io), an open-source self-hosted and PHP-based URL shortener application","archived":false,"fork":false,"pushed_at":"2023-03-06T00:01:02.000Z","size":239,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T21:06:32.443Z","etag":null,"topics":["powershell","powershell-core","powershell-module","pwsh","shlink","url-shortener"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codaamok.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2020-10-25T19:43:43.000Z","updated_at":"2024-09-06T03:30:17.000Z","dependencies_parsed_at":"2023-06-01T19:30:46.307Z","dependency_job_id":null,"html_url":"https://github.com/codaamok/PSShlink","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codaamok%2FPSShlink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codaamok%2FPSShlink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codaamok%2FPSShlink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codaamok%2FPSShlink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codaamok","download_url":"https://codeload.github.com/codaamok/PSShlink/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238743887,"owners_count":19523195,"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","powershell-core","powershell-module","pwsh","shlink","url-shortener"],"created_at":"2024-09-24T14:01:45.055Z","updated_at":"2025-10-29T00:30:28.364Z","avatar_url":"https://github.com/codaamok.png","language":"PowerShell","readme":"# PSShlink\n| Branch | Build status | Last commit | Latest release | PowerShell Gallery | GitHub |\n|-|-|-|-|-|-|\n| `main` | [![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/codaamok/PSShlink/pipeline.yml?branch=main)](https://github.com/codaamok/PSShlink/actions) | [![GitHub last commit (branch)](https://img.shields.io/github/last-commit/codaamok/PSShlink/main?color=blue)](https://github.com/codaamok/PSShlink/commits/main) | [![GitHub release (latest by date)](https://img.shields.io/github/v/release/codaamok/PSShlink?color=blue)](https://github.com/codaamok/PSShlink/releases/latest) [![GitHub Release Date](https://img.shields.io/github/release-date/codaamok/PSShlink?color=blue)](https://github.com/codaamok/PSShlink/releases/latest) | [![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/PSShlink?color=blue)](https://www.powershellgallery.com/packages/PSShlink) | [![GitHub all releases](https://img.shields.io/github/downloads/codaamok/PSShlink/total?color=blue)](https://github.com/codaamok/PSShlink/releases) |\n\n\nAn unofficial PowerShell module for Shlink (https://shlink.io), an open-source self-hosted and PHP-based URL shortener application.\n\n## Functions\n\n- [Get-ShlinkDomains](docs/Get-ShlinkDomains.md)\n- [Get-ShlinkServer](docs/Get-ShlinkServer.md)\n- [Get-ShlinkTags](docs/Get-ShlinkTags.md)\n- [Get-ShlinkUrl](docs/Get-ShlinkUrl.md)\n- [Get-ShlinkVisits](docs/Get-ShlinkVisits.md)\n- [Get-ShlinkVisitsNonOrphan](docs/Get-ShlinkVisitsNonOrphan.md)\n- [Get-ShlinkVisitsOrphan](docs/Get-ShlinkVisitsOrphan.md)\n- [Invoke-ShlinkRestMethod](docs/Invoke-ShlinkRestMethod.md)\n- [New-ShlinkUrl](docs/New-ShlinkUrl.md)\n- [Remove-ShlinkTag](docs/Remove-ShlinkTag.md)\n- [Remove-ShlinkUrl](docs/Remove-ShlinkUrl.md)\n- [Save-ShlinkUrlQrCode](docs/Save-ShlinkUrlQrCode.md)\n- [Set-ShlinkDomainRedirects](docs/Set-ShlinkDomainRedirects.md)\n- [Set-ShlinkTag](docs/Set-ShlinkTag.md)\n- [Set-ShlinkUrl](docs/Set-ShlinkUrl.md)\n\n## Requirements\n\n- PowerShell 5.1 or newer (including PowerShell Core, 7.0 or newer)\n- Shlink 3.5.0 or newer\n  - If you need support for older versions of Shlink, you can still source older versions of PSShlink [here](https://github.com/codaamok/PSShlink/releases) or use the `-RequiredVersion` parameter of `Install-Module` when installed from the PowerShell Gallery\n\n## Getting started\n\nInstall and import:\n\n```powershell\nInstall-Module PSShlink -Scope CurrentUser\nImport-Module PSShlink\n```\n\nBe sure to check out the examples below.\n\n## Authentication\n\nEach function will have two parameters for authentication to your Shlink instance:\n\n- `-ShlinkServer`: a string value of the Shlink server address e.g. `https://example.com`\n- `-ShlinkApiKey`: a SecureString value for the Shlink server's API key\n\nAfter using any function of PSShlink for the first time after importing the module - which have both parameters `-ShlinkServer` and `-ShlinkApiKey` * - it is not necessary to use the parameters again in subsequent uses for other functions of PSShlink. These values are held in memory for as long as the PowerShell session exists.\n\n\\* Some functions do not require both `-ShlinkServer` and `-ShlinkApiKey`, e.g. `Get-ShlinkServer`. Therefore if the first function you use after importing PSShlink accepts only `-ShlinkServer`, you will not be asked again for this value by other functions of PSShlink. You will however be prompted for the API key. Again, subsequent uses of other functions will no longer require `-ShlinkServer` and `-ShlinkApiKey`.\n\nIf the first function you use after importing PSShlink requires `-ShlinkServer` and/or `-ShlinkApiKey` and you have not passed the parameter(s), you will be prompted for them.\n\n## Examples\n\nAll functions come with complete comment based help, so it is possible to find examples for each function using `Get-Help`. For example, use the following to see detailed help including examples for `Save-ShlinkUrlQrCode`:\n\n```powershell\nGet-Help Save-ShlinkUrlQrCode\n```\n\n___\n\n```powershell\n$Key = \"ba6c52ed-flk5-4e84-9fc7-9c7e34825da0\" | ConvertTo-SecureString -AsPlainText -Force\nGet-ShlinkUrl -SearchTerm \"oldWebsite\" -ShlinkServer \"https://myshlinkserver.com\" -ShlinkApiKey $Key\n```\n\nReturns all short codes which match the search term `oldWebsite`.\n\n___\n\n```powershell\nGet-ShlinkUrl -SearchTerm \"oldWebsite\" | Remove-ShlinkUrl\n```\n\nDeletes all short codes from the Shlink server which match the search term `oldWebsite`.\n\n___\n\n```powershell\nGet-ShlinkUrl -SearchTerm \"newWebsite\" | Save-ShlinkUrlQrCode\n```\n\nSaves QR codes for all short URLs which match the search term `newWebsite`. All files will be saved as the default values for size (300x300) and type (png). All files by default are saved in your Downloads directory using the naming convention: `ShlinkQRCode_\u003cshortCode\u003e_\u003cdomain\u003e_\u003csize\u003e.\u003cformat\u003e`. e.g. `ShlinkQRCode_asFk2_example-com_300.png`.\n\n___\n\n```powershell\nGet-ShlinkUrl -SearchTerm \"newWebsite\" | Set-ShlinkUrl -Tags \"newWebsite\" -MaxVisits 100\n```\n\nSets the tag `newWebsite` on all short codes matching the search term `newWebsite`. Also sets all matching short codes with a max visits value of 100.\n___\n\n```powershell\nNew-ShlinkUrl -LongUrl \"https://tools.ietf.org/html/rfc2549\" -CustomSlug \"rfc2549\" -Domain \"cookadam.co.uk\" -DoNotValidateUrl\n```\n\nCreates a new short code named `rfc2549` under the non-default domain `cookadam.co.uk`. The short code will redirect to `https://tools.ietf.org/html/rfc2549`. URL validation is not enforced.\n\n## Known issues\n\n- If you specify a URL for `-ShlinkServer` where the web server responds with a redirect (e.g. to convert the URL from `http://` to `https://`), you will experience odd behaviour. The symptoms you might observe, for example, `New-ShlinkUrl` will respond with the first 10 short codes on your Shlink instance instead of creating a new short URL. The root cause stems from `Invoke-RestMethod` not persisting HTTP methods through redirects; it persistently uses HTTP GET in subsequent calls after receiving a redirect status code from the server. In other words, `New-ShlinkUrl` will make a POST request and when it receives a redirect response, it will re-process the same request with the same parameters and body but through a HTTP GET request. \n  - See [Feature Request: create switch to persist HTTP method when following a redirect for Invoke-RestMethod or Invoke-WebRequest](https://github.com/PowerShell/PowerShell/issues/14531)\n\n## Support\n\nIf you experience any issues with PSShlink, please raise an issue on GitHub.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodaamok%2Fpsshlink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodaamok%2Fpsshlink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodaamok%2Fpsshlink/lists"}