Skip to content

Database with Password

Kiran Reddy edited this page Apr 19, 2020 · 3 revisions

Create a LiteDb Database that is password protected.

# you will be prompted for a credential. The username does not matter, only the password field is used to
# secure the database.
New-LiteDBDatabase -Path C:\temp\LiteDB\passDatabase.db -Credential (Get-Credential)

# Lets try to open the db without providing the password
Open-LiteDBConnection C:\temp\LiteDB\passDatabase.db
Error: Invalid database password.

# Open the db with the password
Open-LiteDBConnection C:\temp\LiteDB\passDatabase.db -Credential (Get-Credential)

Database    : C:\temp\LiteDB\passDatabase.db
ConnectionInfo : LiteDB.ConnectionString
Mapper      : LiteDB.BsonMapper
Engine      : LiteDB.LiteEngine
FileStorage : LiteDB.LiteStorage
UserVersion    : 0
Timeout        : 00:01:00
UtcDate        : False
LimitSize      : 9223372036854775807
CheckpointSize : 1000
Collation      : en-US/IgnoreCase
Clone this wiki locally