< Back
Unprotect-1PEntry
Post
NAME Unprotect-1PEntry
SYNOPSIS
Decrypts a 1Password Login, Password, Secure Note, or Generic Account.
SYNTAX
Unprotect-1PEntry [-Name] <String> [[-VaultPassword] <SecureString>] [-PasswordOnly] [-VaultPath <String>]
[<CommonParameters>]
Unprotect-1PEntry [-Name] <String> [[-VaultPassword] <SecureString>] [-PasswordOnly] -Clip [-VaultPath <String>]
[<CommonParameters>]
Unprotect-1PEntry [-Name] <String> [[-VaultPassword] <SecureString>] -Plaintext [-PasswordOnly] [-VaultPath
<String>] [<CommonParameters>]
Unprotect-1PEntry [-Entry] <PSObject> [[-VaultPassword] <SecureString>] [-PasswordOnly] -Clip [<CommonParameters>]
Unprotect-1PEntry [-Entry] <PSObject> [[-VaultPassword] <SecureString>] -Plaintext [-PasswordOnly]
[<CommonParameters>]
Unprotect-1PEntry [-Entry] <PSObject> [[-VaultPassword] <SecureString>] [-PasswordOnly] [<CommonParameters>]
DESCRIPTION
Decrypts a 1Password Login, Password, Secure Note, or Generic Account to various output formats.
Logins and Generic Adcounts are returned as PSCredential by default.
Passwords and Secure Notes are returned as SecureString by default.
All forms can optionally be returned as plaintext strings or copied to the clipboard.
PARAMETERS
-Name <String>
Specifies the name of the 1Password entry.
A case-insensitive wildcard match is used.
An error is thrown if no entries, or more than one entry, match the specified name.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Entry <PSObject>
Specifies the 1Password entry to decrypt.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-VaultPassword <SecureString>
Specifies the 1Password vault password.
If no value is specified, the user will be prompted to enter password interactively.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Plaintext [<SwitchParameter>]
If specified, the decrypted data will be returned as plaintext strings.
Logins and Generic Accounts will be returned as 2 strings (username followed by password) unless -PasswordOnly
is also specified.
Passwords and Secure Notes will be returned as 1 string.
Required? true
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-PasswordOnly [<SwitchParameter>]
If specified, only the password field is included in the output.
This parameter has no effect when returning Password or Secure Note entries.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Clip [<SwitchParameter>]
If specified, the plaintext content of the entry will be copied to the clipboard.
Attempts to use a system utility for copying:
- Windows: clip.exe
- Mac: pbcopy
- Linux: xclip
Required? true
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-VaultPath <String>
Specifies the root directory of the 1Password vault from which to read.
The default root directory can be read via Get-1PDefaultVaultPath, and changed via Set-1PDefaultVaultPath.
Required? false
Position? named
Default value ($script:DefaultVaultPath)
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\># Gets a login as a PSCredential.
PS ~$ Unprotect-1PEntry email
1Password vault password: **********
UserName Password
-------- --------
calvin@gmail.com System.Security.SecureString
-------------------------- EXAMPLE 2 --------------------------
PS C:\\># Pipes a decrypted password into another command which normally prompts for a password.
PS ~$ Unprotect-1PEntry systemlogin -Plaintext -PasswordOnly | sudo -Sk echo "`ndude, sweet"
1Password vault password: **********
Password:
dude, sweet
-------------------------- EXAMPLE 3 --------------------------
PS C:\\># Temporarily reveals a Secure Note by piping it to 'less'
PS ~$ Get-1PEntry mynote | Unprotect-1PEntry -Plaintext | less
1Password vault password: **********
-------------------------- EXAMPLE 4 --------------------------
PS C:\\># Copies a password to the clipboard
PS ~$ Unprotect-1PEntry mylogin -Clip -PasswordOnly
1Password vault password: **********
-------------------------- EXAMPLE 5 --------------------------
PS C:\\># Uses a bound SecureString object to specify the 1Password vault password.
PS ~$ $p = Read-Host -AsSecureString "Speak, friend, and enter"
Speak, friend, and enter: **********
PS ~$ Unprotect-1PEntry mynote $p
System.Security.SecureString
PS ~$ Unprotect-1PEntry mynote $p -Plaintext
s3cret m3ssage
RELATED LINKS
SYNOPSIS
Decrypts a 1Password Login, Password, Secure Note, or Generic Account.
SYNTAX
Unprotect-1PEntry [-Name] <String> [[-VaultPassword] <SecureString>] [-PasswordOnly] [-VaultPath <String>]
[<CommonParameters>]
Unprotect-1PEntry [-Name] <String> [[-VaultPassword] <SecureString>] [-PasswordOnly] -Clip [-VaultPath <String>]
[<CommonParameters>]
Unprotect-1PEntry [-Name] <String> [[-VaultPassword] <SecureString>] -Plaintext [-PasswordOnly] [-VaultPath
<String>] [<CommonParameters>]
Unprotect-1PEntry [-Entry] <PSObject> [[-VaultPassword] <SecureString>] [-PasswordOnly] -Clip [<CommonParameters>]
Unprotect-1PEntry [-Entry] <PSObject> [[-VaultPassword] <SecureString>] -Plaintext [-PasswordOnly]
[<CommonParameters>]
Unprotect-1PEntry [-Entry] <PSObject> [[-VaultPassword] <SecureString>] [-PasswordOnly] [<CommonParameters>]
DESCRIPTION
Decrypts a 1Password Login, Password, Secure Note, or Generic Account to various output formats.
Logins and Generic Adcounts are returned as PSCredential by default.
Passwords and Secure Notes are returned as SecureString by default.
All forms can optionally be returned as plaintext strings or copied to the clipboard.
PARAMETERS
-Name <String>
Specifies the name of the 1Password entry.
A case-insensitive wildcard match is used.
An error is thrown if no entries, or more than one entry, match the specified name.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Entry <PSObject>
Specifies the 1Password entry to decrypt.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false
-VaultPassword <SecureString>
Specifies the 1Password vault password.
If no value is specified, the user will be prompted to enter password interactively.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Plaintext [<SwitchParameter>]
If specified, the decrypted data will be returned as plaintext strings.
Logins and Generic Accounts will be returned as 2 strings (username followed by password) unless -PasswordOnly
is also specified.
Passwords and Secure Notes will be returned as 1 string.
Required? true
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-PasswordOnly [<SwitchParameter>]
If specified, only the password field is included in the output.
This parameter has no effect when returning Password or Secure Note entries.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Clip [<SwitchParameter>]
If specified, the plaintext content of the entry will be copied to the clipboard.
Attempts to use a system utility for copying:
- Windows: clip.exe
- Mac: pbcopy
- Linux: xclip
Required? true
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-VaultPath <String>
Specifies the root directory of the 1Password vault from which to read.
The default root directory can be read via Get-1PDefaultVaultPath, and changed via Set-1PDefaultVaultPath.
Required? false
Position? named
Default value ($script:DefaultVaultPath)
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\># Gets a login as a PSCredential.
PS ~$ Unprotect-1PEntry email
1Password vault password: **********
UserName Password
-------- --------
calvin@gmail.com System.Security.SecureString
-------------------------- EXAMPLE 2 --------------------------
PS C:\\># Pipes a decrypted password into another command which normally prompts for a password.
PS ~$ Unprotect-1PEntry systemlogin -Plaintext -PasswordOnly | sudo -Sk echo "`ndude, sweet"
1Password vault password: **********
Password:
dude, sweet
-------------------------- EXAMPLE 3 --------------------------
PS C:\\># Temporarily reveals a Secure Note by piping it to 'less'
PS ~$ Get-1PEntry mynote | Unprotect-1PEntry -Plaintext | less
1Password vault password: **********
-------------------------- EXAMPLE 4 --------------------------
PS C:\\># Copies a password to the clipboard
PS ~$ Unprotect-1PEntry mylogin -Clip -PasswordOnly
1Password vault password: **********
-------------------------- EXAMPLE 5 --------------------------
PS C:\\># Uses a bound SecureString object to specify the 1Password vault password.
PS ~$ $p = Read-Host -AsSecureString "Speak, friend, and enter"
Speak, friend, and enter: **********
PS ~$ Unprotect-1PEntry mynote $p
System.Security.SecureString
PS ~$ Unprotect-1PEntry mynote $p -Plaintext
s3cret m3ssage
RELATED LINKS