# New-ImageQRCodeOtp

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

Project

ImagePlayground

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

[View on GitHub](https://github.com/EvotecIT/ImagePlayground) [Visit Website](#) [Releases](https://github.com/EvotecIT/ImagePlayground/releases) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/ImagePlayground)

Stars **102**

Forks **7**

Open issues 

Total downloads **708,853**

Release **ImagePlayground-PowerShellModule.v3.2.7**

Language: C# Updated: 2026-11-18

Command 

**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>]
```

[#](#method-new-imageqrcodeotp-otpalgorithm-color-int32-int32-string-color-string-string-int32-int32-string-switchparameter-otpauthtype)

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

```powershell
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

```powershell
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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:3207F42B0B718AECF738BA9AD7F1CE4B8213563555DD8E1212B6113823BA0D17 -->
