Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/codaamok/psshlink
Browse files Browse the repository at this point in the history
  • Loading branch information
codaamok committed Nov 21, 2021
2 parents e49cd3b + 95a8f7f commit 29abf69
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 35 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.8.0] - 2021-11-20
### Added
- Improved build pipeline to use [codaamok.build](https://github.com/codaamok/codaamok.build)
- New `-ForwardQuery` boolean parameter in `New-ShlinkUrl` and `Set-ShlinkUrl` (new in Shlink 2.9.0).
Expand Down Expand Up @@ -86,11 +88,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial release

[Unreleased]: https://github.com/codaamok/PSShlink/compare/0.7.0..HEAD
[Unreleased]: https://github.com/codaamok/PSShlink/compare/0.8.0..HEAD
[0.8.0]: https://github.com/codaamok/PSShlink/compare/0.7.0..0.8.0
[0.7.0]: https://github.com/codaamok/PSShlink/compare/0.6.0..0.7.0
[0.6.0]: https://github.com/codaamok/PSShlink/compare/0.5.0..0.6.0
[0.5.0]: https://github.com/codaamok/PSShlink/compare/0.4.0..0.5.0
[0.4.0]: https://github.com/codaamok/PSShlink/compare/0.3.0..0.4.0
[0.3.0]: https://github.com/codaamok/PSShlink/compare/0.2.0..0.3.0
[0.2.0]: https://github.com/codaamok/PSShlink/compare/0.1.0..0.2.0
[0.1.0]: https://github.com/codaamok/PSShlink/tree/0.1.0
[0.1.0]: https://github.com/codaamok/PSShlink/tree/0.1.0
18 changes: 10 additions & 8 deletions PSShlink/PSShlink.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Adam Cook (@codaamok)
#
# Generated on: 08/09/2021
# Generated on: 11/20/2021
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = 'PSShlink.psm1'

# Version number of this module.
ModuleVersion = '0.7.0'
ModuleVersion = '0.8.0'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
Expand Down Expand Up @@ -112,14 +112,16 @@ PrivateData = @{

# ReleaseNotes of this module
ReleaseNotes = '# Added
- New function `Set-ShlinkDomainRedirects`, new in Shlink 2.8.0
- New `-ErrorCorrection` parameter for `Save-ShlinkUrlQrCode`, new in Shlink 2.8.0
- Improved build pipeline to use [codaamok.build](https://github.com/codaamok/codaamok.build)
- New -ForwardQuery boolean parameter in New-ShlinkUrl and Set-ShlinkUrl (new in Shlink 2.9.0).
# Changed
- Minimum Shlink version updated to 2.8.0
- Minimum Shlink version updated to 2.9.0
- Renamed parameter -DoNotValidateUrl of switch type to -ValidateUrl of boolean type for both New-ShlinkUrl and Set-ShlinkUrl.
- Parameter -FindIfExists is now of type boolean instead of switch in New-ShlinkUrl. is now a switch and not a boolean.
- Removed use of methods SecureStringToBSTR and PtrToStringAuto from Marshal .NET class for secure string handling in InvokeShlinkRestMethod, in favour of using GetNetworkCredential method from a PSCredential object.
- Save-ShlinkUrlQrCode no longer has hardcoded default parameter values (much like the API did) for size, margin, format, and error correction level.. Shlink 2.9.0 now lets you configure these defaults for QR codes, so by omitting values for these params, your server default values are used.
# Fixed
- Return exception `UnauthorizedAccessException` when Shlink returns 401. Previously `InvalidOperationException` was returned
# Security
- Default to https:// as -ShlinkServer if schema is not provided. Largely for security but also because of https://github.com/PowerShell/PowerShell/issues/14531'
- Corrected object reference to API URL attempted in ErrorRecord'

# Prerelease string of this module
# Prerelease = ''
Expand Down
38 changes: 27 additions & 11 deletions docs/New-ShlinkUrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ Creates a new Shlink short code on your Shlink server.
```
New-ShlinkUrl [-LongUrl] <String> [[-CustomSlug] <String>] [[-Tags] <String[]>] [[-ValidSince] <DateTime>]
[[-ValidUntil] <DateTime>] [[-MaxVisits] <Int32>] [[-Title] <String>] [[-Domain] <String>]
[[-ShortCodeLength] <Int32>] [-FindIfExists] [-DoNotValidateUrl] [[-Crawlable] <Boolean>]
[[-ShlinkServer] <String>] [[-ShlinkApiKey] <SecureString>] [<CommonParameters>]
[[-ShortCodeLength] <Int32>] [[-FindIfExists] <Boolean>] [[-ValidateUrl] <Boolean>]
[[-ForwardQuery] <Boolean>] [[-Crawlable] <Boolean>] [[-ShlinkServer] <String>]
[[-ShlinkApiKey] <SecureString>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -184,27 +185,42 @@ Accept wildcard characters: False
Specify this switch to first search and return the data about an existing short code that uses the same long URL if one exists.

```yaml
Type: SwitchParameter
Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -ValidateUrl
Control long URL validation while creating the short code.

```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Position: 11
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -DoNotValidateUrl
Disables long URL validation while creating the short code.
### -ForwardQuery
Forwards UTM query parameters to the long URL if any were passed to the short URL.

```yaml
Type: SwitchParameter
Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Position: 12
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -219,7 +235,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Position: 13
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -237,7 +253,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Position: 14
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -254,7 +270,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 12
Position: 15
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand Down
12 changes: 7 additions & 5 deletions docs/Save-ShlinkUrlQrCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Accept wildcard characters: False
### -Size
Specify the pixel width you want for your generated shortcodes.
The same value will be applied to the height.
If omitted, the default is 300.
If omitted, the default configuration of your Shlink server is used.

```yaml
Type: Int32
Expand All @@ -127,13 +127,14 @@ Aliases:

Required: False
Position: Named
Default value: 300
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```

### -Format
Specify whether you would like your QR codes to save as .png or .svg files.
If omitted, the default configuration of your Shlink server is used.

```yaml
Type: String
Expand All @@ -142,14 +143,14 @@ Aliases:

Required: False
Position: Named
Default value: Png
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Margin
Specify the margin/whitespace around the QR code image in pixels.
If omitted, the default is 0.
If omitted, the default configuration of your Shlink server is used.

```yaml
Type: Int32
Expand All @@ -166,6 +167,7 @@ Accept wildcard characters: False
### -ErrorCorrection
Specify the level of error correction you would like in the QR code.
Choose from L for low, M for medium, Q for quartile, or H for high.
If omitted, the default configuration of your Shlink server is used.

```yaml
Type: String
Expand All @@ -174,7 +176,7 @@ Aliases:

Required: False
Position: Named
Default value: L
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
Expand Down
34 changes: 25 additions & 9 deletions docs/Set-ShlinkUrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ Update an existing short code on the Shlink server.

```
Set-ShlinkUrl [-ShortCode] <String[]> [[-LongUrl] <String>] [[-Tags] <String[]>] [[-ValidSince] <DateTime>]
[[-ValidUntil] <DateTime>] [[-MaxVisits] <Int32>] [[-Title] <String>] [[-Domain] <String>] [-DoNotValidateUrl]
[[-Crawlable] <Boolean>] [[-ShlinkServer] <String>] [[-ShlinkApiKey] <SecureString>] [<CommonParameters>]
[[-ValidUntil] <DateTime>] [[-MaxVisits] <Int32>] [[-Title] <String>] [[-Domain] <String>]
[[-ValidateUrl] <Boolean>] [[-ForwardQuery] <Boolean>] [[-Crawlable] <Boolean>] [[-ShlinkServer] <String>]
[[-ShlinkApiKey] <SecureString>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -170,16 +171,31 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -DoNotValidateUrl
Disables long URL validation while creating the short code.
### -ValidateUrl
{{ Fill ValidateUrl Description }}

```yaml
Type: SwitchParameter
Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Position: 9
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -ForwardQuery
Forwards UTM query parameters to the long URL if any were passed to the short URL.

```yaml
Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -194,7 +210,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Position: 11
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -212,7 +228,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand All @@ -229,7 +245,7 @@ Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Expand Down

0 comments on commit 29abf69

Please sign in to comment.