-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReset-YubiKey.ps1
29 lines (26 loc) · 913 Bytes
/
Reset-YubiKey.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<#
.SYNOPSIS
Fully reset a YubiKey
.PARAMETER Elevated
This parameter is for internal use to check whether an UAC prompt has already been attempted.
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter", "Elevated", Justification="Used in utils")]
param(
[switch]$Elevated
)
. "${PSScriptRoot}\Utils.ps1"
Elevate($myinvocation.MyCommand.Definition)
. "${PSScriptRoot}\venv\Scripts\activate.ps1"
Show-Output -ForegroundColor Cyan "Resetting FIDO"
ykman fido reset
Show-Output -ForegroundColor Cyan "Resetting OATH"
ykman oath reset
Show-Output -ForegroundColor Cyan "Resetting OpenPGP"
ykman openpgp reset
Show-Output -ForegroundColor Cyan "Resetting OTP slot 1"
ykman otp delete 1
Show-Output -ForegroundColor Cyan "Resetting OTP slot 2"
ykman otp delete 2
Show-Output -ForegroundColor Cyan "Resetting PIV"
ykman piv reset
Show-Output -ForegroundColor Green "Reset ready"