diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f18b16..cdec597 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). @@ -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 \ No newline at end of file diff --git a/PSShlink/PSShlink.psd1 b/PSShlink/PSShlink.psd1 index 7776148..fc19686 100644 --- a/PSShlink/PSShlink.psd1 +++ b/PSShlink/PSShlink.psd1 @@ -3,7 +3,7 @@ # # Generated by: Adam Cook (@codaamok) # -# Generated on: 08/09/2021 +# Generated on: 11/20/2021 # @{ @@ -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' @@ -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 = '' diff --git a/docs/New-ShlinkUrl.md b/docs/New-ShlinkUrl.md index 560c92a..0c64bc8 100644 --- a/docs/New-ShlinkUrl.md +++ b/docs/New-ShlinkUrl.md @@ -15,8 +15,9 @@ Creates a new Shlink short code on your Shlink server. ``` New-ShlinkUrl [-LongUrl] [[-CustomSlug] ] [[-Tags] ] [[-ValidSince] ] [[-ValidUntil] ] [[-MaxVisits] ] [[-Title] ] [[-Domain] ] - [[-ShortCodeLength] ] [-FindIfExists] [-DoNotValidateUrl] [[-Crawlable] ] - [[-ShlinkServer] ] [[-ShlinkApiKey] ] [] + [[-ShortCodeLength] ] [[-FindIfExists] ] [[-ValidateUrl] ] + [[-ForwardQuery] ] [[-Crawlable] ] [[-ShlinkServer] ] + [[-ShlinkApiKey] ] [] ``` ## DESCRIPTION @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/docs/Save-ShlinkUrlQrCode.md b/docs/Save-ShlinkUrlQrCode.md index dd1ab01..256e211 100644 --- a/docs/Save-ShlinkUrlQrCode.md +++ b/docs/Save-ShlinkUrlQrCode.md @@ -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 @@ -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 @@ -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 @@ -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 @@ -174,7 +176,7 @@ Aliases: Required: False Position: Named -Default value: L +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/docs/Set-ShlinkUrl.md b/docs/Set-ShlinkUrl.md index 7ab098a..053f0af 100644 --- a/docs/Set-ShlinkUrl.md +++ b/docs/Set-ShlinkUrl.md @@ -14,8 +14,9 @@ Update an existing short code on the Shlink server. ``` Set-ShlinkUrl [-ShortCode] [[-LongUrl] ] [[-Tags] ] [[-ValidSince] ] - [[-ValidUntil] ] [[-MaxVisits] ] [[-Title] ] [[-Domain] ] [-DoNotValidateUrl] - [[-Crawlable] ] [[-ShlinkServer] ] [[-ShlinkApiKey] ] [] + [[-ValidUntil] ] [[-MaxVisits] ] [[-Title] ] [[-Domain] ] + [[-ValidateUrl] ] [[-ForwardQuery] ] [[-Crawlable] ] [[-ShlinkServer] ] + [[-ShlinkApiKey] ] [] ``` ## DESCRIPTION @@ -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 @@ -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 @@ -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 @@ -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