Project

ImagePlayground

Automate image processing, codes, metadata, charts, topology, and visual stories from PowerShell.

Stars 101
Forks 7
Total downloads 711,982
Release ImagePlayground-PowerShellModule.v3.2.7
Language: C# Updated: 2026-10-26
Command

New-ImageQRCodeOtp

Module
ImagePlayground
Inputs
System.String

Generates a QR code for one-time-password configuration.

Syntax

New-ImageQRCodeOtp
[-Algorithm <Sha1|Sha256|Sha512>]
[-BackgroundColor <Color>]
[-Counter <Int32>]
[-Digits <Int32>]
[-FilePath] <String>
[-ForegroundColor <Color>]
[[-Issuer] <String>]
[[-Label] <String>]
[-Period <Int32>]
[-PixelSize <Int32>]
[-SecretBase32] <String>
[-Show]
[-Type] <Totp|Hotp>
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Use this cmdlet to create QR codes for authenticator apps that support TOTP or HOTP provisioning.

Examples

Create a TOTP QR code

New-ImageQRCodeOtp -Type Totp -SecretBase32 'JBSWY3DPEHPK3PXP' -Label 'john.doe@evotec.pl' -Issuer 'Evotec' -FilePath otp.png

Creates a QR code that can be scanned into a typical authenticator app for time-based MFA.

Create an HOTP QR code with a custom counter

New-ImageQRCodeOtp -Type Hotp -SecretBase32 'JBSWY3DPEHPK3PXP' -Label 'lab-token' -Issuer 'Evotec Lab' -Counter 10 -Digits 8 -Algorithm Sha256 -FilePath hotp.png

Creates a counter-based OTP payload for systems that use event-driven one-time passwords.

Parameters

-Algorithm OtpAlgorithm optional
Hash algorithm.
Possible values: Sha1, Sha256, Sha512
-BackgroundColor Color optional
Background color of the QR code.
-Counter Int32 optional
Counter for HOTP.
-Digits Int32 optional
Number of digits.
-FilePath String requiredposition: 4pipeline: True (ByValue)
The image format is inferred from the file extension.
-ForegroundColor Color optional
Foreground color of QR modules.
-Issuer String optionalposition: 3
Issuer name.
-Label String optionalposition: 2
Account label.
-Period Int32 optional
Period for TOTP.
-PixelSize Int32 optional
Pixel size for each QR module.
-SecretBase32 String requiredposition: 1
Base32-encoded secret.
-Show SwitchParameter optional
Opens the image after creation.
-Type OtpAuthType requiredposition: 0
OTP type.
Possible values: Totp, Hotp

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.